Skip to main content
POST
/
tr
/
api
/
events
curl --request POST \
  --url https://api.upstackdata.com/tr/api/events \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --header 'x-pixel-id: <api-key>' \
  --data '
{
  "name": "purchase",
  "user": {
    "email": "jane@example.com",
    "userId": "cust_889"
  },
  "value": 99.9,
  "currency": "USD",
  "properties": {
    "orderId": "10421",
    "items": [
      {
        "id": "SKU1",
        "name": "Tee",
        "price": 49.95,
        "quantity": 2
      }
    ]
  }
}
'
{
  "success": true,
  "eventId": "01J9Z3K8QW5RT6Y7Z8A9B0C1D2"
}

Authorizations

x-api-key
string
header
required

Your Upstack API key. Starts with upstack_.

x-pixel-id
string
header
required

The pixel id the request targets.

Body

application/json
name
string
required

Event name — a standard event or your own custom name.

Maximum string length: 100
Pattern: ^[a-zA-Z][a-zA-Z0-9_]*$
Example:

"purchase"

user
object

Limited end-user identity. Describes the END USER, not your server.

value
number

Convenience for monetary value; folded into the event data.

currency
string
Maximum string length: 10
properties
object

Event properties. Standard e-commerce fields are recognized. Additional custom keys are allowed, but each value must be a primitive or a shallow array of primitives (no nested objects).

Response

Event accepted and queued for processing.

success
boolean
required
eventId
string
required

Server-generated event id (ULID).