> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spn.wtf/llms.txt
> Use this file to discover all available pages before exploring further.

# Campaigns

> Create and send broadcast, drip, and trigger-based messaging campaigns

All endpoints require authentication.

## Endpoints

### List Campaigns

```http theme={null}
GET /api/campaigns
```

***

### Create Campaign

```http theme={null}
POST /api/campaigns
```

**Body**

| Field            | Type   | Required | Description                              |
| ---------------- | ------ | -------- | ---------------------------------------- |
| `name`           | string | Yes      | Internal label                           |
| `type`           | string | Yes      | `broadcast`, `drip`, `trigger`, `survey` |
| `templateId`     | number | Yes      | Approved WhatsApp template ID            |
| `audience`       | string | Yes      | `all` or a contact list ID               |
| `schedule`       | string | No       | `immediate`, `scheduled`, or `recurring` |
| `scheduledAt`    | string | No       | ISO datetime for scheduled sends         |
| `templateParams` | object | No       | Dynamic placeholder values               |

***

### Get Campaign

```http theme={null}
GET /api/campaigns/:id
```

Returns campaign details including send stats (sent, delivered, read, failed).

***

### Send Campaign

```http theme={null}
POST /api/campaigns/send
```

**Body**

| Field        | Type   | Description                |
| ------------ | ------ | -------------------------- |
| `campaignId` | number | ID of the campaign to send |

Triggers immediate dispatch of the campaign to all targeted contacts.

***

## Campaign Statuses

| Status      | Description                |
| ----------- | -------------------------- |
| `draft`     | Created but not sent       |
| `scheduled` | Will send at a future time |
| `active`    | Currently running          |
| `paused`    | Paused mid-run             |
| `completed` | Finished sending           |
| `failed`    | Encountered errors         |
