Skip to Content
Campaigns

Launch a campaign

Permissioncampaigns:updateAdd-onCampaignsRetriesIdempotency-Key requiredAuthentication
POST
/campaigns/{id}/launch

Starts a draft campaign. Becomes running, or scheduled when start_at is in the future. Beyond campaigns:update this also requires calls:place-outbound — a campaign places calls, and must not be a side door around that permission. Refuses a campaign with no caller-ID route, no pending recipients, a past end_at, or an agent with no deployable version.

Authorization

bearerAuth
headerAuthorizationBearer <token>

Use a Voice API key or connected-app OAuth access token. Authentication.

Path Parameters

id*string
Formatuuid

Header Parameters

Idempotency-Key*string

Required. Reuse the same key to retry this write safely. Retries and idempotency.

Match^[A-Za-z0-9!#$%&'*+.^_`|~-]+$
Length1 <= length <= 255

Response Body

The campaign after launch.

application/json
  1. response
id*string
Formatuuid
org_id*string
Formatuuid
name*string
description?string
agent_id*string
Formatuuid
agent_name*string
agent_version_id?string

Pinned agent version. When absent the agent's production version is resolved at dial time.

Formatuuid
group_id?string

The 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.

Formatuuid
group_name?string
number_pool_id?string
Formatuuid
number_pool_name?string

Display name of the attached number pool, denormalized so the caller-ID route can be named without a second request.

phone_number_id?string
Formatuuid
phone_number_e164?string

E.164 of the pinned caller ID, denormalized so the caller-ID route can be named without a second request.

trunk_id?string
Formatuuid
transport?PhoneNumberTransport
Value in"livekit_sip""twilio_media_streams"
status*CampaignStatus

Campaign 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.

Value in"draft""scheduled""running""paused""completed""stopped"
paused_reason?CampaignPausedReason

Why 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).

Value in"manual""minutes_exhausted""calls_disabled""entitlement_revoked""dncr_configuration_invalid""configuration_invalid"
paused_detail?string

The exact rejection behind paused_reason configuration_invalid.

Lengthlength <= 1024
start_at?string
Formatdate-time
end_at?string

Hard stop. When it passes, queued calls are canceled and the campaign completes.

Formatdate-time
policy_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?integer

Ceiling on this campaign's simultaneous calls. Absent means the organization limit applies.

Range1 <= value
reserved_for_other*integer

Concurrency slots held back from this campaign for other traffic, such as inbound.

Range0 <= value
board_id?string

Analysis board rendered for this campaign, scoped to its calls.

Formatuuid
auto_resume_on_renewal*boolean

Resume automatically once minutes come back after a minutes_exhausted pause.

voicemail_action*CampaignVoicemailAction

What 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.

Value in"hangup""message"
voicemail_message?string
counters*

Per-status recipient tally, always derived from the recipient rows rather than stored, so it cannot drift from reality.

created_at*string
Formatdate-time
updated_at*string
Formatdate-time
dncr?|null
Example Request
curl -X POST 'https://api.kejue.co/v1/campaigns/497f6eca-6276-4993-bfeb-53cbbbba6f08/launch' \  -H 'Idempotency-Key: string'
Example Response
{  "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"  }}