Create a campaign
Makes a draft campaign. Nothing rings until you start it.
Required: name, agent_id, timezone, start_date, end_date and slots. Dates are YYYY-MM-DD and slots are HH:MM, both in the campaign’s own timezone; up to 4 slots, and a slot may cross midnight. Set the dates to the days you actually want to call. A campaign whose dates have passed finishes as soon as it starts.
Optional: max_concurrent (1–50, default 1), retry_count (0–5 retries after the first attempt, default 0), re_attempt_period_secs (60–86400, default 900), max_duration_secs (defaults to the agent’s), budget_paise (leave it out for no cap), webhook_url, skip_called_before (skip numbers another campaign has already reached), final_results (default true: each call ends with one call.processed carrying the transcript, the results and the contact’s metadata) and tier (defaults to your plan).
contacts is optional here: up to 1000 rows per request, each {id?, phone, variables?, metadata?}. variables fill the placeholders in the agent’s prompt for that person, the same way they do on a single call. metadata is your own fields the agent doesn’t need (a CRM id, a branch): kept with the contact and sent on each of its calls’ webhooks, never given to the agent. Every campaign call’s webhooks also name its campaign_id and contact_id. A bad row doesn’t sink the upload. It comes back in contacts_rejected with its index, and the good rows are stored.
There is no idempotency key on this route. If a create times out, list your campaigns before you retry, or you may end up with two.
Authorizations
Your workspace secret key, sk_live_ followed by 32 hex characters. Create one in the console under Developers.
Body
One of your phone numbers (GET /v2/phone-numbers) that every call of this campaign rings from, through its own provider connection. null clears it. Exclusive with caller_ids.
One of your phone pools (GET /v2/phone-pools): each contact rings from the number the pool picks. null clears it. Exclusive with phone_number_id and caller_ids.
Response
Draft created