---
title: "Campaigns API reference"
url: "https://coldagentai.com/docs/api/campaigns.md"
canonical_url: "https://coldagentai.com/docs/api/campaigns"
last_updated: "2026-11-05"
type: "reference"
summary: "Create and schedule campaigns, replace the sequence, preview a step, start and pause sending, and read campaign analytics through the API."
related: ["https://coldagentai.com/docs/api.md", "https://coldagentai.com/docs/authentication.md", "https://coldagentai.com/docs/errors.md", "https://coldagentai.com/docs/api/leads.md", "https://coldagentai.com/docs/api/mailboxes.md"]
install: "claude mcp add --transport http coldagentai-free https://coldagentai.com/api/mcp"
---

# Campaigns API reference

> **For AI agents:** the complete index of ColdAgentAI pages is [llms.txt](https://coldagentai.com/llms.txt). Every page is also served as markdown at its URL plus .md.

Create and schedule campaigns, replace the sequence, preview a step, start and pause sending, and read campaign analytics through the API.

Create, schedule, change, start and pause campaigns, replace the sequence, preview a step for a real lead and read analytics. Leads are on the Leads page. 12 operations.

## Operations

Create, schedule, change, start and pause campaigns, replace the sequence, preview a step for a real lead and read analytics. Leads are on the [Leads](https://coldagentai.com/docs/api/leads.md) page.

Authenticate as described in [Authentication](https://coldagentai.com/docs/authentication.md). Every operation below is generated from the [OpenAPI document](https://coldagentai.com/docs/openapi.md).

| Method and path | Scope | What it does |
| --- | --- | --- |
| `GET /v1/campaigns` | read | List campaigns |
| `POST /v1/campaigns` | write | Create a campaign |
| `GET /v1/campaigns/{id}` | read | Get a campaign |
| `PATCH /v1/campaigns/{id}` | write | Change a campaign |
| `DELETE /v1/campaigns/{id}` | write | Delete a campaign |
| `GET /v1/campaigns/{id}/sequence` | read | Get the sequence |
| `PUT /v1/campaigns/{id}/sequence` | write | Replace the sequence |
| `GET /v1/campaigns/{id}/render-check` | read | Check every email before starting |
| `POST /v1/campaigns/{id}/start` | write | Start a campaign |
| `POST /v1/campaigns/{id}/pause` | write | Pause a campaign |
| `POST /v1/campaigns/{id}/preview` | read | Preview a step for a real lead |
| `GET /v1/campaigns/{id}/analytics` | read | Campaign analytics |

## GET /v1/campaigns

Campaigns in this account, oldest first, one page at a time. Pass next_cursor as cursor for the next page.

Scope: `read`. A read key and a write key both work. Success: HTTP 200.

### Query parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `status` | "draft" or "active" or "paused" or "completed" | no | No further constraints. |
| `limit` | integer | no | 1 to 100 |
| `cursor` | string | no | 0 to 500 characters |

### Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `data` | array of object | yes | No further constraints. |
| `data[].id` | string | yes | No further constraints. |
| `data[].name` | string | yes | No further constraints. |
| `data[].status` | "draft" or "active" or "paused" or "completed" | yes | No further constraints. |
| `data[].schedule` | object | yes | No further constraints. |
| `data[].schedule.timezone` | string | yes | No further constraints. |
| `data[].schedule.sending_days` | array of "mon" or "tue" or "wed" or "thu" or "fri" or "sat" or "sun" | yes | No further constraints. |
| `data[].schedule.start_hour` | integer | yes | No further constraints. |
| `data[].schedule.end_hour` | integer | yes | No further constraints. |
| `data[].daily_limit` | integer or null | yes | No further constraints. |
| `data[].stop_on_reply` | boolean | yes | No further constraints. |
| `data[].mailbox_ids` | array of string | yes | No further constraints. |
| `data[].created_at` | string (date-time) | yes | ISO 8601 time in UTC |
| `data[].updated_at` | string (date-time) | yes | ISO 8601 time in UTC |
| `data[].started_at` | string (date-time) or null | yes | ISO 8601 time in UTC |
| `data[].completed_at` | string (date-time) or null | yes | ISO 8601 time in UTC |
| `next_cursor` | string or null | yes | No further constraints. |

Response example, HTTP 200:

```
{
  "data": [
    {
      "id": "id_8f3a2c1d",
      "name": "Example",
      "status": "draft",
      "schedule": {
        "timezone": "America/New_York",
        "sending_days": [
          "mon"
        ],
        "start_hour": 1,
        "end_hour": 1
      },
      "daily_limit": 1,
      "stop_on_reply": true,
      "mailbox_ids": [
        "abc123"
      ],
      "created_at": "2026-10-17T12:00:00.000Z",
      "updated_at": "2026-10-17T12:00:00.000Z",
      "started_at": "2026-10-17T12:00:00.000Z",
      "completed_at": "2026-10-17T12:00:00.000Z"
    }
  ],
  "next_cursor": "abc123"
}
```

### Errors

[`invalid_input`](https://coldagentai.com/docs/errors.md#invalid_input), [`unauthorized`](https://coldagentai.com/docs/errors.md#unauthorized), [`rate_limited`](https://coldagentai.com/docs/errors.md#rate_limited), [`internal_error`](https://coldagentai.com/docs/errors.md#internal_error). Every error uses the [single format](https://coldagentai.com/docs/errors.md#format).

### Rate limits

Counted per key: 200 requests per 10 seconds. Every response carries `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. Over the limit the answer is `429 rate_limited` with `Retry-After`. See [Rate limits](https://coldagentai.com/docs/rate-limits.md).

### Examples

cURL:

```
curl "https://api.coldagentai.com/v1/campaigns" \
  -H "Authorization: Bearer $COLDAGENTAI_API_KEY"
```

JavaScript (fetch):

```
const res = await fetch(`https://api.coldagentai.com/v1/campaigns`, {
  headers: { Authorization: `Bearer ${process.env.COLDAGENTAI_API_KEY}` },
});
if (!res.ok) throw new Error(JSON.stringify(await res.json()));
const data = await res.json();
```

## POST /v1/campaigns

Creates a draft campaign with its schedule (IANA time zone, sending days, daily window), optional daily limit, stop-on-reply (default on) and the mailboxes it rotates across. Add the sequence and leads, then start it.

Scope: `write`. A read key gets 403 forbidden. Success: HTTP 201.

### Request body

Send JSON with `Content-Type: application/json`. The body is required.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | yes | 1 to 200 characters. |
| `schedule` | object | yes | No further constraints. |
| `schedule.timezone` | string | yes | 0 to 64 characters. |
| `schedule.sending_days` | array of "mon" or "tue" or "wed" or "thu" or "fri" or "sat" or "sun" | yes | 1 to 7 items. |
| `schedule.start_hour` | integer | yes | 0 to 23. |
| `schedule.end_hour` | integer | yes | 1 to 24. |
| `daily_limit` | integer or null | no | 1 to 100000. |
| `stop_on_reply` | boolean | no | No further constraints. |
| `mailbox_ids` | array of string | no | 0 to 1000 items. |

Request example:

```
{
  "name": "Example",
  "schedule": {
    "timezone": "America/New_York",
    "sending_days": [
      "mon"
    ],
    "start_hour": 1,
    "end_hour": 1
  }
}
```

### Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | No further constraints. |
| `name` | string | yes | No further constraints. |
| `status` | "draft" or "active" or "paused" or "completed" | yes | No further constraints. |
| `schedule` | object | yes | No further constraints. |
| `schedule.timezone` | string | yes | No further constraints. |
| `schedule.sending_days` | array of "mon" or "tue" or "wed" or "thu" or "fri" or "sat" or "sun" | yes | No further constraints. |
| `schedule.start_hour` | integer | yes | No further constraints. |
| `schedule.end_hour` | integer | yes | No further constraints. |
| `daily_limit` | integer or null | yes | No further constraints. |
| `stop_on_reply` | boolean | yes | No further constraints. |
| `mailbox_ids` | array of string | yes | No further constraints. |
| `created_at` | string (date-time) | yes | ISO 8601 time in UTC |
| `updated_at` | string (date-time) | yes | ISO 8601 time in UTC |
| `started_at` | string (date-time) or null | yes | ISO 8601 time in UTC |
| `completed_at` | string (date-time) or null | yes | ISO 8601 time in UTC |

Response example, HTTP 201:

```
{
  "id": "id_8f3a2c1d",
  "name": "Example",
  "status": "draft",
  "schedule": {
    "timezone": "America/New_York",
    "sending_days": [
      "mon"
    ],
    "start_hour": 1,
    "end_hour": 1
  },
  "daily_limit": 1,
  "stop_on_reply": true,
  "mailbox_ids": [
    "abc123"
  ],
  "created_at": "2026-10-17T12:00:00.000Z",
  "updated_at": "2026-10-17T12:00:00.000Z",
  "started_at": "2026-10-17T12:00:00.000Z",
  "completed_at": "2026-10-17T12:00:00.000Z"
}
```

### Errors

[`invalid_input`](https://coldagentai.com/docs/errors.md#invalid_input), [`unauthorized`](https://coldagentai.com/docs/errors.md#unauthorized), [`forbidden`](https://coldagentai.com/docs/errors.md#forbidden), [`unknown_product`](https://coldagentai.com/docs/errors.md#unknown_product), [`payload_too_large`](https://coldagentai.com/docs/errors.md#payload_too_large), [`rate_limited`](https://coldagentai.com/docs/errors.md#rate_limited), [`internal_error`](https://coldagentai.com/docs/errors.md#internal_error). Every error uses the [single format](https://coldagentai.com/docs/errors.md#format).

### Rate limits

Counted per key: 200 requests per 10 seconds. Every response carries `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. Over the limit the answer is `429 rate_limited` with `Retry-After`. See [Rate limits](https://coldagentai.com/docs/rate-limits.md).

### Examples

cURL:

```
curl -X POST "https://api.coldagentai.com/v1/campaigns" \
  -H "Authorization: Bearer $COLDAGENTAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Example",
  "schedule": {
    "timezone": "America/New_York",
    "sending_days": [
      "mon"
    ],
    "start_hour": 1,
    "end_hour": 1
  }
}'
```

JavaScript (fetch):

```
const res = await fetch(`https://api.coldagentai.com/v1/campaigns`, {
  method: 'POST',
  body: JSON.stringify({
    "name": "Example",
    "schedule": {
      "timezone": "America/New_York",
      "sending_days": [
        "mon"
      ],
      "start_hour": 1,
      "end_hour": 1
    }
  }),
  headers: { Authorization: `Bearer ${process.env.COLDAGENTAI_API_KEY}`, 'Content-Type': 'application/json' },
});
if (!res.ok) throw new Error(JSON.stringify(await res.json()));
const data = await res.json();
```

## GET /v1/campaigns/{id}

One campaign with its schedule, limits, status and mailbox rotation.

Scope: `read`. A read key and a write key both work. Success: HTTP 200.

### Path parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | at least 1 characters |

### Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | No further constraints. |
| `name` | string | yes | No further constraints. |
| `status` | "draft" or "active" or "paused" or "completed" | yes | No further constraints. |
| `schedule` | object | yes | No further constraints. |
| `schedule.timezone` | string | yes | No further constraints. |
| `schedule.sending_days` | array of "mon" or "tue" or "wed" or "thu" or "fri" or "sat" or "sun" | yes | No further constraints. |
| `schedule.start_hour` | integer | yes | No further constraints. |
| `schedule.end_hour` | integer | yes | No further constraints. |
| `daily_limit` | integer or null | yes | No further constraints. |
| `stop_on_reply` | boolean | yes | No further constraints. |
| `mailbox_ids` | array of string | yes | No further constraints. |
| `created_at` | string (date-time) | yes | ISO 8601 time in UTC |
| `updated_at` | string (date-time) | yes | ISO 8601 time in UTC |
| `started_at` | string (date-time) or null | yes | ISO 8601 time in UTC |
| `completed_at` | string (date-time) or null | yes | ISO 8601 time in UTC |

Response example, HTTP 200:

```
{
  "id": "id_8f3a2c1d",
  "name": "Example",
  "status": "draft",
  "schedule": {
    "timezone": "America/New_York",
    "sending_days": [
      "mon"
    ],
    "start_hour": 1,
    "end_hour": 1
  },
  "daily_limit": 1,
  "stop_on_reply": true,
  "mailbox_ids": [
    "abc123"
  ],
  "created_at": "2026-10-17T12:00:00.000Z",
  "updated_at": "2026-10-17T12:00:00.000Z",
  "started_at": "2026-10-17T12:00:00.000Z",
  "completed_at": "2026-10-17T12:00:00.000Z"
}
```

### Errors

[`invalid_input`](https://coldagentai.com/docs/errors.md#invalid_input), [`unauthorized`](https://coldagentai.com/docs/errors.md#unauthorized), [`unknown_product`](https://coldagentai.com/docs/errors.md#unknown_product), [`rate_limited`](https://coldagentai.com/docs/errors.md#rate_limited), [`internal_error`](https://coldagentai.com/docs/errors.md#internal_error). Every error uses the [single format](https://coldagentai.com/docs/errors.md#format).

### Rate limits

Counted per key: 200 requests per 10 seconds. Every response carries `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. Over the limit the answer is `429 rate_limited` with `Retry-After`. See [Rate limits](https://coldagentai.com/docs/rate-limits.md).

### Examples

cURL:

```
curl "https://api.coldagentai.com/v1/campaigns/$CAMPAIGN_ID" \
  -H "Authorization: Bearer $COLDAGENTAI_API_KEY"
```

JavaScript (fetch):

```
const id = 'id_8f3a2c1d';
const res = await fetch(`https://api.coldagentai.com/v1/campaigns/${id}`, {
  headers: { Authorization: `Bearer ${process.env.COLDAGENTAI_API_KEY}` },
});
if (!res.ok) throw new Error(JSON.stringify(await res.json()));
const data = await res.json();
```

## PATCH /v1/campaigns/{id}

Changes the name, schedule, daily limit, stop-on-reply or mailbox rotation. Send only the fields to change; mailbox_ids replaces the whole rotation set. Takes effect on the next send cycle, also for an active campaign.

Scope: `write`. A read key gets 403 forbidden. Success: HTTP 200.

### Path parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | at least 1 characters |

### Request body

Send JSON with `Content-Type: application/json`. The body is required.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `name` | string | no | 1 to 200 characters. |
| `schedule` | object | no | No further constraints. |
| `schedule.timezone` | string | yes | 0 to 64 characters. |
| `schedule.sending_days` | array of "mon" or "tue" or "wed" or "thu" or "fri" or "sat" or "sun" | yes | 1 to 7 items. |
| `schedule.start_hour` | integer | yes | 0 to 23. |
| `schedule.end_hour` | integer | yes | 1 to 24. |
| `daily_limit` | integer or null | no | 1 to 100000. |
| `stop_on_reply` | boolean | no | No further constraints. |
| `mailbox_ids` | array of string | no | 0 to 1000 items. |

Request example:

```
{
  "name": "Example",
  "schedule": {
    "timezone": "America/New_York",
    "sending_days": [
      "mon"
    ],
    "start_hour": 1,
    "end_hour": 1
  },
  "daily_limit": 1
}
```

### Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | No further constraints. |
| `name` | string | yes | No further constraints. |
| `status` | "draft" or "active" or "paused" or "completed" | yes | No further constraints. |
| `schedule` | object | yes | No further constraints. |
| `schedule.timezone` | string | yes | No further constraints. |
| `schedule.sending_days` | array of "mon" or "tue" or "wed" or "thu" or "fri" or "sat" or "sun" | yes | No further constraints. |
| `schedule.start_hour` | integer | yes | No further constraints. |
| `schedule.end_hour` | integer | yes | No further constraints. |
| `daily_limit` | integer or null | yes | No further constraints. |
| `stop_on_reply` | boolean | yes | No further constraints. |
| `mailbox_ids` | array of string | yes | No further constraints. |
| `created_at` | string (date-time) | yes | ISO 8601 time in UTC |
| `updated_at` | string (date-time) | yes | ISO 8601 time in UTC |
| `started_at` | string (date-time) or null | yes | ISO 8601 time in UTC |
| `completed_at` | string (date-time) or null | yes | ISO 8601 time in UTC |

Response example, HTTP 200:

```
{
  "id": "id_8f3a2c1d",
  "name": "Example",
  "status": "draft",
  "schedule": {
    "timezone": "America/New_York",
    "sending_days": [
      "mon"
    ],
    "start_hour": 1,
    "end_hour": 1
  },
  "daily_limit": 1,
  "stop_on_reply": true,
  "mailbox_ids": [
    "abc123"
  ],
  "created_at": "2026-10-17T12:00:00.000Z",
  "updated_at": "2026-10-17T12:00:00.000Z",
  "started_at": "2026-10-17T12:00:00.000Z",
  "completed_at": "2026-10-17T12:00:00.000Z"
}
```

### Errors

[`invalid_input`](https://coldagentai.com/docs/errors.md#invalid_input), [`unauthorized`](https://coldagentai.com/docs/errors.md#unauthorized), [`forbidden`](https://coldagentai.com/docs/errors.md#forbidden), [`unknown_product`](https://coldagentai.com/docs/errors.md#unknown_product), [`payload_too_large`](https://coldagentai.com/docs/errors.md#payload_too_large), [`rate_limited`](https://coldagentai.com/docs/errors.md#rate_limited), [`internal_error`](https://coldagentai.com/docs/errors.md#internal_error). Every error uses the [single format](https://coldagentai.com/docs/errors.md#format).

### Rate limits

Counted per key: 200 requests per 10 seconds. Every response carries `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. Over the limit the answer is `429 rate_limited` with `Retry-After`. See [Rate limits](https://coldagentai.com/docs/rate-limits.md).

### Examples

cURL:

```
curl -X PATCH "https://api.coldagentai.com/v1/campaigns/$CAMPAIGN_ID" \
  -H "Authorization: Bearer $COLDAGENTAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "Example",
  "schedule": {
    "timezone": "America/New_York",
    "sending_days": [
      "mon"
    ],
    "start_hour": 1,
    "end_hour": 1
  },
  "daily_limit": 1
}'
```

JavaScript (fetch):

```
const id = 'id_8f3a2c1d';
const res = await fetch(`https://api.coldagentai.com/v1/campaigns/${id}`, {
  method: 'PATCH',
  body: JSON.stringify({
    "name": "Example",
    "schedule": {
      "timezone": "America/New_York",
      "sending_days": [
        "mon"
      ],
      "start_hour": 1,
      "end_hour": 1
    },
    "daily_limit": 1
  }),
  headers: { Authorization: `Bearer ${process.env.COLDAGENTAI_API_KEY}`, 'Content-Type': 'application/json' },
});
if (!res.ok) throw new Error(JSON.stringify(await res.json()));
const data = await res.json();
```

## DELETE /v1/campaigns/{id}

Deletes a campaign that has never sent anything, with its steps and lead enrollments. A campaign with send history, or an active one, is refused: pause it instead.

Scope: `write`. A read key gets 403 forbidden. Success: HTTP 200.

### Path parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | at least 1 characters |

### Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | No further constraints. |
| `deleted` | true | yes | No further constraints. |

Response example, HTTP 200:

```
{
  "id": "id_8f3a2c1d",
  "deleted": true
}
```

### Errors

[`invalid_input`](https://coldagentai.com/docs/errors.md#invalid_input), [`unauthorized`](https://coldagentai.com/docs/errors.md#unauthorized), [`forbidden`](https://coldagentai.com/docs/errors.md#forbidden), [`unknown_product`](https://coldagentai.com/docs/errors.md#unknown_product), [`rate_limited`](https://coldagentai.com/docs/errors.md#rate_limited), [`internal_error`](https://coldagentai.com/docs/errors.md#internal_error). Every error uses the [single format](https://coldagentai.com/docs/errors.md#format).

### Rate limits

Counted per key: 200 requests per 10 seconds. Every response carries `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. Over the limit the answer is `429 rate_limited` with `Retry-After`. See [Rate limits](https://coldagentai.com/docs/rate-limits.md).

### Examples

cURL:

```
curl -X DELETE "https://api.coldagentai.com/v1/campaigns/$CAMPAIGN_ID" \
  -H "Authorization: Bearer $COLDAGENTAI_API_KEY"
```

JavaScript (fetch):

```
const id = 'id_8f3a2c1d';
const res = await fetch(`https://api.coldagentai.com/v1/campaigns/${id}`, {
  method: 'DELETE',
  headers: { Authorization: `Bearer ${process.env.COLDAGENTAI_API_KEY}` },
});
if (!res.ok) throw new Error(JSON.stringify(await res.json()));
const data = await res.json();
```

## GET /v1/campaigns/{id}/sequence

The campaign steps in order, each with its wait in days, A/B subject variants and body.

Scope: `read`. A read key and a write key both work. Success: HTTP 200.

### Path parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | at least 1 characters |

### Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `steps` | array of object | yes | No further constraints. |
| `steps[].id` | string | yes | No further constraints. |
| `steps[].order` | integer | yes | No further constraints. |
| `steps[].wait_days` | integer | yes | No further constraints. |
| `steps[].subjects` | array of string | yes | A/B subject variants; variant A is the first |
| `steps[].body` | string | yes | No further constraints. |

Response example, HTTP 200:

```
{
  "steps": [
    {
      "id": "id_8f3a2c1d",
      "order": 1,
      "wait_days": 1,
      "subjects": [
        "Quick question about your onboarding"
      ],
      "body": "abc123"
    }
  ]
}
```

### Errors

[`invalid_input`](https://coldagentai.com/docs/errors.md#invalid_input), [`unauthorized`](https://coldagentai.com/docs/errors.md#unauthorized), [`unknown_product`](https://coldagentai.com/docs/errors.md#unknown_product), [`rate_limited`](https://coldagentai.com/docs/errors.md#rate_limited), [`internal_error`](https://coldagentai.com/docs/errors.md#internal_error). Every error uses the [single format](https://coldagentai.com/docs/errors.md#format).

### Rate limits

Counted per key: 200 requests per 10 seconds. Every response carries `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. Over the limit the answer is `429 rate_limited` with `Retry-After`. See [Rate limits](https://coldagentai.com/docs/rate-limits.md).

### Examples

cURL:

```
curl "https://api.coldagentai.com/v1/campaigns/$CAMPAIGN_ID/sequence" \
  -H "Authorization: Bearer $COLDAGENTAI_API_KEY"
```

JavaScript (fetch):

```
const id = 'id_8f3a2c1d';
const res = await fetch(`https://api.coldagentai.com/v1/campaigns/${id}/sequence`, {
  headers: { Authorization: `Bearer ${process.env.COLDAGENTAI_API_KEY}` },
});
if (!res.ok) throw new Error(JSON.stringify(await res.json()));
const data = await res.json();
```

## PUT /v1/campaigns/{id}/sequence

Replaces the whole sequence atomically. Each step has wait_days after the previous step, 1 to 26 subject variants (A/B, one variant per lead chosen deterministically), and a body. Merge fields look like {{first_name|there}} (the text after | is the fallback; a field with no value and no fallback fails that send). Spintax like {Hi|Hello} is expanded per lead and validated here.

Scope: `write`. A read key gets 403 forbidden. Success: HTTP 200.

### Path parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | at least 1 characters |

### Request body

Send JSON with `Content-Type: application/json`. The body is required.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `steps` | array of object | yes | 0 to 30 items. |
| `steps[].wait_days` | integer | yes | 0 to 365. |
| `steps[].subjects` | array of string | yes | 1 to 26 items. |
| `steps[].body` | string | yes | 1 to 50000 characters. |

Request example:

```
{
  "steps": [
    {
      "wait_days": 1,
      "subjects": [
        "Quick question about your onboarding"
      ],
      "body": "abc123"
    }
  ]
}
```

### Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `steps` | array of object | yes | No further constraints. |
| `steps[].id` | string | yes | No further constraints. |
| `steps[].order` | integer | yes | No further constraints. |
| `steps[].wait_days` | integer | yes | No further constraints. |
| `steps[].subjects` | array of string | yes | A/B subject variants; variant A is the first |
| `steps[].body` | string | yes | No further constraints. |

Response example, HTTP 200:

```
{
  "steps": [
    {
      "id": "id_8f3a2c1d",
      "order": 1,
      "wait_days": 1,
      "subjects": [
        "Quick question about your onboarding"
      ],
      "body": "abc123"
    }
  ]
}
```

### Errors

[`invalid_input`](https://coldagentai.com/docs/errors.md#invalid_input), [`unauthorized`](https://coldagentai.com/docs/errors.md#unauthorized), [`forbidden`](https://coldagentai.com/docs/errors.md#forbidden), [`unknown_product`](https://coldagentai.com/docs/errors.md#unknown_product), [`payload_too_large`](https://coldagentai.com/docs/errors.md#payload_too_large), [`rate_limited`](https://coldagentai.com/docs/errors.md#rate_limited), [`internal_error`](https://coldagentai.com/docs/errors.md#internal_error). Every error uses the [single format](https://coldagentai.com/docs/errors.md#format).

### Rate limits

Counted per key: 200 requests per 10 seconds. Every response carries `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. Over the limit the answer is `429 rate_limited` with `Retry-After`. See [Rate limits](https://coldagentai.com/docs/rate-limits.md).

### Examples

cURL:

```
curl -X PUT "https://api.coldagentai.com/v1/campaigns/$CAMPAIGN_ID/sequence" \
  -H "Authorization: Bearer $COLDAGENTAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "steps": [
    {
      "wait_days": 1,
      "subjects": [
        "Quick question about your onboarding"
      ],
      "body": "abc123"
    }
  ]
}'
```

JavaScript (fetch):

```
const id = 'id_8f3a2c1d';
const res = await fetch(`https://api.coldagentai.com/v1/campaigns/${id}/sequence`, {
  method: 'PUT',
  body: JSON.stringify({
    "steps": [
      {
        "wait_days": 1,
        "subjects": [
          "Quick question about your onboarding"
        ],
        "body": "abc123"
      }
    ]
  }),
  headers: { Authorization: `Bearer ${process.env.COLDAGENTAI_API_KEY}`, 'Content-Type': 'application/json' },
});
if (!res.ok) throw new Error(JSON.stringify(await res.json()));
const data = await res.json();
```

## GET /v1/campaigns/{id}/render-check

Renders every email still to be sent, for every lead that will be mailed, exactly as the send cycle will (same subject variant per lead, same spintax, same merge rules), and reports how many render and, for each lead that would fail, the step, the subject or body and the merge field with no value and no fallback. Leads that will never be mailed (suppressed, verified invalid, bounced, unsubscribed, already replied) are left out. Sends nothing and changes nothing. POST /v1/campaigns/{id}/start runs the same check and refuses while any email fails.

Scope: `read`. A read key and a write key both work. Success: HTTP 200.

### Path parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | at least 1 characters |

### Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `campaign_id` | string | yes | No further constraints. |
| `ready` | boolean | yes | True when every email renders, so the campaign can start without skipping anyone. |
| `leads_enrolled` | integer | yes | No further constraints. |
| `leads_excluded` | integer | yes | Enrolled leads that will never be mailed (suppressed, verified invalid, bounced, unsubscribed or already replied), so they were not rendered and cannot hold a start. |
| `leads_checked` | integer | yes | No further constraints. |
| `leads_rendering` | integer | yes | Checked leads for whom every email still to be sent renders. |
| `leads_failing` | integer | yes | No further constraints. |
| `emails_checked` | integer | yes | Lead-and-step emails rendered; steps already sent are not rendered again. |
| `emails_rendering` | integer | yes | No further constraints. |
| `emails_failing` | integer | yes | No further constraints. |
| `failures` | array of object | yes | Failing leads in enrollment order, at most 200; leads_failing is the full count. |
| `failures[].lead_id` | string | yes | No further constraints. |
| `failures[].email` | string | yes | No further constraints. |
| `failures[].problems` | array of object | yes | No further constraints. |
| `failures[].problems[].step` | integer | yes | 1-based step number. |
| `failures[].problems[].variant` | string | yes | The subject variant this lead gets for the step. |
| `failures[].problems[].part` | "subject" or "body" | yes | No further constraints. |
| `failures[].problems[].kind` | "missing_field" or "invalid_spintax" | yes | No further constraints. |
| `failures[].problems[].field` | string or null | yes | The merge field with no value and no fallback; null for a spintax error. |
| `failures[].problems[].message` | string | yes | No further constraints. |
| `failures_truncated` | boolean | yes | No further constraints. |

Response example, HTTP 200:

```
{
  "campaign_id": "id_8f3a2c1d",
  "ready": true,
  "leads_enrolled": 1,
  "leads_excluded": 1,
  "leads_checked": 1,
  "leads_rendering": 1,
  "leads_failing": 1,
  "emails_checked": 1,
  "emails_rendering": 1,
  "emails_failing": 1,
  "failures": [
    {
      "lead_id": "id_8f3a2c1d",
      "email": "maya@example.com",
      "problems": [
        {
          "step": 1,
          "variant": "abc123",
          "part": "subject",
          "kind": "missing_field",
          "field": "abc123",
          "message": "abc123"
        }
      ]
    }
  ],
  "failures_truncated": true
}
```

### Errors

[`invalid_input`](https://coldagentai.com/docs/errors.md#invalid_input), [`unauthorized`](https://coldagentai.com/docs/errors.md#unauthorized), [`unknown_product`](https://coldagentai.com/docs/errors.md#unknown_product), [`rate_limited`](https://coldagentai.com/docs/errors.md#rate_limited), [`internal_error`](https://coldagentai.com/docs/errors.md#internal_error). Every error uses the [single format](https://coldagentai.com/docs/errors.md#format).

### Rate limits

Counted per key: 200 requests per 10 seconds. Every response carries `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. Over the limit the answer is `429 rate_limited` with `Retry-After`. See [Rate limits](https://coldagentai.com/docs/rate-limits.md).

### Examples

cURL:

```
curl "https://api.coldagentai.com/v1/campaigns/$CAMPAIGN_ID/render-check" \
  -H "Authorization: Bearer $COLDAGENTAI_API_KEY"
```

JavaScript (fetch):

```
const id = 'id_8f3a2c1d';
const res = await fetch(`https://api.coldagentai.com/v1/campaigns/${id}/render-check`, {
  headers: { Authorization: `Bearer ${process.env.COLDAGENTAI_API_KEY}` },
});
if (!res.ok) throw new Error(JSON.stringify(await res.json()));
const data = await res.json();
```

## POST /v1/campaigns/{id}/start

Makes the campaign active so the send cycle mails its leads inside the schedule. Refused until the account has a postal address, the campaign has at least one connected mailbox and at least one step, and the kill switch is off. It also renders every email first (see GET /v1/campaigns/{id}/render-check) and is refused while any lead has an email that would fail, for example a merge field with no value and no fallback; the message names the leads and fields. Send skip_failing_leads: true to start anyway: those leads are skipped for this campaign (their remaining steps are cancelled and never sent, even if their fields are fixed later) and every other lead is mailed. Nothing is sent by this call itself; the send cycle does the sending. Starting an active campaign changes nothing and skips nobody; the check applies when starting a draft or resuming a paused campaign.

Scope: `write`. A read key gets 403 forbidden. Success: HTTP 200.

### Path parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | at least 1 characters |

### Request body

Send JSON with `Content-Type: application/json`. The body is optional.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `skip_failing_leads` | boolean | no | Start although some leads have an email that would not render, skipping those leads. Default false. |

Request example:

```
{
  "skip_failing_leads": true
}
```

### Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | No further constraints. |
| `name` | string | yes | No further constraints. |
| `status` | "draft" or "active" or "paused" or "completed" | yes | No further constraints. |
| `schedule` | object | yes | No further constraints. |
| `schedule.timezone` | string | yes | No further constraints. |
| `schedule.sending_days` | array of "mon" or "tue" or "wed" or "thu" or "fri" or "sat" or "sun" | yes | No further constraints. |
| `schedule.start_hour` | integer | yes | No further constraints. |
| `schedule.end_hour` | integer | yes | No further constraints. |
| `daily_limit` | integer or null | yes | No further constraints. |
| `stop_on_reply` | boolean | yes | No further constraints. |
| `mailbox_ids` | array of string | yes | No further constraints. |
| `created_at` | string (date-time) | yes | ISO 8601 time in UTC |
| `updated_at` | string (date-time) | yes | ISO 8601 time in UTC |
| `started_at` | string (date-time) or null | yes | ISO 8601 time in UTC |
| `completed_at` | string (date-time) or null | yes | ISO 8601 time in UTC |
| `warnings` | array of string | yes | Things that will keep mail from going out even though the campaign is active. |
| `skipped_leads` | integer | yes | Leads whose emails would not render and were skipped because skip_failing_leads was set; 0 otherwise. |

Response example, HTTP 200:

```
{
  "id": "id_8f3a2c1d",
  "name": "Example",
  "status": "draft",
  "schedule": {
    "timezone": "America/New_York",
    "sending_days": [
      "mon"
    ],
    "start_hour": 1,
    "end_hour": 1
  },
  "daily_limit": 1,
  "stop_on_reply": true,
  "mailbox_ids": [
    "abc123"
  ],
  "created_at": "2026-10-17T12:00:00.000Z",
  "updated_at": "2026-10-17T12:00:00.000Z",
  "started_at": "2026-10-17T12:00:00.000Z",
  "completed_at": "2026-10-17T12:00:00.000Z",
  "warnings": [
    "abc123"
  ],
  "skipped_leads": 1
}
```

### Errors

[`invalid_input`](https://coldagentai.com/docs/errors.md#invalid_input), [`unauthorized`](https://coldagentai.com/docs/errors.md#unauthorized), [`forbidden`](https://coldagentai.com/docs/errors.md#forbidden), [`unknown_product`](https://coldagentai.com/docs/errors.md#unknown_product), [`payload_too_large`](https://coldagentai.com/docs/errors.md#payload_too_large), [`rate_limited`](https://coldagentai.com/docs/errors.md#rate_limited), [`internal_error`](https://coldagentai.com/docs/errors.md#internal_error), [`provider_unavailable`](https://coldagentai.com/docs/errors.md#provider_unavailable). Every error uses the [single format](https://coldagentai.com/docs/errors.md#format).

### Rate limits

Counted per key: 200 requests per 10 seconds. Every response carries `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. Over the limit the answer is `429 rate_limited` with `Retry-After`. See [Rate limits](https://coldagentai.com/docs/rate-limits.md).

### Examples

cURL:

```
curl -X POST "https://api.coldagentai.com/v1/campaigns/$CAMPAIGN_ID/start" \
  -H "Authorization: Bearer $COLDAGENTAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "skip_failing_leads": true
}'
```

JavaScript (fetch):

```
const id = 'id_8f3a2c1d';
const res = await fetch(`https://api.coldagentai.com/v1/campaigns/${id}/start`, {
  method: 'POST',
  body: JSON.stringify({
    "skip_failing_leads": true
  }),
  headers: { Authorization: `Bearer ${process.env.COLDAGENTAI_API_KEY}`, 'Content-Type': 'application/json' },
});
if (!res.ok) throw new Error(JSON.stringify(await res.json()));
const data = await res.json();
```

## POST /v1/campaigns/{id}/pause

Stops further sends for the campaign at the next send cycle. Leads keep their place in the sequence; start it again to continue. Pausing a paused campaign changes nothing.

Scope: `write`. A read key gets 403 forbidden. Success: HTTP 200.

### Path parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | at least 1 characters |

### Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | No further constraints. |
| `name` | string | yes | No further constraints. |
| `status` | "draft" or "active" or "paused" or "completed" | yes | No further constraints. |
| `schedule` | object | yes | No further constraints. |
| `schedule.timezone` | string | yes | No further constraints. |
| `schedule.sending_days` | array of "mon" or "tue" or "wed" or "thu" or "fri" or "sat" or "sun" | yes | No further constraints. |
| `schedule.start_hour` | integer | yes | No further constraints. |
| `schedule.end_hour` | integer | yes | No further constraints. |
| `daily_limit` | integer or null | yes | No further constraints. |
| `stop_on_reply` | boolean | yes | No further constraints. |
| `mailbox_ids` | array of string | yes | No further constraints. |
| `created_at` | string (date-time) | yes | ISO 8601 time in UTC |
| `updated_at` | string (date-time) | yes | ISO 8601 time in UTC |
| `started_at` | string (date-time) or null | yes | ISO 8601 time in UTC |
| `completed_at` | string (date-time) or null | yes | ISO 8601 time in UTC |

Response example, HTTP 200:

```
{
  "id": "id_8f3a2c1d",
  "name": "Example",
  "status": "draft",
  "schedule": {
    "timezone": "America/New_York",
    "sending_days": [
      "mon"
    ],
    "start_hour": 1,
    "end_hour": 1
  },
  "daily_limit": 1,
  "stop_on_reply": true,
  "mailbox_ids": [
    "abc123"
  ],
  "created_at": "2026-10-17T12:00:00.000Z",
  "updated_at": "2026-10-17T12:00:00.000Z",
  "started_at": "2026-10-17T12:00:00.000Z",
  "completed_at": "2026-10-17T12:00:00.000Z"
}
```

### Errors

[`invalid_input`](https://coldagentai.com/docs/errors.md#invalid_input), [`unauthorized`](https://coldagentai.com/docs/errors.md#unauthorized), [`forbidden`](https://coldagentai.com/docs/errors.md#forbidden), [`unknown_product`](https://coldagentai.com/docs/errors.md#unknown_product), [`rate_limited`](https://coldagentai.com/docs/errors.md#rate_limited), [`internal_error`](https://coldagentai.com/docs/errors.md#internal_error). Every error uses the [single format](https://coldagentai.com/docs/errors.md#format).

### Rate limits

Counted per key: 200 requests per 10 seconds. Every response carries `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. Over the limit the answer is `429 rate_limited` with `Retry-After`. See [Rate limits](https://coldagentai.com/docs/rate-limits.md).

### Examples

cURL:

```
curl -X POST "https://api.coldagentai.com/v1/campaigns/$CAMPAIGN_ID/pause" \
  -H "Authorization: Bearer $COLDAGENTAI_API_KEY"
```

JavaScript (fetch):

```
const id = 'id_8f3a2c1d';
const res = await fetch(`https://api.coldagentai.com/v1/campaigns/${id}/pause`, {
  method: 'POST',
  headers: { Authorization: `Bearer ${process.env.COLDAGENTAI_API_KEY}` },
});
if (!res.ok) throw new Error(JSON.stringify(await res.json()));
const data = await res.json();
```

## POST /v1/campaigns/{id}/preview

Renders one step exactly as it would be sent to one of your leads: merge fields filled, spintax expanded, subject variant chosen, footer added. Sends nothing and changes nothing. A merge field with no value and no fallback is reported as invalid_input, as it would fail the real send.

Scope: `read`. A read key and a write key both work. Success: HTTP 200.

### Path parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | at least 1 characters |

### Request body

Send JSON with `Content-Type: application/json`. The body is required.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `lead_id` | string | yes | At least 1 characters. |
| `step` | integer | no | 1-based step number; default 1. At least 1. |
| `variant` | string | no | Subject variant letter; default A. |

Request example:

```
{
  "lead_id": "id_8f3a2c1d"
}
```

### Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `step` | integer | yes | No further constraints. |
| `variant` | string | yes | No further constraints. |
| `subject` | string | yes | No further constraints. |
| `body` | string | yes | No further constraints. |
| `text_with_footer` | string or null | yes | The plain-text message with the compliance footer; null until a postal address is set. The unsubscribe link is signed per recipient at send time. |
| `warnings` | array of string | yes | No further constraints. |

Response example, HTTP 200:

```
{
  "step": 1,
  "variant": "abc123",
  "subject": "Quick question about your onboarding",
  "body": "abc123",
  "text_with_footer": "abc123",
  "warnings": [
    "abc123"
  ]
}
```

### Errors

[`invalid_input`](https://coldagentai.com/docs/errors.md#invalid_input), [`unauthorized`](https://coldagentai.com/docs/errors.md#unauthorized), [`unknown_product`](https://coldagentai.com/docs/errors.md#unknown_product), [`payload_too_large`](https://coldagentai.com/docs/errors.md#payload_too_large), [`rate_limited`](https://coldagentai.com/docs/errors.md#rate_limited), [`internal_error`](https://coldagentai.com/docs/errors.md#internal_error). Every error uses the [single format](https://coldagentai.com/docs/errors.md#format).

### Rate limits

Counted per key: 200 requests per 10 seconds. Every response carries `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. Over the limit the answer is `429 rate_limited` with `Retry-After`. See [Rate limits](https://coldagentai.com/docs/rate-limits.md).

### Examples

cURL:

```
curl -X POST "https://api.coldagentai.com/v1/campaigns/$CAMPAIGN_ID/preview" \
  -H "Authorization: Bearer $COLDAGENTAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "lead_id": "id_8f3a2c1d"
}'
```

JavaScript (fetch):

```
const id = 'id_8f3a2c1d';
const res = await fetch(`https://api.coldagentai.com/v1/campaigns/${id}/preview`, {
  method: 'POST',
  body: JSON.stringify({
    "lead_id": "id_8f3a2c1d"
  }),
  headers: { Authorization: `Bearer ${process.env.COLDAGENTAI_API_KEY}`, 'Content-Type': 'application/json' },
});
if (!res.ok) throw new Error(JSON.stringify(await res.json()));
const data = await res.json();
```

## GET /v1/campaigns/{id}/analytics

Sent, replied, positive replies, bounces and unsubscribes for the campaign, counted per distinct lead from the send log, plus a per-step, per-variant readout for A/B subjects. Rates are null until something has been sent.

Scope: `read`. A read key and a write key both work. Success: HTTP 200.

### Path parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | at least 1 characters |

### Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `campaign_id` | string | yes | No further constraints. |
| `totals` | object | yes | No further constraints. |
| `totals.sent` | integer | yes | Messages the mail provider accepted. |
| `totals.recipients` | integer | yes | Distinct leads that were sent at least one message. |
| `totals.replied` | integer | yes | Distinct leads with a human reply (not out-of-office or bounce). |
| `totals.positive_replies` | integer | yes | Distinct leads with an interested or meeting-booked reply. |
| `totals.meetings_booked` | integer | yes | No further constraints. |
| `totals.bounced` | integer | yes | No further constraints. |
| `totals.unsubscribed` | integer | yes | No further constraints. |
| `totals.failed` | integer | yes | Sends that failed for good. |
| `totals.blocked` | integer | yes | Sends held back because a mailbox, credential or adapter is unavailable. |
| `totals.pending` | integer | yes | Sends waiting to retry. |
| `totals.reply_rate` | number or null | yes | replied / recipients; null while nothing has been sent. |
| `totals.positive_reply_rate` | number or null | yes | No further constraints. |
| `totals.bounce_rate` | number or null | yes | No further constraints. |
| `variants` | array of object | yes | No further constraints. |
| `variants[].step` | integer | yes | No further constraints. |
| `variants[].variant` | string | yes | No further constraints. |
| `variants[].sent` | integer | yes | No further constraints. |
| `variants[].replied` | integer | yes | No further constraints. |

Response example, HTTP 200:

```
{
  "campaign_id": "id_8f3a2c1d",
  "totals": {
    "sent": 1,
    "recipients": 1,
    "replied": 1,
    "positive_replies": 1,
    "meetings_booked": 1,
    "bounced": 1,
    "unsubscribed": 1,
    "failed": 1,
    "blocked": 1,
    "pending": 1,
    "reply_rate": 1,
    "positive_reply_rate": 1,
    "bounce_rate": 1
  },
  "variants": [
    {
      "step": 1,
      "variant": "abc123",
      "sent": 1,
      "replied": 1
    }
  ]
}
```

### Errors

[`invalid_input`](https://coldagentai.com/docs/errors.md#invalid_input), [`unauthorized`](https://coldagentai.com/docs/errors.md#unauthorized), [`unknown_product`](https://coldagentai.com/docs/errors.md#unknown_product), [`rate_limited`](https://coldagentai.com/docs/errors.md#rate_limited), [`internal_error`](https://coldagentai.com/docs/errors.md#internal_error). Every error uses the [single format](https://coldagentai.com/docs/errors.md#format).

### Rate limits

Counted per key: 200 requests per 10 seconds. Every response carries `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. Over the limit the answer is `429 rate_limited` with `Retry-After`. See [Rate limits](https://coldagentai.com/docs/rate-limits.md).

### Examples

cURL:

```
curl "https://api.coldagentai.com/v1/campaigns/$CAMPAIGN_ID/analytics" \
  -H "Authorization: Bearer $COLDAGENTAI_API_KEY"
```

JavaScript (fetch):

```
const id = 'id_8f3a2c1d';
const res = await fetch(`https://api.coldagentai.com/v1/campaigns/${id}/analytics`, {
  headers: { Authorization: `Bearer ${process.env.COLDAGENTAI_API_KEY}` },
});
if (!res.ok) throw new Error(JSON.stringify(await res.json()));
const data = await res.json();
```

## Related

- [API reference](https://coldagentai.com/docs/api.md)
- [API authentication](https://coldagentai.com/docs/authentication.md)
- [API errors](https://coldagentai.com/docs/errors.md)
- [Leads API reference](https://coldagentai.com/docs/api/leads.md)
- [Mailboxes API reference](https://coldagentai.com/docs/api/mailboxes.md)
