Events API

The Events API allows you to send custom tracking data to Emp-Mix from any backend or client source.


Track Single Event

Use this endpoint to track a single user action.

Endpoint

POST /public/track

Authentication

Include your Public API Key in the JSON payload.

Parameters

ParameterTypeRequiredDescription
apiKeystringYesYour Public API Key.
eventstringYesThe name of the event.
distinct_idstringYesThe unique identifier of the user who triggered the event.
propertiesobjectNoCustom metadata describing the event.
timestampnumberNoEpoch timestamp in milliseconds. Defaults to current server time if omitted.

Request Example

curl -X POST "https://api.empmix.com/public/track" \
  -H "Content-Type: application/json" \
  -d '{
    "apiKey": "YOUR_PUBLIC_API_KEY",
    "event": "purchase",
    "distinct_id": "user_123",
    "properties": {
      "price": 99.99,
      "currency": "USD"
    }
  }'

Response Example

{
  "status": 1,
  "error": null
}

Bulk Import Events

Use this endpoint to import historical data or flush large queues of events.

Endpoint

POST /public/track/bulk

Authentication

⚠️
Privileged Endpoint
This endpoint requires your Secret Key, not your Public API Key.

Parameters

ParameterTypeRequiredDescription
apiKeystringYesYour Secret Key.
eventsarrayYesAn array of event objects. Maximum 1000 events per request.

Request Example

{
  "apiKey": "YOUR_SECRET_KEY",
  "events": [
    {
      "event": "signup",
      "distinct_id": "user_123",
      "timestamp": 1672531200000,
      "properties": {}
    }
  ]
}

Fetch Raw Events

Export your raw events data for external processing or backup.

Endpoint

GET /public/events

Authentication

Pass your Secret Key in the x-api-key HTTP Header.

Parameters (Query String)

ParameterTypeRequiredDescription
limitintegerNoNumber of events to return. Max 10,000. Default: 50.
pageintegerNoPage number for pagination. Default: 1.

Request Example

curl -X GET "https://api.empmix.com/public/events?limit=10&page=1" \
  -H "x-api-key: YOUR_SECRET_KEY"
Last updated on June 4, 2026