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"
}{
"status": 401,
"message": "The Team ID or API Key specified is not valid"
}{
"status": "error",
"message": "Request body is not in proper format"
}{
"status": "error",
"message": "Internal server error occurred"
}Events
Push custom event
Records custom events for advanced tracking.
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"
}{
"status": 401,
"message": "The Team ID or API Key specified is not valid"
}{
"status": "error",
"message": "Request body is not in proper format"
}{
"status": "error",
"message": "Internal server error occurred"
}Request Properties
| Property | Type | Description |
|---|---|---|
| name | string | The name of the custom event. |
| identifier | string | A unique identifier for the contact (e.g., an email address). |
| data | map[string]string | A set of key-value pairs containing additional event properties. |
| time | int64 (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
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
This is the contact identifier. Contact id and email can be used interchangeably.
Example:
"user@example.com"
Event name
Example:
"video_watched"
Event data
Show child attributes
Show child attributes
Example:
{
"video_id": "12345",
"duration": "120",
"completed": "true"
}
Unix timestamp (in seconds since January 1, 1970) representing when the event occurred.
Example:
1669990400
Was this page helpful?