Skip to Content
SendlySendly
API ReferenceEvents

Track a custom event for a contact

POST
/api/track

Record a custom event, creating or updating the contact by email as a side effect. Requires a FULL (sk_*) key — SENDING_ONLY (pk_*) keys answer 403, since recording events is not sending mail. Reserved system event names (email.*, contact.subscribed/unsubscribed, segment.*.entry/.exit) are rejected.

Requires the events:write scope — Record custom events for your contacts.

headerAuthorizationBearer <API Key>

API key authentication. Use a sk_* (FULL) or pk_* (SENDING_ONLY) key as the bearer token. Public keys (pk_*) are restricted to the email-send endpoints and the self-serve list subscribe/unsubscribe pair; every other endpoint — event tracking included — answers 403 for them. In scope terms (used by /api/v1/* operations): FULL keys hold every scope; SENDING_ONLY keys hold only emails:send.

application/json
  1. body

Body for POST /api/track — record a custom event for a contact.

event*string
Length1 <= length
email*string
Formatemail
subscribed?boolean
data?

Arbitrary JSON value (string, number, boolean, null, array, or object).

Response Body

Event tracked

application/json
  1. response

Response from POST /api/track.

success*true
Value intrue
data*
Example Request
curl -X POST 'https://api.sendly.now/api/track' \  -H 'Content-Type: application/json' \  -d '{  "event": "string",  "email": "user@example.com"}'
Example Response
{  "success": true,  "data": {    "contact": "ad596931-5d7c-4d2b-907e-5b64c9432eb4",    "event": "1a4a8620-0119-4336-af71-a3b3e24f5ebc",    "timestamp": "2019-08-24T14:15:22Z"  }}