Documentation
API and webhooks
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
| Method | Path | Notes |
|---|---|---|
| GET | /api/v1/me | The key's user and workspace. |
| GET | /api/v1/properties | Merge fields with option values, tags, segments and users. |
| GET | /api/v1/contacts | Query: limit, offset, search, sort, listId, filters. Returns { records, total }. |
| GET | /api/v1/contacts/:id | A contact with its tags and recent emails. |
| POST | /api/v1/contacts | Body { "values": { "email": "…" } }. An existing email answers 409 with its id. |
| PATCH | /api/v1/contacts/:id | Only the keys you send change. null clears a value. |
| DELETE | /api/v1/contacts/:id | Archives the contact. |
| POST | /api/v1/contacts/:id/notes | Body { "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:
| Header | Value |
|---|---|
sendlyne-event | The event name. |
sendlyne-delivery | A unique id for this delivery. |
sendlyne-signature | Hex 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
| Path | Use |
|---|---|
GET/POST /api/public/forms/:id | A signup form's definition and submissions (JSON or a plain form post). CORS is open. |
/embed/form.js | Renders <div data-sendlyne-form="ID"> on any site. |
GET/POST /api/public/surveys/:id | Survey answers. |
/u/<token> | Preference page and one-click unsubscribe (RFC 8058). |