Leads API reference

Add leads to a campaign by JSON or CSV, list them and change a lead status. 4 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

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

Method and pathScopeWhat it does
POST /v1/campaigns/{id}/leadswriteAdd leads to a campaign
GET /v1/campaigns/{id}/leadsreadList the leads in a campaign
POST /v1/campaigns/{id}/leads/importwriteImport leads from CSV
PATCH /v1/leads/{id}writeChange a lead status

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

Accepts at most 1,000 leads per call, deduplicated by email (case-insensitive) against the request and the account. A row that cannot be added is reported with the reason and does not fail the others: an invalid address, an address on the suppression list, or a new address beyond the plan active-contact cap. An address already in the account is updated with the fields given and enrolled in this 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
leadsarray of objectyes1 to 1000 items.
leads[].emailstringyes0 to 320 characters.
leads[].first_namestring or nullno0 to 200 characters.
leads[].last_namestring or nullno0 to 200 characters.
leads[].company_namestring or nullno0 to 200 characters.
leads[].titlestring or nullno0 to 200 characters.
leads[].custom_fieldsmap of stringnoNo further constraints.
Request example
{
  "leads": [
    {
      "email": "maya@example.com"
    }
  ]
}

Response

FieldTypeRequiredDescription
campaign_idstringyesNo further constraints.
createdintegeryesNo further constraints.
updatedintegeryesRows for an address already in the account; the fields given were applied.
duplicatesintegeryesRows repeating an address earlier in the same request.
rejectedintegeryesNo further constraints.
rowsarray of objectyesNo further constraints.
rows[].indexintegeryesPosition of the row in the request, starting at 0.
rows[].emailstringyesNo further constraints.
rows[].outcome"created" or "updated" or "duplicate" or "rejected"yesNo further constraints.
rows[].lead_idstring or nullyesNo further constraints.
rows[].reasonstring or nullyesWhy the row was rejected, in plain language; null otherwise.
Response example, HTTP 200
{
  "campaign_id": "id_8f3a2c1d",
  "created": 1,
  "updated": 1,
  "duplicates": 1,
  "rejected": 1,
  "rows": [
    {
      "index": 1,
      "email": "maya@example.com",
      "outcome": "created",
      "lead_id": "id_8f3a2c1d",
      "reason": "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 POST "https://api.coldagentai.com/v1/campaigns/$CAMPAIGN_ID/leads" \
  -H "Authorization: Bearer $COLDAGENTAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "leads": [
    {
      "email": "maya@example.com"
    }
  ]
}'
JavaScript (fetch)
const id = 'id_8f3a2c1d';
const res = await fetch(`https://api.coldagentai.com/v1/campaigns/${id}/leads`, {
  method: 'POST',
  body: JSON.stringify({
    "leads": [
      {
        "email": "maya@example.com"
      }
    ]
  }),
  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}/leads

Leads enrolled in the campaign, oldest first, optionally filtered by status. Pass next_cursor as cursor for the next page.

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

Path parameters

FieldTypeRequiredDescription
idstringyesat least 1 characters

Query parameters

FieldTypeRequiredDescription
status"new" or "contacted" or "replied" or "interested" or "meeting_booked" or "not_interested" or "bounced" or "unsubscribed" or "blocked"noNo further constraints.
limitintegerno1 to 100
cursorstringno0 to 500 characters

Response

FieldTypeRequiredDescription
dataarray of objectyesNo further constraints.
data[].idstringyesNo further constraints.
data[].emailstringyesNo further constraints.
data[].first_namestring or nullyesNo further constraints.
data[].last_namestring or nullyesNo further constraints.
data[].company_namestring or nullyesNo further constraints.
data[].titlestring or nullyesNo further constraints.
data[].custom_fieldsmap of stringyesNo further constraints.
data[].status"new" or "contacted" or "replied" or "interested" or "meeting_booked" or "not_interested" or "bounced" or "unsubscribed" or "blocked"yesNo further constraints.
data[].verification"unverified" or "valid" or "invalid" or "catch_all" or "unknown" or "risky"yesNo further constraints.
data[].verified_atstring (date-time) or nullyesISO 8601 time in UTC
data[].sourcestring or nullyesNo further constraints.
data[].created_atstring (date-time)yesISO 8601 time in UTC
data[].updated_atstring (date-time)yesISO 8601 time in UTC
next_cursorstring or nullyesNo further constraints.
Response example, HTTP 200
{
  "data": [
    {
      "id": "id_8f3a2c1d",
      "email": "maya@example.com",
      "first_name": "Maya",
      "last_name": "Chen",
      "company_name": "Example",
      "title": "abc123",
      "custom_fields": {
        "example_key": "abc123"
      },
      "status": "new",
      "verification": "unverified",
      "verified_at": "2026-10-17T12:00:00.000Z",
      "source": "abc123",
      "created_at": "2026-10-17T12:00:00.000Z",
      "updated_at": "2026-10-17T12:00:00.000Z"
    }
  ],
  "next_cursor": "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/leads" \
  -H "Authorization: Bearer $COLDAGENTAI_API_KEY"
JavaScript (fetch)
const id = 'id_8f3a2c1d';
const res = await fetch(`https://api.coldagentai.com/v1/campaigns/${id}/leads`, {
  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}/leads/import

Send the CSV text as the request body (Content-Type text/plain, at most 5 MB and 1,000 data rows). The first row is the header; the email column is found by name (email, work email, and similar). First name, last name, company and title are mapped from their usual headers, and every other column becomes a custom field usable as a merge field. layout=smartlead reads a Smartlead export and skips its activity columns. Duplicate headers are made unique, a byte order mark and CRLF line ends are handled, and cells starting with = + - @ are kept as text and counted in flagged_cells. Suppression, plan cap and per-row reporting work as for the JSON endpoint.

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

Path parameters

FieldTypeRequiredDescription
idstringyesat least 1 characters

Query parameters

FieldTypeRequiredDescription
layout"generic" or "smartlead"noNo further constraints.

Request body

Send the body as text/plain. The body is required.

Request example
abc123

Response

FieldTypeRequiredDescription
campaign_idstringyesNo further constraints.
createdintegeryesNo further constraints.
updatedintegeryesRows for an address already in the account; the fields given were applied.
duplicatesintegeryesRows repeating an address earlier in the same request.
rejectedintegeryesNo further constraints.
rowsarray of objectyesNo further constraints.
rows[].indexintegeryesPosition of the row in the request, starting at 0.
rows[].emailstringyesNo further constraints.
rows[].outcome"created" or "updated" or "duplicate" or "rejected"yesNo further constraints.
rows[].lead_idstring or nullyesNo further constraints.
rows[].reasonstring or nullyesWhy the row was rejected, in plain language; null otherwise.
csv_rejectedarray of objectyesRows the parser refused, by line number in the file.
csv_rejected[].lineintegeryesNo further constraints.
csv_rejected[].emailstring or nullyesNo further constraints.
csv_rejected[].reasonstringyesNo further constraints.
flagged_cellsintegeryesCells that begin with = + - @ and could act as spreadsheet formulas if written back to a sheet.
warningsarray of stringyesNo further constraints.
Response example, HTTP 200
{
  "campaign_id": "id_8f3a2c1d",
  "created": 1,
  "updated": 1,
  "duplicates": 1,
  "rejected": 1,
  "rows": [
    {
      "index": 1,
      "email": "maya@example.com",
      "outcome": "created",
      "lead_id": "id_8f3a2c1d",
      "reason": "abc123"
    }
  ],
  "csv_rejected": [
    {
      "line": 1,
      "email": "maya@example.com",
      "reason": "abc123"
    }
  ],
  "flagged_cells": 1,
  "warnings": [
    "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 POST "https://api.coldagentai.com/v1/campaigns/$CAMPAIGN_ID/leads/import" \
  -H "Authorization: Bearer $COLDAGENTAI_API_KEY" \
  -H "Content-Type: text/plain" \
  -d 'abc123'
JavaScript (fetch)
const id = 'id_8f3a2c1d';
const res = await fetch(`https://api.coldagentai.com/v1/campaigns/${id}/leads/import`, {
  method: 'POST',
  body: "abc123",
  headers: { Authorization: `Bearer ${process.env.COLDAGENTAI_API_KEY}`, 'Content-Type': 'text/plain' },
});
if (!res.ok) throw new Error(JSON.stringify(await res.json()));
const data = await res.json();

#PATCH /v1/leads/{id}

Sets the lead status (for example interested or not_interested). Setting unsubscribed honors an opt-out: the address is suppressed and its pending sends are cancelled. A lead that opted out cannot be moved to another status.

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
status"new" or "contacted" or "replied" or "interested" or "meeting_booked" or "not_interested" or "bounced" or "unsubscribed" or "blocked"yesNo further constraints.
Request example
{
  "status": "new"
}

Response

FieldTypeRequiredDescription
idstringyesNo further constraints.
emailstringyesNo further constraints.
first_namestring or nullyesNo further constraints.
last_namestring or nullyesNo further constraints.
company_namestring or nullyesNo further constraints.
titlestring or nullyesNo further constraints.
custom_fieldsmap of stringyesNo further constraints.
status"new" or "contacted" or "replied" or "interested" or "meeting_booked" or "not_interested" or "bounced" or "unsubscribed" or "blocked"yesNo further constraints.
verification"unverified" or "valid" or "invalid" or "catch_all" or "unknown" or "risky"yesNo further constraints.
verified_atstring (date-time) or nullyesISO 8601 time in UTC
sourcestring or nullyesNo further constraints.
created_atstring (date-time)yesISO 8601 time in UTC
updated_atstring (date-time)yesISO 8601 time in UTC
Response example, HTTP 200
{
  "id": "id_8f3a2c1d",
  "email": "maya@example.com",
  "first_name": "Maya",
  "last_name": "Chen",
  "company_name": "Example",
  "title": "abc123",
  "custom_fields": {
    "example_key": "abc123"
  },
  "status": "new",
  "verification": "unverified",
  "verified_at": "2026-10-17T12:00:00.000Z",
  "source": "abc123",
  "created_at": "2026-10-17T12:00:00.000Z",
  "updated_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/leads/$LEAD_ID" \
  -H "Authorization: Bearer $COLDAGENTAI_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "status": "new"
}'
JavaScript (fetch)
const id = 'id_8f3a2c1d';
const res = await fetch(`https://api.coldagentai.com/v1/leads/${id}`, {
  method: 'PATCH',
  body: JSON.stringify({
    "status": "new"
  }),
  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();
Leads