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

# Campaigns

> Create and control multi-channel outreach campaigns via the Sendora API.

## What is a campaign?

A **campaign** is an automated outreach sequence, a series of touchpoints across one or more channels (voice, SMS, email, LinkedIn, WhatsApp) that Sendora executes automatically for each enrolled lead.

Each campaign has:

* A **status**: `draft` → `running` → `paused` → `completed` / `stopped`
* A set of enrolled **leads** (via lead lists or individual IDs)
* A **journey**, the sequence of nodes and branching logic (configured in the dashboard or via API)
* **Analytics**, reply rates, call durations, conversion events per variant

## Campaign lifecycle

```mermaid theme={"dark"}
stateDiagram-v2
    direction LR
    [*] --> draft : POST /campaigns
    draft --> running : /launch
    running --> paused : /pause
    paused --> running : /resume
    running --> completed : all leads done
    running --> stopped : /stop
    paused --> stopped : /stop
    completed --> [*]
    stopped --> [*]
```

## Creating a campaign

```bash theme={"dark"}
curl -X POST https://api.sendora.ai/api/v1/public/campaigns \
  -H "X-API-Key: sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Q3 Enterprise Outbound",
    "description": "Voice + email sequence for mid-market accounts"
  }'
```

The created campaign is in `draft` status. Configure it in the dashboard (nodes, schedule, send windows) then launch it via API.

## Launching a campaign

```bash theme={"dark"}
curl -X POST "https://api.sendora.ai/api/v1/public/campaigns/{campaign_id}/launch" \
  -H "X-API-Key: sk_live_..."
```

Before launching, you can run a **preflight check** to catch configuration errors:

```bash theme={"dark"}
GET /api/v1/public/campaigns/{campaign_id}/preflight
```

Returns:

```json theme={"dark"}
{
  "ready": false,
  "errors": [
    "No leads enrolled",
    "Send window not configured"
  ],
  "warnings": [
    "Voice channel: no phone number assigned to agent"
  ]
}
```

## Enrolling leads

Enroll leads from explicit IDs or a whole lead list:

```bash theme={"dark"}
# By individual lead IDs
curl -X POST "https://api.sendora.ai/api/v1/public/campaigns/{campaign_id}/leads" \
  -H "X-API-Key: sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "lead_ids": ["lead_abc", "lead_def", "lead_ghi"] }'

# By lead list (bulk enroll)
curl -X POST "https://api.sendora.ai/api/v1/public/campaigns/{campaign_id}/leads" \
  -H "X-API-Key: sk_live_..." \
  -H "Content-Type: application/json" \
  -d '{ "lead_list_id": "list_xyz" }'
```

Both return:

```json theme={"dark"}
{ "enrolled": 142, "skipped": 3, "total_requested": 145 }
```

Leads already in the campaign are silently skipped (idempotent). You can enroll leads into a running campaign, they start their sequence immediately.

## Pausing and resuming

Pause a campaign to temporarily stop outreach:

```bash theme={"dark"}
POST /api/v1/public/campaigns/{campaign_id}/pause
POST /api/v1/public/campaigns/{campaign_id}/resume
```

Pausing does not cancel in-flight actions, calls already dialed complete, but no new outreach is initiated until resumed.

## Stopping a campaign

Hard-stop a campaign and cancel all remaining journeys:

```bash theme={"dark"}
POST /api/v1/public/campaigns/{campaign_id}/stop
```

Stopped campaigns move to `stopped` status and cannot be resumed. Leads can be re-enrolled into a new or cloned campaign.

## Cloning a campaign

Create an exact copy (draft status, no leads enrolled):

```bash theme={"dark"}
POST /api/v1/public/campaigns/{campaign_id}/clone
```

Useful for running the same sequence to a different audience, or A/B testing configurations.

## Listing leads in a campaign

```bash theme={"dark"}
GET /api/v1/public/campaigns/{campaign_id}/leads
```

Supports filtering by `status` (`active`, `paused`, `completed`, `cancelled`, `failed`) and pagination.

## Analytics

```bash theme={"dark"}
# High-level campaign metrics
GET /api/v1/public/analytics/campaigns/{campaign_id}
```

Returns reply rates, call connect rates, meeting booking rates, and email open/click metrics.

## Webhook events

Subscribe to these events to react to campaign milestones:

| Event | Fires when |
| - | - |
| `campaign.finished` | All leads complete the sequence |
| `reply.received` | Any lead replies on any channel |
| `meeting.booked` | A lead books a meeting (via AI or operator) |
| `call.completed` | A voice call finishes |

See [Webhooks guide](/guides/webhooks) for setup.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.