# Export Campaign Beta

> A campaign's settings, steps and variants as a portable document.

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

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

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

Requires an API key with the `read` scope.

Returns the campaign's settings, sequence steps and A/B variants as a versioned document that [Import Campaign](https://www.foxreach.io/docs/api-reference/campaigns/import-campaign) reads, in this workspace or another one. The document holds no leads, no sending accounts, no ids, no share link and no statistics. It uses `POST` because it is an action on the campaign, but it only reads: it needs the `read` scope and counts against the `read` rate limit. Like duplicating a campaign, it does not carry the bounce breaker threshold or a step's body type.

## Path Parameters

- `campaign_id` string path required

  The campaign id. An id from another workspace returns `404`.

**Request example**

```bash cURL
curl -X POST "https://api.foxreach.io/api/v1/campaigns/cmp_abc123/export" \
  -H "X-API-Key: otr_your_key"
```

```python Python SDK (beta)
from foxreach import FoxReach

client = FoxReach(api_key="otr_your_key")
document = client.campaigns.export("cmp_abc123")
```

```typescript TypeScript SDK (beta)
import { FoxReach } from "foxreach";

const client = new FoxReach({ apiKey: "otr_your_key" });
const document = await client.campaigns.export("cmp_abc123");
```

**Response example**

```json
{
  "data": {
    "format": "foxreach.campaign",
    "version": 1,
    "exportedAt": "2026-12-03T10:00:00+00:00",
    "campaign": {
      "name": "Q1 outreach",
      "timezone": "America/New_York",
      "sendingDays": [1, 2, 3, 4, 5],
      "sendingStartHour": 9,
      "sendingStartMinute": 0,
      "sendingEndHour": 17,
      "sendingEndMinute": 0,
      "dailyLimit": 50,
      "context": null,
      "minGapMinutes": null,
      "sendGapJitterMinutes": null,
      "listUnsubscribeHeader": false,
      "espMatching": false,
      "trackOpens": false,
      "trackOpensFirstStep": false,
      "trackClicks": false,
      "sequences": [
        {
          "stepNumber": 1,
          "name": "Intro",
          "subject": "Quick question, {{firstName}}",
          "body": "Hi {{firstName}}, ...",
          "delayDays": 0,
          "delayHours": 0,
          "sendOnlyIfNoReply": true,
          "sendAsHtml": false,
          "variants": [
            { "label": "A", "subject": "Quick question", "body": "Hi, ...", "weight": 1, "sendAsHtml": false }
          ]
        }
      ]
    }
  }
}
```

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

## Rate Limit

- **300 requests per minute, shared by every `read` 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` (`read`).
- 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).
