Campaigns API reference

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.

For AI agents: the docs index is at /llms.txt, and every page is also served as markdown at its URL plus .md.

#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 page.

Authenticate as described in Authentication. Every operation below is generated from the OpenAPI document.

Method and pathScopeWhat it does
GET /v1/campaignsreadList campaigns
POST /v1/campaignswriteCreate a campaign
GET /v1/campaigns/{id}readGet a campaign
PATCH /v1/campaigns/{id}writeChange a campaign
DELETE /v1/campaigns/{id}writeDelete a campaign
GET /v1/campaigns/{id}/sequencereadGet the sequence
PUT /v1/campaigns/{id}/sequencewriteReplace the sequence
GET /v1/campaigns/{id}/render-checkreadCheck every email before starting
POST /v1/campaigns/{id}/startwriteStart a campaign
POST /v1/campaigns/{id}/pausewritePause a campaign
POST /v1/campaigns/{id}/previewreadPreview a step for a real lead
GET /v1/campaigns/{id}/analyticsreadCampaign 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

FieldTypeRequiredDescription
status"draft" or "active" or "paused" or "completed"noNo further constraints.
limitintegerno1 to 100
cursorstringno0 to 500 characters

Response

FieldTypeRequiredDescription
dataarray of objectyesNo further constraints.
data[].idstringyesNo further constraints.
data[].namestringyesNo further constraints.
data[].status"draft" or "active" or "paused" or "completed"yesNo further constraints.
data[].scheduleobjectyesNo further constraints.
data[].schedule.timezonestringyesNo further constraints.
data[].schedule.sending_daysarray of "mon" or "tue" or "wed" or "thu" or "fri" or "sat" or "sun"yesNo further constraints.
data[].schedule.start_hourintegeryesNo further constraints.
data[].schedule.end_hourintegeryesNo further constraints.
data[].daily_limitinteger or nullyesNo further constraints.
data[].stop_on_replybooleanyesNo further constraints.
data[].mailbox_idsarray of stringyesNo further constraints.
data[].created_atstring (date-time)yesISO 8601 time in UTC
data[].updated_atstring (date-time)yesISO 8601 time in UTC
data[].started_atstring (date-time) or nullyesISO 8601 time in UTC
data[].completed_atstring (date-time) or nullyesISO 8601 time in UTC
next_cursorstring or nullyesNo 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, unauthorized, rate_limited, internal_error. Every error uses the single 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.

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.

FieldTypeRequiredDescription
namestringyes1 to 200 characters.
scheduleobjectyesNo further constraints.
schedule.timezonestringyes0 to 64 characters.
schedule.sending_daysarray of "mon" or "tue" or "wed" or "thu" or "fri" or "sat" or "sun"yes1 to 7 items.
schedule.start_hourintegeryes0 to 23.
schedule.end_hourintegeryes1 to 24.
daily_limitinteger or nullno1 to 100000.
stop_on_replybooleannoNo further constraints.
mailbox_idsarray of stringno0 to 1000 items.
Request example
{
  "name": "Example",
  "schedule": {
    "timezone": "America/New_York",
    "sending_days": [
      "mon"
    ],
    "start_hour": 1,
    "end_hour": 1
  }
}

Response

FieldTypeRequiredDescription
idstringyesNo further constraints.
namestringyesNo further constraints.
status"draft" or "active" or "paused" or "completed"yesNo further constraints.
scheduleobjectyesNo further constraints.
schedule.timezonestringyesNo further constraints.
schedule.sending_daysarray of "mon" or "tue" or "wed" or "thu" or "fri" or "sat" or "sun"yesNo further constraints.
schedule.start_hourintegeryesNo further constraints.
schedule.end_hourintegeryesNo further constraints.
daily_limitinteger or nullyesNo further constraints.
stop_on_replybooleanyesNo further constraints.
mailbox_idsarray of stringyesNo further constraints.
created_atstring (date-time)yesISO 8601 time in UTC
updated_atstring (date-time)yesISO 8601 time in UTC
started_atstring (date-time) or nullyesISO 8601 time in UTC
completed_atstring (date-time) or nullyesISO 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, unauthorized, forbidden, unknown_product, payload_too_large, rate_limited, internal_error. Every error uses the single 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.

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

FieldTypeRequiredDescription
idstringyesat least 1 characters

Response

FieldTypeRequiredDescription
idstringyesNo further constraints.
namestringyesNo further constraints.
status"draft" or "active" or "paused" or "completed"yesNo further constraints.
scheduleobjectyesNo further constraints.
schedule.timezonestringyesNo further constraints.
schedule.sending_daysarray of "mon" or "tue" or "wed" or "thu" or "fri" or "sat" or "sun"yesNo further constraints.
schedule.start_hourintegeryesNo further constraints.
schedule.end_hourintegeryesNo further constraints.
daily_limitinteger or nullyesNo further constraints.
stop_on_replybooleanyesNo further constraints.
mailbox_idsarray of stringyesNo further constraints.
created_atstring (date-time)yesISO 8601 time in UTC
updated_atstring (date-time)yesISO 8601 time in UTC
started_atstring (date-time) or nullyesISO 8601 time in UTC
completed_atstring (date-time) or nullyesISO 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, unauthorized, unknown_product, rate_limited, internal_error. Every error uses the single 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.

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

