Permissions: campaigns:read to see campaigns, campaigns:write to create, send and schedule them. Campaigns must be on your plan. All paths below start with https://YOUR-CRM-ADDRESS.
Method | Path | Permission | What it does |
|---|
GET
| /api/v1/campaigns
| campaigns:read
| List campaigns with their status and counts |
GET
| /api/v1/campaigns/{id}
| campaigns:read
| Get one campaign's status and counts |
POST
| /api/v1/campaigns
| campaigns:write
| Create a draft email campaign |
POST
| /api/v1/campaigns/{id}/send
| campaigns:write
| Send a draft now |
POST
| /api/v1/campaigns/{id}/schedule
| campaigns:write
| Schedule a draft |
Creating and sending are separate on purpose: retrying a create can never email anyone.
Before you start
You need two things set up in the app:
A layout: an email template whose body contains exactly one {{content}} placeholder where your content goes. Put your unsubscribe link and address in it too.
A list: the people the campaign goes to. The list also decides where unsubscribes are recorded. A layout can carry its own default list.
See campaigns
GET /api/v1/campaigns and GET /api/v1/campaigns/{id} return each campaign's id, name, type, channel, status, subject, scheduledAt, sentAt, isArchived, the counts (totalRecipients, sentCount, deliveredCount, openCount, clickCount, bounceCount, unsubscribeCount) and timestamps. Never the message itself or who it went to.
Create a draft
POST /api/v1/campaigns
{
"name": "August promo",
"subject": "Your August offer is here",
"preheader": "20% off gutter cleaning this month",
"layout": "Monthly newsletter",
"listId": "kl1a2b3c4d5e6f7g8h9i0j1k",
"contentHtml": "<h1>Hello {{contact.firstName}}</h1><p>Book before August 31 to save 20%.</p>"
}
Field | What it does |
|---|
name
| Required. Your internal name. Customers never see it. |
subject
| Required. The email subject line. |
layout
| Required. The exact name of the layout template. |
contentHtml
| Required. Your content. It is placed into the layout's {{content}} slot. |
listId
| The list to send to. Leave it out to use the layout's default list. |
preheader
| Optional preview text shown after the subject in most inboxes. |
Returns 201 with { "data": { "id": "...", "status": "draft" } }.
If something is wrong, you get 400 and the message starts with the reason: layout_not_found: (no layout with that name), layout_invalid: (for example no {{content}} slot), list_required: (no list given and the layout has none, or the list is archived) or feature_unavailable:.
There is no test-send through the API. To preview, open the draft campaign in the app and use Preview & Test.
Send now
POST /api/v1/campaigns/{id}/send with no body. It works on a draft or a scheduled campaign and moves it to sending. A campaign that was scheduled is unscheduled first, so it can never go out twice.
Only email campaigns can be sent this way; text-message broadcasts must be sent from the app. A send is refused with 400 and a reason prefix: invalid_status:, channel_unsupported:, list_required: or empty_audience: (nobody on the list can receive it).
A test token sends campaigns for real. Test mode only holds back conversation messages.
Schedule
POST /api/v1/campaigns/{id}/schedule:
{ "scheduledAt": 1777593600000 }
scheduledAt is Unix milliseconds. A value that looks like seconds is refused.
Only a draft can be scheduled.
The time must be in the future (up to 5 minutes of clock difference is allowed) and no more than a year ahead. To send straight away, use /send instead.