Skip to Content
SendlySendly
API ReferenceEvents

Record an event

POST
/api/v1/events

Records a custom event, optionally attached to a contact. Events drive segment membership and workflow triggers, so a matching enabled workflow starts as a result of this call.

contact_id must already exist in this project — unlike POST /api/track, this endpoint never creates contacts. Omit it for a project-level event.

Reserved system event names (email.*, contact.subscribed/unsubscribed, segment.*.entry/.exit) are rejected with 422: they are written by Sendly's own pipeline and accepting them from a caller would corrupt the series segments read.

This endpoint does NOT require an Idempotency-Key. Events are append-only and the highest-volume write on the surface; a duplicate is a data-quality question for the caller, not a money-path hazard.

Sending-only (pk_*) keys cannot record events — they hold the send capability and nothing else.

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/v1/events.

name*string

Event name, e.g. user.signup.

Length1 <= length <= 200
contact_id?string

Contact the event belongs to. Must already exist in this project — unlike the legacy POST /api/track, this endpoint never creates contacts. Omit for a project-level event.

Formatuuid
payload?

Arbitrary event payload.

Response Body

Event recorded

application/json
  1. response

A recorded custom event.

id*string
Formatuuid
name*string
contact_id*|
Formatuuid
email_id*|
Formatuuid
payload*|

The payload recorded with the event, or null.

created_at*string
Formatdate-time
Example Request
curl -X POST 'https://api.sendly.now/api/v1/events' \  -H 'Content-Type: application/json' \  -d '{  "name": "string"}'
Example Response
{  "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",  "name": "string",  "contact_id": "f245e2a3-e141-4d41-912c-b1c1f5bd5598",  "email_id": "8e6bf5ae-e456-4654-87f8-33e2156caffc",  "payload": {    "property1": null,    "property2": null  },  "created_at": "2019-08-24T14:15:22Z"}