Skip to main content

Track Custom Event

Track a custom event for a contact. Custom events can be used to trigger automations with the CUSTOM_EVENT trigger type.


Endpoint

POST https://api.campaignlark.com/v1/events

Request Body

FieldTypeRequiredDescription
email_addressstringrequiredEmail address of the contact to associate the event with.
event_namestringrequiredName of the custom event to track.
propertiesobjectoptionalArbitrary key-value map of event properties. Defaults to {} if omitted.

Sample Request

POST https://api.campaignlark.com/v1/events
Content-Type: application/json

{
"email_address": "joffrey@example.com",
"event_name": "purchase_completed",
"properties": {
"order_id": "ORD-9001",
"total": 99.99,
"currency": "USD"
}
}

Success — 200 OK

{
"data": {
"queued": true
}
}

Errors

StatusMessageCause
400Email address is required.email_address field is missing or empty.
400Event name is required.event_name field is missing or empty.
429(billing message)Event usage limit for the workspace has been reached.

Properties Constraints

The properties object must adhere to the following limits:

ConstraintLimit
Top-level typeMust be a JSON object (not an array or primitive).
Serialized size16 KB max.
Nesting depth5 levels max (counting the top-level object as level 1).
Keys per object50 max.
Key length128 characters max.
Forbidden key charactersKeys cannot start with $ or contain ..