Senlo
API reference

Send a contact event

POST
/api/events

Identifies a contact by email, creates or updates it, and starts every active automation whose trigger listens for the event.

EventContact must existWhat it does
contact_addednoCreates the contact, or updates name and replaces metadata of an existing one.
contact_updatedyesUpdates name and locale, merges metadata into the contact's metadata.
tag_addedyesAdds metadata.tags to the contact's tags, without duplicates.
order_createdno, created if missingStarts automations listening for purchases.
event_triggeredno, created if missingA custom event; carry your own data in metadata.

Authorization

bearerAuth
headerAuthorizationBearer <token>

An API key from Workspace → API Keys, starting with snl_.

Request Body

application/json
  1. body
event*string
Value in"contact_added""contact_updated""tag_added""order_created""event_triggered"
email*string
Formatemail
name?string
locale?string

The contact's locale. Automations send the trigger's template for it.

metadata?

Contact attributes. For tag_added, metadata.tags is an array of strings.

Response Body

The event was applied and matching automations were started.

application/json
  1. response
success*boolean
data*
curl -X POST 'https://senlo.io/api/events' \  -H 'Content-Type: application/json' \  -d '{  "event": "contact_added",  "email": "user@example.com",  "name": "Jean-Pierre",  "locale": "fr",  "metadata": {    "plan": "premium"  }}'
Example Response
{  "success": true,  "data": {    "id": 0,    "projectId": 0,    "email": "user@example.com",    "name": "string",    "locale": "string",    "meta": {},    "unsubscribed": true,    "unsubscribedAt": "2019-08-24T14:15:22Z",    "createdAt": "2019-08-24T14:15:22Z"  }}