Create Campaign

Campaigns

Create Campaign

Creates a WhatsApp broadcast (kind: "whatsapp") or a calling campaign (kind: "voice") as a draft, with the same checks as the console's builder: WhatsApp connected and the template approved with every blank filled, or for calls an agent with a number that answers phone calls and is licensed for this kind of call. The audience is built from your contacts right away, by consent; people who asked not to be contacted are always left out. Send launch: true to start it at once, or scheduledAt to start it later; a launch that is refused (no paid plan, not enough balance) still leaves the draft and says why in message, and an audience of nobody is never launched. Needs a full key.

POST/campaigns

Headers

Katexs-Workspacestring
Developers only: the customer workspace this request acts in — its org_… id from POST /customers. Leave it out to act in your own workspace. Refused with 404 (Workspace not found.) when the id is unknown, is not one of your customers, or is not an org_… id; 410 when that customer was deleted (restore it with POST /customers/{id}/restore until it is erased); 403 when the key belongs to one customer workspace (it cannot act as another); 400 when your workspace is not a developer workspace. /customers/* and GET /customers/usage are your own workspace's and refuse the header with 400: call them without it.

Request body

Example request

bash
curl -X POST "https://app.katexs.com/api/v1/campaigns" \
  -H "Authorization: Bearer $KATEXS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "kind": "whatsapp",
  "name": "Diwali sale — VIP customers",
  "template": "diwali_offer_v2",
  "language": "en",
  "variables": [
    {
      "position": 1,
      "source": "contact_name"
    },
    {
      "position": 2,
      "source": "fixed",
      "value": "FESTIVE20"
    }
  ],
  "tags": [
    "vip"
  ],
  "launch": true
}'

Responses

StatusDescription
201Created. The campaign as Get Campaign shows it, plus message: how many people it will reach, that it started, or why a requested launch did not happen (the campaign is then a draft you can launch later).
400A field is missing, has the wrong type or is out of range, or does not apply to this kind (a calling setting on a broadcast, a template on a calling campaign). The message names the field.
401The key is missing, wrong or revoked. The answer is always the same, whichever it is.
403The key's access level (read-only or build) does not allow this request, the plan does not include it, or a customer's key named another workspace in Katexs-Workspace. code says which: key_scope_read, key_scope_build, workspace_header_forbidden, or forbidden.
404No agent, template or followUp campaign by that id or name in this workspace.
409The template's name exists in more than one language, so pass language; or the workspace has no agent yet.
410The customer named in Katexs-Workspace was deleted. POST /customers/{id}/restore brings it back until its erase date.
422The campaign cannot run as described, in the console's words: WhatsApp is not connected, the template is not approved, a blank has nothing filling it, an offer's countdown is missing or already past, the agent has no number or does not answer phone calls, a number cannot dial out or is not licensed for this kind of call, or a voicemail message was given and none of the agent's numbers can detect an answering machine.
429Over a per-minute limit. Wait for Retry-After seconds. code and limit say which limit: rate_limit_resources (240 requests a minute for the workspace), rate_limit_family (2,400 across a developer's customers), rate_limit_calls, rate_limit_messages, rate_limit_codes, rate_limit_code_recipient, concurrent_calls or number_daily_limit.

Response fields

idstringrequired
The campaign's id.
agentstringrequired
A calling campaign: the agent that makes the calls. A broadcast: the agent that answers replies to it.
namestringrequired
The campaign's name, as the console lists it.
kindstringrequired
whatsapp for a broadcast, voice for a calling campaign. One of: whatsapp, voice.
statusstringrequired
draft until launched (a scheduled campaign stays a draft until scheduledAt), sending while it runs, paused when stopped for now, then sent, failed (it could not run; see lastError) or cancelled. One of: draft, sending, paused, sent, failed, cancelled.
templatestring | nullrequired
A broadcast's template name. null on a calling campaign.
purposestring | nullrequired
A calling campaign's opening line: the sentence the agent opens each call with, copied from the agent when the campaign was created (editing the agent later does not change it). null on a broadcast.
countsobjectrequired
How far the campaign has got, person by person.
scheduledAtstring (date-time) | nullrequired
When a scheduled campaign starts itself. null when it is started by hand.
startedAtstring (date-time) | nullrequired
When it started sending. null while a draft.
finishedAtstring (date-time) | nullrequired
When it finished or was cancelled. null while it can still send.
createdAtstring (date-time)required
When it was created.
lastErrorstring | nullrequired
Why the campaign last stopped or failed, when it did. Cleared when it is launched or resumed.
messagestringrequired
What happened, in a sentence you can show a person: how many people it will reach, that sending or calling started (and, when the balance covers only part of it, how far it goes), or — on create with launch: true — why the launch was refused and the campaign kept as a draft.
201 response
{
  "id": "cmp_9a3b7c21-4d5e-4f60-8a1b-2c3d4e5f6a7b",
  "agent": "ag_5c4a5f93-2b1e-4c0a-9d3f-7e8a1b2c3d4e",
  "name": "Diwali sale — VIP customers",
  "kind": "whatsapp",
  "status": "sending",
  "template": "diwali_offer_v2",
  "purpose": null,
  "counts": {
    "recipients": 412,
    "sent": 0,
    "delivered": 0,
    "read": 0,
    "replied": 0,
    "failed": 0,
    "skipped": 0
  },
  "scheduledAt": null,
  "startedAt": "2026-10-06T10:00:02.311Z",
  "finishedAt": null,
  "createdAt": "2026-10-06T10:00:01.874Z",
  "lastError": null,
  "message": "Sending started. Messages go out in the background."
}

Last updated November 2026 · Found a problem? Email support@katexs.com