Skip to main content
POST
/
api
/
public
/
apps
/
track
cURL
curl --request POST \
  --url http://localhost/api/public/apps/track \
  --header 'Content-Type: application/json' \
  --header 'PublicWriteKey: <api-key>' \
  --header 'authorization: <authorization>' \
  --data '{
  "messageId": "msg_0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d",
  "timestamp": "2025-07-15T10:30:00.000Z",
  "files": [
    {
      "type": "Base64Encoded",
      "name": "<string>",
      "mimeType": "<string>",
      "data": "<string>"
    }
  ],
  "context": {
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36",
    "locale": "en-GB"
  },
  "event": "PRODUCT_VIEWED",
  "properties": {
    "productId": "prod_123xyz",
    "productName": "Tranthor SuperWidget",
    "category": "Widgets",
    "price": 29.99,
    "currency": "USD"
  },
  "userId": "usr_a1b2c3d4e5f6"
}'
"<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.tranthor.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.tranthor.com/dashboard/settings#write-key.

Body

application/json
  • Option 1
  • Option 2
messageId
string
required

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

Examples:

"msg_0a1b2c3d-4e5f-6a7b-8c9d-0e1f2a3b4c5d"

event
string
required

Name of the action that a user has performed.

Examples:

"PRODUCT_VIEWED"

userId
string
required

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

Examples:

"usr_a1b2c3d4e5f6"

"98765"

"contact_jane_doe"

timestamp
string

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

Examples:

"2025-07-15T10:30:00.000Z"

files
object[]
context
object

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

Examples:
{
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36",
"locale": "en-GB"
}
properties
object

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

Examples:
{
"productId": "prod_123xyz",
"productName": "Tranthor SuperWidget",
"category": "Widgets",
"price": 29.99,
"currency": "USD"
}

Response

An empty String

I