The Track Event API allows you to record custom events for users in real time. Use this API to monitor user actions, feature usage, and engagement for analytics and personalized experiences.

Endpoint

[POST] https://analytex.userpilot.io/v1/track

Headers

HeaderValueRequired
Content-Typeapplication/jsonYes
AuthorizationToken {YOUR_API_KEY}Yes
X-API-Version2020-09-22Yes

Request Body

FieldTypeRequiredDescription
user_idstringYesIdentifier of the user associated with the event
event_namestringYesName of the event to track
metadataobjectNoKey-value pairs providing additional event details

Example

{
  "user_id": "unique_user_id",
  "event_name": "user_subscribed",
  "metadata": {
    "plan": "free",
    "created_at": "1519205055"
  }
}

Example cURL Command

curl -X POST https://analytex.userpilot.io/v1/track \
  -H 'Content-Type: application/json' \
  -H 'Authorization: Token {YOUR_API_KEY}' \
  -H 'X-API-Version: 2020-09-22' \
  -d '{
    "user_id": "unique_user_id",
    "event_name": "user_subscribed",
    "metadata": {
      "plan": "free",
      "created_at": "1519205055"
    }
  }'

Response

A successful event tracking returns HTTP status code 202 Accepted.
  • Only primitive types (string, number, boolean, null) are supported in metadata.
Use this endpoint to track any custom event relevant to your analytics or engagement workflows.