Create a campaign
Creates a campaign in draft. A draft holds configuration only — it places no calls and does not need a caller-ID route yet. Import a recipient list, then launch. Calling windows, retry backoffs, and the timezone mode come from policy_overrides on top of the organization's outbound policy.
bearerAuthAuthorizationBearer <token>Use a Voice API key or connected-app OAuth access token. Authentication.
Idempotency-Key*stringRequired. Reuse the same key to retry this write safely. Retries and idempotency.
^[A-Za-z0-9!#$%&'*+.^_`|~-]+$1 <= length <= 255application/json- body
A campaign is created as a draft, so only a name and a target — an agent (agent_id) or a group (group_id) — are required. A caller-ID source (number_pool_id or phone_number_id) is required to launch, not to create.
name?string1 <= length <= 120description?stringlength <= 2000agent_id*stringRequired unless group_id is given; setting both is rejected with 422 conflict on group_id.
uuidgroup_id?stringDial through a group of agents instead of one agent: the feeder picks one member per recipient. The group must have a member that can take calls now (422 on group_id: not_found, archived, no_members), and agent_version_id cannot be pinned. Requires the groups entitlement in addition to campaigns.
uuidagent_version_id?stringuuidnumber_pool_id?stringuuidphone_number_id?stringuuidtrunk_id?stringuuidtransport?PhoneNumberTransport"livekit_sip""twilio_media_streams"start_at?stringdate-timeend_at?stringdate-timepolicy_overrides?Per-job overrides. The organization policy may disable all overrides, and overridden windows must fit inside organization guardrails. timezone is accepted only with timezone_mode=custom; custom mode requires it.
max_concurrent?integer1 <= value <= 1000reserved_for_other?integer0 <= value <= 1000board_id?stringuuidauto_resume_on_renewal?booleanvoicemail_action?CampaignVoicemailActionWhat the agent should do when a call reaches voicemail. hangup ends the call; message leaves voicemail_message and then ends it. Delivered as an instruction to the agent for that call, so it is best-effort rather than a detector guarantee.
"hangup""message"voicemail_message?stringRequired when voicemail_action is message, and rejected otherwise.
length <= 1000dncr?Campaign created as a draft.
application/json- response
id*stringuuidorg_id*stringuuidname*stringdescription?stringagent_id*stringuuidagent_name*stringagent_version_id?stringPinned agent version. When absent the agent's production version is resolved at dial time.
uuidgroup_id?stringThe group the campaign dials through, absent otherwise. Each recipient is assigned to one member using the group's routing strategy and dialed by that member's production version. agent_id and agent_name identify the first dispatchable member when the group was attached, a display placeholder rather than the agent every call uses.
uuidgroup_name?stringnumber_pool_id?stringuuidnumber_pool_name?stringDisplay name of the attached number pool, denormalized so the caller-ID route can be named without a second request.
phone_number_id?stringuuidphone_number_e164?stringE.164 of the pinned caller ID, denormalized so the caller-ID route can be named without a second request.
trunk_id?stringuuidtransport?PhoneNumberTransport"livekit_sip""twilio_media_streams"status*CampaignStatusCampaign lifecycle. draft holds configuration and places no calls; scheduled is launched but waiting for start_at; running is feeding calls; paused stopped feeding (by an operator or by the platform, see paused_reason); completed finished every recipient or passed end_at; stopped was ended for good and cannot be resumed.
"draft""scheduled""running""paused""completed""stopped"paused_reason?CampaignPausedReasonWhy a paused campaign stopped. manual is an operator action; the rest are platform decisions the feeder makes and re-evaluates — minutes_exhausted when the monthly call-minutes wallet is empty, calls_disabled when calling is switched off for the tenant, entitlement_revoked when the campaigns entitlement was withdrawn mid-run, configuration_invalid when every job would be rejected for the same configuration reason (its phone number, trunk or agent is gone or unavailable; the exact rejection is in paused_detail), dncr_configuration_invalid when the campaign's DNCR connection or its credentials are unusable (calls stay stopped until it is repaired).
"manual""minutes_exhausted""calls_disabled""entitlement_revoked""dncr_configuration_invalid""configuration_invalid"paused_detail?stringThe exact rejection behind paused_reason configuration_invalid.
length <= 1024start_at?stringdate-timeend_at?stringHard stop. When it passes, queued calls are canceled and the campaign completes.
date-timepolicy_overrides?Per-job overrides. The organization policy may disable all overrides, and overridden windows must fit inside organization guardrails. timezone is accepted only with timezone_mode=custom; custom mode requires it.
max_concurrent?integerCeiling on this campaign's simultaneous calls. Absent means the organization limit applies.
1 <= valuereserved_for_other*integerConcurrency slots held back from this campaign for other traffic, such as inbound.
0 <= valueboard_id?stringAnalysis board rendered for this campaign, scoped to its calls.
uuidauto_resume_on_renewal*booleanResume automatically once minutes come back after a minutes_exhausted pause.
voicemail_action*CampaignVoicemailActionWhat the agent should do when a call reaches voicemail. hangup ends the call; message leaves voicemail_message and then ends it. Delivered as an instruction to the agent for that call, so it is best-effort rather than a detector guarantee.
"hangup""message"voicemail_message?stringcounters*Per-status recipient tally, always derived from the recipient rows rather than stored, so it cannot drift from reality.
created_at*stringdate-timeupdated_at*stringdate-timedncr?|nullcurl -X POST 'https://api.kejue.co/v1/campaigns' \ -H 'Idempotency-Key: string' \ -H 'Content-Type: application/json' \ -d '{ "name": "string"}'{ "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08", "org_id": "a40f5d1f-d889-42e9-94ea-b9b33585fc6b", "name": "string", "description": "string", "agent_id": "2b1e3b65-2c04-4fa2-a2d7-467901e98978", "agent_name": "string", "agent_version_id": "1c2a713c-7248-4a56-a9eb-0bdcb3a41741", "group_id": "306db4e0-7449-4501-b76f-075576fe2d8f", "group_name": "string", "number_pool_id": "3a45de3c-a4e6-4170-8728-80f90ed3f295", "number_pool_name": "string", "phone_number_id": "54afc7b8-17df-415a-9fb0-21ee66219576", "phone_number_e164": "string", "trunk_id": "d1c0247b-6570-4df5-9107-7986a22149d1", "transport": "livekit_sip", "status": "draft", "paused_reason": "manual", "paused_detail": "string", "start_at": "2019-08-24T14:15:22Z", "end_at": "2019-08-24T14:15:22Z", "policy_overrides": { "timezone": "string", "windows": [ { "weekdays": [ 1 ], "start": "09:00", "end": "17:00" } ], "max_attempts": 1, "destination_busy_backoff_seconds": [ 1 ], "destination_unavailable_backoff_seconds": [ 1 ], "destination_declined_backoff_seconds": [ 1 ], "retry_declined": true, "timezone_mode": "custom" }, "max_concurrent": 1, "reserved_for_other": 0, "board_id": "75e8c400-2dbc-43a3-9af4-ff9e6c099385", "auto_resume_on_renewal": true, "voicemail_action": "hangup", "voicemail_message": "string", "counters": { "total": 0, "pending": 0, "queued": 0, "calling": 0, "completed": 0, "failed": 0, "canceled": 0, "excluded": 0 }, "created_at": "2019-08-24T14:15:22Z", "updated_at": "2019-08-24T14:15:22Z", "dncr": { "mode": "inherit", "connection_id": "d3547de1-d1f2-4344-b4c2-17169b7526f9" }}