# Export Campaign Leads Beta

> Download a campaign's leads as a CSV file.

> Documentation index: https://www.foxreach.io/docs/llms.txt lists every page of these docs. Each page is also served as Markdown: add `.md` to its URL.

`GET` https://api.foxreach.io/api/v1/campaigns/{campaign_id}/leads/export

> **Note:** **Beta.** This endpoint is new and may change.

Requires an API key with the `read` scope.

Returns `text/csv` with a `Content-Disposition` attachment named after the campaign. Up to 100,000 rows, newest enrollment first, soft-deleted leads left out. Cells that start with `=`, `+`, `-` or `@` are prefixed with `'` so a spreadsheet does not run them. The list filters apply, so you can export only the leads that replied.

## Path Parameters

- `campaign_id` string path required

  The campaign identifier.

## Query Parameters

- `status` string query

  Only leads in this campaign status, for example `replied`.

- `search` string query

  Match on email, first name, last name or company.

- `tags` string query

  Comma-separated tag names.

- `tagMatch` string query

`any` (default) or `all` of the tags.

**Request example**

```bash cURL
curl "https://api.foxreach.io/api/v1/campaigns/cmp_abc123/leads/export?status=replied" \
  -H "X-API-Key: otr_your_key"
```

```python Python
import requests

response = requests.get(
    "https://api.foxreach.io/api/v1/campaigns/cmp_abc123/leads/export?status=replied",
    headers={"X-API-Key": "otr_your_key"}
)
data = response.text
```

```typescript TypeScript
const response = await fetch("https://api.foxreach.io/api/v1/campaigns/cmp_abc123/leads/export?status=replied", { method: "GET", headers: { "X-API-Key": "otr_your_key" } });
const data = await response.text();
```

**Response example**

```csv
Email,First Name,Last Name,Company,Title,Status,Step,Sent,Opened,Last Sent,Replied At
jane@acme.com,Jane,Doe,Acme,CEO,replied,2,2,1,2026-12-01T10:00:00,2026-12-02T08:30:00
```

## Errors

| Status | Description |
|--------|-------------|
| `401` | Missing, invalid, revoked or expired API key |
| `403` | API key does not have the required scope: `read` |
| `404` | Campaign not found |
| `422` | `tagMatch` is not `any` or `all`, or `tags` holds an invalid tag name |

## Rate Limit

- **100 requests per minute, shared by every `bulk` call in your workspace.** Fixed 60-second window.
- Every response includes `X-RateLimit-Limit`, `X-RateLimit-Remaining`, `X-RateLimit-Reset` (unix epoch seconds) and `X-RateLimit-Bucket` (`bulk`).
- A `429` response includes a `Retry-After` header (seconds until the bucket resets).

For client-side patterns, see [Rate Limiting](https://www.foxreach.io/docs/rate-limiting).
