# Cancel a WhatsApp campaign

`POST https://api.chat-data.com/api/v2/whatsapp-campaigns/{campaignId}/cancel`

Canonical: https://www.chat-data.com/api-reference/cancel-whatsapp-campaign

## Authentication

Send an API key as a Bearer token: `Authorization: Bearer $CHAT_DATA_API_KEY`. Workspace keys reach every chatbot in the workspace; chatbot-scoped keys reach only their chatbot. Keep keys on the server.

## Description

Cancels a scheduled, sending or paused campaign. Recipients not yet sent are marked `cancelled`; messages already sent are not recalled.

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| campaignId | path | string | yes |  |

## Request body (`application/json`)

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| chatbotId | string | yes |  |

## Example request

```bash
curl 'https://api.chat-data.com/api/v2/whatsapp-campaigns/6650f1c2a9e4b83d2c7a1f3c/cancel' \
  -H "Authorization: Bearer $CHAT_DATA_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{
  "chatbotId": "6650f1c2a9e4b83d2c7a1f05"
}'
```

## Example response (200)

```json
{
  "status": "success",
  "campaign": {
    "id": "6650f1c2a9e4b83d2c7a1f3c",
    "name": "Jane Doe",
    "phoneNumberId": "6650f1c2a9e4b83d2c7a1f3c",
    "template": {
      "name": "Jane Doe",
      "language": "sample language",
      "category": "sample category"
    },
    "replyMode": "ai",
    "status": "draft",
    "pauseReason": "sample pause reason",
    "schedule": {
      "at": "2026-10-14T09:30:00.000Z",
      "timeZone": "sample time zone"
    },
    "recipients": 10,
    "exclusions": {
      "opted_out": 3,
      "us_marketing": 12
    },
    "stats": {
      "queued": 10,
      "sent": 10,
      "delivered": 10,
      "read": 10,
      "replied": 10,
      "formCompleted": 10,
      "failed": 10,
      "cancelled": 10
    },
    "startedAt": "2026-10-14T09:30:00.000Z",
    "completedAt": "2026-10-14T09:30:00.000Z",
    "createdAt": "2026-10-14T09:30:00.000Z"
  }
}
```

## Responses

| Status | Description |
| --- | --- |
| 200 | The cancelled campaign. |
| 404 | The chatbot or campaign was not found. |
| 409 | The campaign has already finished. |
