Skip to main content
POST
Create a campaign

Authorizations

Authorization
string
header
required

A workspace API key from Workspace settings > API keys, sent as Authorization: Bearer cl_api_.... A Read only key can call the GET endpoints; every other method needs a Full access key.

Headers

Idempotency-Key
string

Between 1 and 128 characters. A retry with the same key and body gets the first answer back and writes nothing; the same key with another body is refused with 409.

Required string length: 1 - 128

Body

application/json
name
string
required
Required string length: 1 - 120
agentId
string
required
Required string length: 1 - 128
channel
object
required
recipients
object[]

Up to 1,000 leads. Send more, or send them over time, to a campaign created with keepOpen through the leads endpoint.

Maximum array length: 1000
startsAt
string<date-time> | null

When calling may start; left out, at once. Calls still wait for a calling window.

timezone
string

The IANA timezone the calling windows are read in, instead of the policy's.

Required string length: 1 - 64
branchId
string | null

A published branch of the agent to call with; left out, the agent's traffic split decides.

Required string length: 1 - 128
concurrencyLimit
integer | null
Required range: 1 <= x <= 1000
callsPerMinute
integer
default:20
Required range: 1 <= x <= 20
allowedOverrides
enum<string>[]
Maximum array length: 4
Available options:
prompt,
first_message,
language,
voice_id
variant
enum<string>

Left out, advanced, or simple for a WhatsApp text campaign, which sends each lead one message.

Available options:
simple,
advanced
policy
object

Policy groups to use instead of the workspace's: each group sent replaces that whole group of the policy the workspace settings give the agent.

keepOpen
boolean
default:false

Keep the campaign open for leads added after it starts: it does not complete when every lead is finished, only when it is cancelled. Only an open campaign takes new leads.

idempotencyKey
string

Makes the request safe to retry, as the Idempotency-Key header does; send one or the other. Without either, a request repeating an earlier one's body exactly returns that campaign.

Required string length: 1 - 128

Response

A repeat of an earlier request.

data
object
required
created
boolean
required

False when the request repeated an earlier one.

callingStartsAt
string<date-time>
required

When the first call may go out: the start, or the next calling window after it.

withinCallingWindow
boolean
required

Whether calling starts now rather than later.