https://app.cntillion.com/api/v2. Reads accept either
key permission. Writes need a Full access key. A
key acts as the person who created it, who must have agreed to the outbound
communications terms in the dashboard before their first campaign or test
call; otherwise a campaign is refused with 403 OUTBOUND_TERMS_REQUIRED.
These endpoints answer only for Campaigns page campaigns. A batch call or a
campaign that enrolls contacts is refused with
409 CAMPAIGN_KIND_UNSUPPORTED; use the
batch call or
enrollment endpoints for those.
Endpoints
Paths below are relative to/api/v2.
Create a campaign
201 with the campaign in data, created: true,
callingStartsAt (when the first call may go out: the start, or the next
calling window after it) and withinCallingWindow (whether that is now).
The campaign, its leads and its launch are written together, or not at all.
Each recipient has a
phoneNumber in E.164 format, up to four more
phoneNumbers called in order once calls to the one before keep failing,
an optional recipientId of your own (unique in the campaign), a name,
variables and overrides. A lead carries at most 56 variables: every call
adds the four campaign__ follow-up variables, and a call carries 60. Each
lead must carry every dynamic variable the agent’s published versions use,
even empty; a lead without one is refused with 400 MISSING_VARIABLES. A
number may appear once per campaign, and the campaign’s own calling number
not at all.
A repeat within 24 hours with the same idempotency key returns 200, the
campaign as it is now and created: false; the same key with another body is
refused with 409 IDEMPOTENCY_KEY_REUSED. Without a key, a repeat of exactly
the same body returns the campaign the first request made.
WhatsApp campaigns
A WhatsApp campaign takeschannel.type: "whatsapp", the
whatsappAccountId of an active account assigned to the agent, and a
mode:
voicecalls each lead on WhatsApp, with the same policy, retries and callbacks as a phone campaign (the workspace’s WhatsApp policy). Its optionaltemplateis an approved template with a call permission request, sent once to a lead who has not allowed calls yet.textsends each lead one approved messagetemplate, which it needs, and the agent answers whoever replies. It has no policy, so it is alwayssimple.
template.variables says which lead variable fills each of the template’s
values, keyed as the WhatsApp template list
names them: text placeholders by name or number under body and header,
buttons by position from 1 under buttons, and a media header’s public link
as headerMedia. A value left out is read from the lead variable of its own
name, so {{first_name}} needs no entry; a numbered placeholder such as
{{1}} does. Every lead must carry each variable the template reads. The
template is checked with Meta when the campaign is created and again when
it starts; one Meta no longer approves, or a placeholder without a variable,
is refused with 400 INVALID_TEMPLATE.
A lead’s phoneNumber is its WhatsApp number, and phoneNumbers is
refused: a WhatsApp campaign reaches each lead on one number. The key’s
creator must have agreed to the WhatsApp outbound terms in the dashboard.
An open WhatsApp campaign takes leads through the leads endpoint like a
phone campaign.
The policy
A campaign takes a copy of the policy when it is created: the workspace’s default, the agent’s override groups, then the groups the request sends. Changing the workspace settings later never changes a running campaign.0 (Monday) to 6 (Sunday); times are HH:MM in the
policy’s timezone, and an end of 24:00 runs until midnight. Timeframes on
one day may not overlap. A callback the person asked for dials at its time,
outside the windows. followUpContext says which campaign__ variables
later calls get; one switched off is sent empty, so a prompt that mentions it
still starts. GET /campaign-settings returns the workspace’s settings with
their version; PUT /campaign-settings with
{"expectedVersion": 3, "settings": {...}} replaces them, and is refused with
409 CAMPAIGN_SETTINGS_CHANGED when someone saved since that version.
Add leads to an open campaign
A system that sends leads one at a time creates the campaign once, withkeepOpen: true and as many leads as it has (none is fine), then adds the
rest as they come:
recipientId, or number when it has none, is already in the
campaign is returned as it is with created: false, so sending a lead again
adds it once; a number already there under another recipientId is refused
with 409. The answer is 201 when any lead was added. New leads are
queued like the others: the first call waits for the start and a calling
window. Only an open campaign that is scheduled, running or paused takes
leads.
Follow a campaign
status is active (calling, or waiting for its start), paused,
needs_attention (it paused itself; lastError says why), cancelling,
cancelled, completed or failed. Lists take limit and cursor; pass
the returned pagination.cursor with the same filters for the next page.
The campaign list filters by agentId, status and search.
A lead’s state is queued, in_progress (on a call or being settled) or
finished, with its disposition, nextCall, counters, variables and, on
the single lead, its calls and decision timeline. DELETE removes a lead
that waits for a call; one on a call is refused with 409 LEAD_NOT_REMOVABLE.
Pause, resume and cancel take no body. A campaign already where the action
leaves it answers as it is; a finished campaign is refused with
409 CAMPAIGN_STATE_CONFLICT. Cancelling finishes every waiting lead as
cancelled.
Attention items
Attention items are leads that could not be processed, gave a callback time or a number that could not be used, or were set aside for review, and the pause a campaign put itself in, which carries the campaign’s own id. A lead with an item is not called again unless the item is retried.GET /campaigns/attention lists them across every campaign in the
workspace, newest first, open ones only unless includeResolved=true.
campaignId keeps one campaign’s, and limit and cursor page through
them. GET /campaigns/{campaignId}/attention lists one campaign’s 200 most
recent at once.
Resolve a lead’s item with
{} (or {"resolved": false} to open it again).
Retry queues the lead for another call, which waits for a calling window and
counts toward the policy’s limits, or resumes the campaign for its own pause;
a lead at its call limit is refused with 409 LEAD_AT_CALL_LIMIT. Both work
under the campaign’s path or by the item’s id alone under
/campaigns/attention/{attentionId}; an id that names no item in the
workspace is 404 ATTENTION_NOT_FOUND.
The campaign.lead_finished webhook tells
your system when each lead finishes, including leads no call ever reached.