---
title: "Leads API reference"
url: "https://coldagentai.com/docs/api/leads.md"
canonical_url: "https://coldagentai.com/docs/api/leads"
last_updated: "2026-10-22"
type: "reference"
summary: "Add leads to a campaign as JSON or CSV, list the leads in a campaign and change a lead status with the ColdAgentAI 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/campaigns.md", "https://coldagentai.com/docs/guides/add-leads-to-a-campaign.md"]
install: "claude mcp add --transport http coldagentai-free https://coldagentai.com/api/mcp"
---

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

Add leads to a campaign as JSON or CSV, list the leads in a campaign and change a lead status with the ColdAgentAI API.

Add leads to a campaign by JSON or CSV, list them and change a lead status. 4 operations.

## Operations

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 |
| --- | --- | --- |
| `POST /v1/campaigns/{id}/leads` | write | Add leads to a campaign |
| `GET /v1/campaigns/{id}/leads` | read | List the leads in a campaign |
| `POST /v1/campaigns/{id}/leads/import` | write | Import leads from CSV |
| `PATCH /v1/leads/{id}` | write | Change 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

| 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 |
| --- | --- | --- | --- |
| `leads` | array of object | yes | 1 to 1000 items. |
| `leads[].email` | string | yes | 0 to 320 characters. |
| `leads[].first_name` | string or null | no | 0 to 200 characters. |
| `leads[].last_name` | string or null | no | 0 to 200 characters. |
| `leads[].company_name` | string or null | no | 0 to 200 characters. |
| `leads[].title` | string or null | no | 0 to 200 characters. |
| `leads[].custom_fields` | map of string | no | No further constraints. |

Request example:

```
{
  "leads": [
    {
      "email": "maya@example.com"
    }
  ]
}
```

### Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `campaign_id` | string | yes | No further constraints. |
| `created` | integer | yes | No further constraints. |
| `updated` | integer | yes | Rows for an address already in the account; the fields given were applied. |
| `duplicates` | integer | yes | Rows repeating an address earlier in the same request. |
| `rejected` | integer | yes | No further constraints. |
| `rows` | array of object | yes | No further constraints. |
| `rows[].index` | integer | yes | Position of the row in the request, starting at 0. |
| `rows[].email` | string | yes | No further constraints. |
| `rows[].outcome` | "created" or "updated" or "duplicate" or "rejected" | yes | No further constraints. |
| `rows[].lead_id` | string or null | yes | No further constraints. |
| `rows[].reason` | string or null | yes | Why 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`](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/$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

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

### Query parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `status` | "new" or "contacted" or "replied" or "interested" or "meeting_booked" or "not_interested" or "bounced" or "unsubscribed" or "blocked" | 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[].email` | string | yes | No further constraints. |
| `data[].first_name` | string or null | yes | No further constraints. |
| `data[].last_name` | string or null | yes | No further constraints. |
| `data[].company_name` | string or null | yes | No further constraints. |
| `data[].title` | string or null | yes | No further constraints. |
| `data[].custom_fields` | map of string | yes | No further constraints. |
| `data[].status` | "new" or "contacted" or "replied" or "interested" or "meeting_booked" or "not_interested" or "bounced" or "unsubscribed" or "blocked" | yes | No further constraints. |
| `data[].verification` | "unverified" or "valid" or "invalid" or "catch_all" or "unknown" or "risky" | yes | No further constraints. |
| `data[].verified_at` | string (date-time) or null | yes | ISO 8601 time in UTC |
| `data[].source` | string or null | 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 |
| `next_cursor` | string or null | yes | No 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`](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/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

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

### Query parameters

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `layout` | "generic" or "smartlead" | no | No further constraints. |

### Request body

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

Request example:

```
abc123
```

### Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `campaign_id` | string | yes | No further constraints. |
| `created` | integer | yes | No further constraints. |
| `updated` | integer | yes | Rows for an address already in the account; the fields given were applied. |
| `duplicates` | integer | yes | Rows repeating an address earlier in the same request. |
| `rejected` | integer | yes | No further constraints. |
| `rows` | array of object | yes | No further constraints. |
| `rows[].index` | integer | yes | Position of the row in the request, starting at 0. |
| `rows[].email` | string | yes | No further constraints. |
| `rows[].outcome` | "created" or "updated" or "duplicate" or "rejected" | yes | No further constraints. |
| `rows[].lead_id` | string or null | yes | No further constraints. |
| `rows[].reason` | string or null | yes | Why the row was rejected, in plain language; null otherwise. |
| `csv_rejected` | array of object | yes | Rows the parser refused, by line number in the file. |
| `csv_rejected[].line` | integer | yes | No further constraints. |
| `csv_rejected[].email` | string or null | yes | No further constraints. |
| `csv_rejected[].reason` | string | yes | No further constraints. |
| `flagged_cells` | integer | yes | Cells that begin with = + - @ and could act as spreadsheet formulas if written back to a sheet. |
| `warnings` | array of string | yes | No 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`](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/$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

| 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 |
| --- | --- | --- | --- |
| `status` | "new" or "contacted" or "replied" or "interested" or "meeting_booked" or "not_interested" or "bounced" or "unsubscribed" or "blocked" | yes | No further constraints. |

Request example:

```
{
  "status": "new"
}
```

### Response

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `id` | string | yes | No further constraints. |
| `email` | string | yes | No further constraints. |
| `first_name` | string or null | yes | No further constraints. |
| `last_name` | string or null | yes | No further constraints. |
| `company_name` | string or null | yes | No further constraints. |
| `title` | string or null | yes | No further constraints. |
| `custom_fields` | map of string | yes | No further constraints. |
| `status` | "new" or "contacted" or "replied" or "interested" or "meeting_booked" or "not_interested" or "bounced" or "unsubscribed" or "blocked" | yes | No further constraints. |
| `verification` | "unverified" or "valid" or "invalid" or "catch_all" or "unknown" or "risky" | yes | No further constraints. |
| `verified_at` | string (date-time) or null | yes | ISO 8601 time in UTC |
| `source` | string or null | 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 |

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`](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/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();
```

## 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)
- [Campaigns API reference](https://coldagentai.com/docs/api/campaigns.md)
- [Load leads into a campaign](https://coldagentai.com/docs/guides/add-leads-to-a-campaign.md)
