Skip to content

Documentation

API and webhooks

Everything the app does is available over HTTP. Keys are created in Settings, API and webhooks (Starter plan and above). For the user guide, see the documentation.
On this page

Authentication

Keys start with snd_ and act as the user who created them, with that user's role, in one workspace. Send the key as a bearer token.

curl https://sendlyne.com/api/v1/me \
  -H "Authorization: Bearer snd_…"

Responses are { "data": … }. Errors are { "error": "…" } with a status: 400 invalid input, 401 bad key, 402 plan, 403 role, 404 not found, 409 duplicate, 429 rate limit. The limit is 600 requests a minute per user. Transactional keys carry the transactional scope.

Contacts

MethodPathNotes
GET/api/v1/meThe key's user and workspace.
GET/api/v1/propertiesMerge fields with option values, tags, segments and users.
GET/api/v1/contactsQuery: limit, offset, search, sort, listId, filters. Returns { records, total }.
GET/api/v1/contacts/:idA contact with its tags and recent emails.
POST/api/v1/contactsBody { "values": { "email": "…" } }. An existing email answers 409 with its id.
PATCH/api/v1/contacts/:idOnly the keys you send change. null clears a value.
DELETE/api/v1/contacts/:idArchives the contact.
POST/api/v1/contacts/:id/notesBody { "body": "…" }.

A contact has typed fields email, phone, source and status (subscribed, unsubscribed, cleaned, pending, transactional), plus any merge field. Filter operators: eq, neq, contains, not_contains, starts, empty, not_empty, gt, gte, lt, lte, in, not_in, before, after, last_days, next_days.

curl -X POST https://sendlyne.com/api/v1/contacts \
  -H "Authorization: Bearer snd_…" -H "content-type: application/json" \
  -d '{"values":{"email":"ana@example.com","firstname":"Ana"}}'

Events

Send an event for a person and use it as an automation trigger, for example a purchase.

curl -X POST https://sendlyne.com/api/v1/events \
  -H "Authorization: Bearer snd_…" -H "content-type: application/json" \
  -d '{"email":"ana@example.com","name":"order.paid","properties":{"total":49}}'

Transactional messages

POST /api/v1/messages sends one-to-one email. The from address must be on a verified sending domain.

curl -X POST https://sendlyne.com/api/v1/messages \
  -H "Authorization: Bearer snd_…" -H "content-type: application/json" \
  -d '{
    "from": "accounts@example.com",
    "to": ["ana@example.com"],
    "subject": "Reset your password",
    "template": "password-reset",
    "variables": { "link": "https://example.com/reset/9f2c" },
    "tags": ["auth"]
  }'

Fields: from, to (up to 50), subject, html or text or template with variables, reply_to, headers, tags, metadata, track_opens, track_clicks. The response lists a message id per recipient; GET /api/v1/messages/:id returns its status and events.

Operations

POST /api/v1/ops with { "op": "…", "args": { … } } runs any operation the app itself uses. An unknown operation answers with the list of known ones. Operations go through the same validation, plan limits and audit log as the app.

Webhooks

Admins add an HTTPS URL and choose events in Settings, API and webhooks. Events include record.created, record.updated, record.deleted, form.submitted and email events such as email.delivered and email.bounced. Each delivery is a POST of { "event", "data", "sentAt" } with these headers:

HeaderValue
sendlyne-eventThe event name.
sendlyne-deliveryA unique id for this delivery.
sendlyne-signatureHex HMAC-SHA256 of the raw body, keyed with the webhook secret.

Verify the signature before trusting a payload. Non-2xx answers are retried up to 5 times. Automations can also call any URL with the webhook step, signed the same way.

Public endpoints

PathUse
GET/POST /api/public/forms/:idA signup form's definition and submissions (JSON or a plain form post). CORS is open.
/embed/form.jsRenders <div data-sendlyne-form="ID"> on any site.
GET/POST /api/public/surveys/:idSurvey answers.
/u/<token>Preference page and one-click unsubscribe (RFC 8058).
These endpoints need no key and are rate limited per IP.