# Import Campaign Beta

> Create a draft campaign from an exported 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/import

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

Requires an API key with the `write` scope.

Creates a **draft** campaign from the document [Export Campaign](https://www.foxreach.io/docs/api-reference/campaigns/export-campaign) returns (send the contents of `data`). The new campaign has the document's settings, steps and A/B variants. It has no sending accounts and no leads: attach accounts and add leads, then start it. The request is rejected with `422` and nothing is created when the document has an unknown field, a `version` other than `1`, an invalid timezone or `sendingDays`, more than 20 steps or 10 variants per step, steps not numbered 1, 2, 3 in order, duplicate variant labels within a step, invalid spin syntax, or more than 1,000,000 characters of step text in total. The request body is limited to 2 MB. An audit entry `audit.campaign.imported` is recorded.

## Query Parameters

- `name` string query

  Name for the new campaign instead of the one in the document. 1 to 255 characters.

## Request Body

The exported document: `format` (`foxreach.campaign`), `version` (`1`), optional `exportedAt` (ignored), and `campaign` with `name` and the settings and `sequences` shown below. Every field of `campaign` except `name` is optional and takes the default of Create Campaign.

**Request example**

```bash cURL
curl -X POST "https://api.foxreach.io/api/v1/campaigns/import?name=Q1%20outreach%20copy" \
  -H "X-API-Key: otr_your_key" \
  -H "Content-Type: application/json" \
  -d @campaign.json
```

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

client = FoxReach(api_key="otr_your_key")
document = client.campaigns.export("cmp_abc123")
created = other_workspace_client.campaigns.import_campaign(document, name="Q1 outreach copy")
```

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

const source = new FoxReach({ apiKey: "otr_source_key" });
const target = new FoxReach({ apiKey: "otr_target_key" });
const created = await target.campaigns.importCampaign(await source.campaigns.export("cmp_abc123"), { name: "Q1 outreach copy" });
```

**Response example**

```json
{
  "data": {
    "id": "cmp_def456",
    "name": "Q1 outreach copy",
    "status": "draft",
    "timezone": "America/New_York",
    "dailyLimit": 50
  }
}
```

## Request document

```json
{
  "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: `write` |
| `413` | The request body is larger than 2 MB |
| `422` | The document is not valid: unknown field, unsupported version, invalid value or invalid spin syntax |

## Rate Limit

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