FieldTypeRequiredDescription
idstringyesat least 1 characters

Request body

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

FieldTypeRequiredDescription
namestringno1 to 200 characters.
scheduleobjectnoNo further constraints.
schedule.timezonestringyes0 to 64 characters.
schedule.sending_daysarray of "mon" or "tue" or "wed" or "thu" or "fri" or "sat" or "sun"yes1 to 7 items.
schedule.start_hourintegeryes0 to 23.
schedule.end_hourintegeryes1 to 24.
daily_limitinteger or nullno1 to 100000.
stop_on_replybooleannoNo further constraints.
mailbox_idsarray of stringno0 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

FieldTypeRequiredDescription
idstringyesNo further constraints.
namestringyesNo further constraints.
status"draft" or "active" or "paused" or "completed"yesNo further constraints.
scheduleobjectyesNo further constraints.
schedule.timezonestringyesNo further constraints.
schedule.sending_daysarray of "mon" or "tue" or "wed" or "thu" or "fri" or "sat" or "sun"yesNo further constraints.
schedule.start_hourintegeryesNo further constraints.
schedule.end_hourintegeryesNo further constraints.
daily_limitinteger or nullyesNo further constraints.
stop_on_replybooleanyesNo further constraints.
mailbox_idsarray of stringyesNo further constraints.
created_atstring (date-time)yesISO 8601 time in UTC
updated_atstring (date-time)yesISO 8601 time in UTC
started_atstring (date-time) or nullyesISO 8601 time in UTC
completed_atstring (date-time) or nullyesISO 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, unauthorized, forbidden, unknown_product, payload_too_large, rate_limited, internal_error. Every error uses the single 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.

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

FieldTypeRequiredDescription
idstringyesat least 1 characters

Response

FieldTypeRequiredDescription
idstringyesNo further constraints.
deletedtrueyesNo further constraints.
Response example, HTTP 200
{
  "id": "id_8f3a2c1d",
  "deleted": true
}

Errors

invalid_input, unauthorized, forbidden, unknown_product, rate_limited, internal_error. Every error uses the single 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.

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

FieldTypeRequiredDescription
idstringyesat least 1 characters

Response

FieldTypeRequiredDescription
stepsarray of objectyesNo further constraints.
steps[].idstringyesNo further constraints.
steps[].orderintegeryesNo further constraints.
steps[].wait_daysintegeryesNo further constraints.
steps[].subjectsarray of stringyesA/B subject variants; variant A is the first
steps[].bodystringyesNo 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, unauthorized, unknown_product, rate_limited, internal_error. Every error uses the single 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.

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

FieldTypeRequiredDescription
idstringyesat least 1 characters

Request body

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

FieldTypeRequiredDescription
stepsarray of objectyes0 to 30 items.
steps[].wait_daysintegeryes0 to 365.
steps[].subjectsarray of stringyes1 to 26 items.
steps[].bodystringyes1 to 50000 characters.
Request example
{
  "steps": [
    {
      "wait_days": 1,
      "subjects": [
        "Quick question about your onboarding"
      ],
      "body": "abc123"
    }
  ]
}

Response

FieldTypeRequiredDescription
stepsarray of objectyesNo further constraints.
steps[].idstringyesNo further constraints.
steps[].orderintegeryesNo further constraints.
steps[].wait_daysintegeryesNo further constraints.
steps[].subjectsarray of stringyesA/B subject variants; variant A is the first
steps[].bodystringyesNo 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, unauthorized, forbidden, unknown_product, payload_too_large, rate_limited, internal_error. Every error uses the single 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.

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

FieldTypeRequiredDescription
idstringyesat least 1 characters

Response

FieldTypeRequiredDescription
campaign_idstringyesNo further constraints.
readybooleanyesTrue when every email renders, so the campaign can start without skipping anyone.
leads_enrolledintegeryesNo further constraints.
leads_excludedintegeryesEnrolled 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_checkedintegeryesNo further constraints.
leads_renderingintegeryesChecked leads for whom every email still to be sent renders.
leads_failingintegeryesNo further constraints.
emails_checkedintegeryesLead-and-step emails rendered; steps already sent are not rendered again.
emails_renderingintegeryesNo further constraints.
emails_failingintegeryesNo further constraints.
failuresarray of objectyesFailing leads in enrollment order, at most 200; leads_failing is the full count.
failures[].lead_idstringyesNo further constraints.
failures[].emailstringyesNo further constraints.
failures[].problemsarray of objectyesNo further constraints.
failures[].problems[].stepintegeryes1-based step number.
failures[].problems[].variantstringyesThe subject variant this lead gets for the step.
failures[].problems[].part"subject" or "body"yesNo further constraints.
failures[].problems[].kind"missing_field" or "invalid_spintax"yesNo further constraints.
failures[].problems[].fieldstring or nullyesThe merge field with no value and no fallback; null for a spintax error.
failures[].problems[].messagestringyesNo further constraints.
failures_truncatedbooleanyesNo 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, unauthorized, unknown_product, rate_limited, internal_error. Every error uses the single 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.

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

