Skip to main content
POST
Create a campaign

Headers

x-api-key
string | null

Your API key for programmatic access. Send it in the x-api-key header; you can create and manage keys from the Developers page.

Body

application/json
call_name
string
required

The campaign's name.

Required string length: 1 - 256
agent_id
string
required

The agent that places the calls.

Required string length: 1 - 256
recipients
SubmitCampaignRecipient · object[]
required

Who to call. Each recipient becomes a lead of the campaign.

Required array length: 1 - 10000 elements
channel_config
PhoneChannelConfig · object
required
scheduled_time_unix
integer | null

When to start calling; omit to start now. Calls still wait for the next calling window.

Required range: x >= 0
timezone
string | null

IANA timezone to read the calling windows in, overriding the policy's.

branch_id
string | null

The agent branch to call with.

Maximum string length: 256
environment
string | null

The environment to resolve the agent's environment variables in.

Maximum string length: 256
target_concurrency_limit
integer | null

The most calls to place at once.

Required range: x >= 1
idempotency_key
string | null

Makes the request safe to retry: a repeat with the same key returns the campaign it created.

Required string length: 1 - 256
policy
PolicyConfig · object | null

Policy to snapshot onto the campaign. When set, it wins over the workspace default and any per-agent override; when omitted, the workspace configuration must exist and supplies the policy.

variant
enum<string> | null

simple runs one attempt per recipient with always-on calling windows and nothing collected, and cannot be combined with policy. advanced uses policy or the workspace configuration, and is the default for phone campaigns.

Available options:
simple,
advanced

Response

Successful Response

campaign
CampaignResponse · object
required
created
boolean
required

False when the request repeated an earlier one and returned its campaign.

within_calling_window
boolean
required

Whether calling starts right away rather than at the next calling window.