Campaigns
Cancel Campaign
Stops a draft, sending or paused campaign for good and sets finishedAt. Messages already handed to WhatsApp, and calls already placed, still complete. This cannot be undone, and it is also how you get rid of a draft you do not want: campaigns cannot be edited or deleted, so cancel it and create a new one. A build key may do this, since it only ever stops sends.
POST/campaigns/{id}/cancel
Path parameters
- idstringrequired
- The campaign's id (
cmp_…), as Create Campaign and List Campaigns return it.
Headers
- Katexs-Workspacestring
- Developers only: the customer workspace this request acts in — its
org_…id fromPOST /customers. Leave it out to act in your own workspace. Refused with404(Workspace not found.) when the id is unknown, is not one of your customers, or is not anorg_…id;410when that customer was deleted (restore it withPOST /customers/{id}/restoreuntil it is erased);403when the key belongs to one customer workspace (it cannot act as another);400when your workspace is not a developer workspace./customers/*andGET /customers/usageare your own workspace's and refuse the header with400: call them without it.
Example request
bash
curl -X POST "https://app.katexs.com/api/v1/campaigns/{id}/cancel" \
-H "Authorization: Bearer $KATEXS_API_KEY"Responses
| Status | Description |
|---|---|
200 | Cancelled. The campaign as it now is. |
400 | Katexs-Workspace was sent from a workspace that is not a developer workspace. |
401 | The key is missing, wrong or revoked. The answer is always the same, whichever it is. |
403 | The 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. |
404 | No campaign with that id in this workspace. |
409 | The campaign has already finished: it was sent, failed or was cancelled before. The message says which. |
410 | The customer named in Katexs-Workspace was deleted. POST /customers/{id}/restore brings it back until its erase date. |
429 | Over 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
whatsappfor a broadcast,voicefor a calling campaign. One of:whatsapp,voice.- statusstringrequired
draftuntil launched (a scheduled campaign stays a draft untilscheduledAt),sendingwhile it runs,pausedwhen stopped for now, thensent,failed(it could not run; seelastError) orcancelled. One of:draft,sending,paused,sent,failed,cancelled.- templatestring | nullrequired
- A broadcast's template name.
nullon 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).
nullon a broadcast. - countsobjectrequired
- How far the campaign has got, person by person.
- scheduledAtstring (date-time) | nullrequired
- When a scheduled campaign starts itself.
nullwhen it is started by hand. - startedAtstring (date-time) | nullrequired
- When it started sending.
nullwhile a draft. - finishedAtstring (date-time) | nullrequired
- When it finished or was cancelled.
nullwhile 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.
200 response
{
"id": "cmp_1f2e3d4c-5b6a-4798-8a7b-6c5d4e3f2a1b",
"agent": "ag_8d7c6b5a-4e3f-4a2b-9c1d-0e9f8a7b6c5d",
"name": "Six-month check-up reminders",
"kind": "voice",
"status": "cancelled",
"template": null,
"purpose": "Hello, this is Asha calling from Sunrise Dental Clinic.",
"counts": {
"recipients": 180,
"sent": 0,
"delivered": 0,
"read": 0,
"replied": 0,
"failed": 0,
"skipped": 0
},
"scheduledAt": "2026-10-07T04:30:00.000Z",
"startedAt": null,
"finishedAt": "2026-10-06T10:20:05.118Z",
"createdAt": "2026-10-06T10:00:01.874Z",
"lastError": null
}Last updated November 2026 · Found a problem? Email support@katexs.com
