Skip to main content

Send Event

Send (ingest) a custom event for a contact. The event name must already be defined for your organization, and the payload is validated against that definition's schema. Accepted events can trigger automations in real time.

Endpoint

POST /events/send

Returns: 202 Accepted

Headers

HeaderValueRequired
AuthorizationBearer <your-api-key>Yes
Content-Typeapplication/jsonYes

Body Parameters

ParameterTypeRequiredDescription
eventstringYesName of a defined event for your organization.
emailstringConditionalEmail of the contact the event is about. Provide exactly one of email or contact_id. If no contact with this email exists, one is auto-created when the automation runs.
contact_idstringConditionalContact UUID the event is about. Provide exactly one of email or contact_id.
dataobjectYesEvent payload. Validated against the event's declared schema.
timestampstringNoISO 8601 timestamp the event occurred. Defaults to server time.
Identify the contact

You must provide exactly one of email or contact_id. Providing both returns 400, and providing neither returns 400.

{
"event": "order.completed",
"email": "john.doe@example.com",
"data": {
"order_id": "A-1023",
"total": 149.99
},
"timestamp": "2026-06-01T12:00:00.000Z"
}

Response

The event is accepted for asynchronous processing. id is the event log ID.

{
"id": "01957e3a-4b5c-7d8e-9f0a-1b2c3d4e5f6a",
"status": "accepted"
}
FieldTypeDescription
idstringEvent log ID (UUIDv7)
statusstringAlways accepted for a 202 response

Examples

curl -X POST "https://api.arsel.sa/v1/events/send" \
-H "Authorization: Bearer be_your_api_key" \
-H "Content-Type: application/json" \
-d '{
"event": "order.completed",
"email": "john.doe@example.com",
"data": { "order_id": "A-1023", "total": 149.99 }
}'

Error Responses

Provide exactly one of email or contact_id:

{
"status_code": 400,
"name": "bad_request",
"message": "Provide either email or contact_id."
}