FieldTypeRequiredDescription
idstringyesat least 1 characters

Request body

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

FieldTypeRequiredDescription
skip_failing_leadsbooleannoStart although some leads have an email that would not render, skipping those leads. Default false.
Request example
{
  "skip_failing_leads": true
}

Response

FieldTypeRequiredDescription
idstringyesNo further constraints.
namestringyesNo further constraints.
status"draft" or "active" or "paused" or "completed"yesNo further constraints.
scheduleobjectyesNo further constraints.
schedule.timezonestringyesNo further constraints.
schedule.sending_daysarray of "mon" or "tue" or "wed" or "thu" or "fri" or "sat" or "sun"yesNo further constraints.
schedule.start_hourintegeryesNo further constraints.
schedule.end_hourintegeryesNo further constraints.
daily_limitinteger or nullyesNo further constraints.
stop_on_replybooleanyesNo further constraints.
mailbox_idsarray of stringyesNo further constraints.
created_atstring (date-time)yesISO 8601 time in UTC
updated_atstring (date-time)yesISO 8601 time in UTC
started_atstring (date-time) or nullyesISO 8601 time in UTC
completed_atstring (date-time) or nullyesISO 8601 time in UTC
warningsarray of stringyesThings that will keep mail from going out even though the campaign is active.
skipped_leadsintegeryesLeads 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, unauthorized, forbidden, unknown_product, payload_too_large, rate_limited, internal_error, provider_unavailable. Every error uses the single 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.

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

FieldTypeRequiredDescription
idstringyesat least 1 characters

Response

FieldTypeRequiredDescription
idstringyesNo further constraints.
namestringyesNo further constraints.
status"draft" or "active" or "paused" or "completed"yesNo further constraints.
scheduleobjectyesNo further constraints.
schedule.timezonestringyesNo further constraints.
schedule.sending_daysarray of "mon" or "tue" or "wed" or "thu" or "fri" or "sat" or "sun"yesNo further constraints.
schedule.start_hourintegeryesNo further constraints.
schedule.end_hourintegeryesNo further constraints.
daily_limitinteger or nullyesNo further constraints.
stop_on_replybooleanyesNo further constraints.
mailbox_idsarray of stringyesNo further constraints.
created_atstring (date-time)yesISO 8601 time in UTC
updated_atstring (date-time)yesISO 8601 time in UTC
started_atstring (date-time) or nullyesISO 8601 time in UTC
completed_atstring (date-time) or nullyesISO 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, unauthorized, forbidden, unknown_product, rate_limited, internal_error. Every error uses the single 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.

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

FieldTypeRequiredDescription
idstringyesat least 1 characters

Request body

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

FieldTypeRequiredDescription
lead_idstringyesAt least 1 characters.
stepintegerno1-based step number; default 1. At least 1.
variantstringnoSubject variant letter; default A.
Request example
{
  "lead_id": "id_8f3a2c1d"
}

Response

FieldTypeRequiredDescription
stepintegeryesNo further constraints.
variantstringyesNo further constraints.
subjectstringyesNo further constraints.
bodystringyesNo further constraints.
text_with_footerstring or nullyesThe plain-text message with the compliance footer; null until a postal address is set. The unsubscribe link is signed per recipient at send time.
warningsarray of stringyesNo 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, unauthorized, unknown_product, payload_too_large, rate_limited, internal_error. Every error uses the single 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.

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

FieldTypeRequiredDescription
idstringyesat least 1 characters

Response

FieldTypeRequiredDescription
campaign_idstringyesNo further constraints.
totalsobjectyesNo further constraints.
totals.sentintegeryesMessages the mail provider accepted.
totals.recipientsintegeryesDistinct leads that were sent at least one message.
totals.repliedintegeryesDistinct leads with a human reply (not out-of-office or bounce).
totals.positive_repliesintegeryesDistinct leads with an interested or meeting-booked reply.
totals.meetings_bookedintegeryesNo further constraints.
totals.bouncedintegeryesNo further constraints.
totals.unsubscribedintegeryesNo further constraints.
totals.failedintegeryesSends that failed for good.
totals.blockedintegeryesSends held back because a mailbox, credential or adapter is unavailable.
totals.pendingintegeryesSends waiting to retry.
totals.reply_ratenumber or nullyesreplied / recipients; null while nothing has been sent.
totals.positive_reply_ratenumber or nullyesNo further constraints.
totals.bounce_ratenumber or nullyesNo further constraints.
variantsarray of objectyesNo further constraints.
variants[].stepintegeryesNo further constraints.
variants[].variantstringyesNo further constraints.
variants[].sentintegeryesNo further constraints.
variants[].repliedintegeryesNo 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, unauthorized, unknown_product, rate_limited, internal_error. Every error uses the single 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.

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();
Campaigns