POST
/
api
/
public
/
apps
/
track
curl --request POST \
  --url http://localhost:3001/api/public/apps/track \
  --header 'Content-Type: application/json' \
  --header 'PublicWriteKey: <api-key>' \
  --header 'authorization: <authorization>' \
  --data '{
  "messageId": "23d04926-78e5-4ebc-853f-f26c84ff629e",
  "timestamp": "2024-04-22T07:00:00.000Z",
  "files": [
    {
      "type": "Base64Encoded",
      "name": "<string>",
      "mimeType": "<string>",
      "data": "<string>"
    }
  ],
  "event": "COURSE_CLICKED",
  "properties": {
    "title": "Intro to customer engagement"
  },
  "context": {
    "ip": "192.0.2.1"
  },
  "userId": "1043"
}'
"<string>"

The following is an example of a track body.

example body
{
  "event": "Signed Up",
  "userId": "1043",
  "properties": {
    "plan": "Enterprise"
  },
  "messageId": "1ff51c9c-4929-45de-8914-3bb878be8c4a"
}

Authorizations

PublicWriteKey
string
header
required

Authorization header for the request, in the format Bearer <token>. Find your token at https://app.dittofeed.com/dashboard/settings#write-key.

Headers

authorization
string
required

Authorization header for the request, in the format Bearer <token>. Find your token at https://app.dittofeed.com/dashboard/settings#write-key.

Body

application/json
messageId
string
required

Unique identifier for the message, used as an idempotency key for safe retries. Can provide a UUID.

Example:

"23d04926-78e5-4ebc-853f-f26c84ff629e"

event
string
required

Name of the action that a user has performed.

Example:

"COURSE_CLICKED"

userId
string
required

Unique identifier for the user. Should be the id of the user in your system. Only applicable to logged in users.

Example:

"1043"

timestamp
string

ISO 8601 formatted timestamp of when the event occurred. If not provided, the current server time will be used.

Example:

"2024-04-22T07:00:00.000Z"

files
object[]

File associated with user event.

properties
object

Free-form dictionary of properties of the event, like revenue or product name. Can contain arbitrary JSON values.

Example:
{ "title": "Intro to customer engagement" }
context
object

Provides metadata about the user submitting the event and the context in which the event occurred.

Example:
{ "ip": "192.0.2.1" }

Response

204
application/json

An empty String