Create a campaign
Authentication
Request
Agent of this workspace. It must serve the campaign’s channel (400 otherwise); an unknown agent answers 404.
Weekly calling window, stored and returned exactly as sent (camelCase inside the object).
The dialer starts a call only when the local hour in timezone is >= startHour and
< endHour on an enabled day; outside it, the call is rescheduled to the next window. A call
that started inside the window may run past endHour. Days that are left out count as disabled.
Validation: timezone must be a valid IANA zone (Invalid IANA timezone), every enabled day
needs startHour < endHour, and at least one day must be enabled
(At least one day must be enabled). WhatsApp and email sends are not bound to this window.
Maximum simultaneous calls. Silently lowered to the plan’s ceiling (Starter 3, Growth 10, Business 25) and to the platform maximum.
Maximum dial attempts per contact, counting the first; unanswered, busy or unconnected calls
are redialed until this many exist. 0 or 1 disables redialing. Voice only. A plan gate
(403 BILLING_ERROR) exists for values above 0, but every plan includes retries today.
voice, whatsapp, webchat or email (see Campaign.channel). An email campaign needs
the workspace’s own mailbox connected in Integrations and selected as sender (409 otherwise).
Purpose of the campaign, used to classify outcomes (see Campaign.category for each value).
WhatsApp template (from the workspace’s templates) that makes activation send outbound messages. WhatsApp approval is checked at activation, not here.
Campaign-wide placeholder values, the same for every contact. Either an array of up to 20 strings ({{1}} is index 0) or an object keyed by index (keys up to 8 characters); values up to 500 characters.
Placeholders filled per contact, keyed by placeholder index (up to 3 characters), for example
{"1": "contact.first_name"}. A value is the token alone, meaning skip a contact that cannot
resolve it, or { token, fallback } to write the fallback instead. Skipped contacts end as
invalid. Indexes must exist in the template body (400 otherwise).
Subject for outbound email, may contain tokens. Needs emailBody too; activation refuses one without the other.
Plain-text body for outbound email, may contain tokens.
Response
The campaign was created in draft status.
A campaign row as returned by the retrieve, create, update, activate and pause endpoints.
Keys are snake_case, exactly as stored. The list endpoint returns a lighter
CampaignListItem instead.

