Sequences API

Enrol or unenrol contacts into automated email sequences.

What this does

The Sequences API lets a bot drop a contact into (or out of) an automated email sequence — the same engine that powers the in-app /sequences Workflow. Use it to wire contact-lifecycle events from outside the CRM dashboard ("new WhatsApp lead → enroll in welcome series").

Sequence creation, step authoring, and status changes remain dashboard-only. v1 only exposes the enrol/unenrol surface a bot needs.

When to use it

  • Enrol a freshly-captured contact into a welcome series.
  • Unenrol a contact who replied "STOP" via a different channel.
  • Trigger nurture sequences from external automations (Zapier, n8n, WhatsApp bot).

Authentication and scopes

Requests must include Authorization: Bearer <key>. The endpoints require:

  • sequences:write — enrol or unenrol a contact

Endpoints

Enrol a contact

POST /api/v1/sequences/:id/enroll

{ "contact_id": "cnt_abc123" }

contact_id is required (camelCase contactId is also accepted; first wins). The first step's delay_days is honoured — if the first step has delay_days = 0, the sequence runs on the next sequence-processor cron tick (every 5 minutes).

Response (201 Created): the created crm_sequence_enrollments row.

Errors:

| Code | Status | Meaning | |---|---|---| | not_found | 404 | No sequence with that id in this entity | | already_enrolled | 409 | Contact has an active enrollment in this sequence already | | missing_field | 400 | contact_id missing | | sequences_write_denied | 403 | API key lacks sequences:write |

Unenrol a contact

POST /api/v1/sequences/:id/unenroll

{ "contact_id": "cnt_abc123" }

Marks the contact's active enrollment for this sequence as completed. If the contact has no active enrollment (already completed, or never enrolled), returns 404.

Response:

{
  "data": {
    "id": "en_xyz",
    "status": "completed",
    "sequence_id": "seq_abc",
    "contact_id": "cnt_abc123"
  }
}

Errors:

| Code | Status | Meaning | |---|---|---| | not_found | 404 | No sequence with that id in this entity | | not_enrolled | 404 | Contact is not actively enrolled in this sequence | | missing_field | 400 | contact_id missing | | sequences_write_denied | 403 | API key lacks sequences:write |