Skip to main content
POST
/
events
/
custom
curl --request POST \
--url https://api.sendx.io/api/v1/rest/events/custom \
--header 'Content-Type: application/json' \
--header 'X-Team-ApiKey: <api-key>' \
--data '{
"identifier": "user@example.com",
"name": "video_watched",
"data": {
"video_id": "12345",
"duration": "120",
"completed": "true"
},
"time": 1669990400
}'
{
  "status": "success",
  "message": "Event tracked successfully"
}

Request Properties

PropertyTypeDescription
namestringThe name of the custom event.
identifierstringA unique identifier for the contact (e.g., an email address).
datamap[string]stringA set of key-value pairs containing additional event properties.
timeint64 (optional)Unix timestamp (in seconds since January 1, 1970) representing when the event occurred. If omitted, the current request time will be used.

Example Request:

{
  "name": "abandoned_cart",
  "identifier": "john.doe@example.com",
  "data": {
    "price": "29.99",
    "currency": "USD",
    "item_count": "3"
  },
  "time": 1669990400
}

Authorizations

X-Team-ApiKey
string
header
required

Team API key for authentication. Find your API key in SendX Settings → Team API Key.

Example:

X-Team-ApiKey: your_team_api_key_here

Body

application/json
identifier
string
required

This is the contact identifier. Contact id and email can be used interchangeably.

Example:

"user@example.com"

name
string
required

Event name

Example:

"video_watched"

data
object

Event data

Example:
{
"video_id": "12345",
"duration": "120",
"completed": "true"
}
time
integer

Unix timestamp (in seconds since January 1, 1970) representing when the event occurred.

Example:

1669990400

Response

✅ Custom event tracked successfully

status
string
Example:

"success"

message
string
Example:

"Event tracked successfully"

I