> ## Documentation Index
> Fetch the complete documentation index at: https://docs.verbeo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Create campaign

> Create a campaign from a contacts file you uploaded: the assistant, the number to call from, retries, an optional start time and business hours. It is a draft until its contacts are imported.

Creates a campaign with the contacts file you [uploaded](https://docs.verbeo.ai/api-reference/campaign/reserve-import.md) to `import_id`. Verbeo then imports the file in the background: follow it with [Get campaign](https://docs.verbeo.ai/api-reference/campaign/get.md).

The campaign is a `draft` until the import is done. Then you [start](https://docs.verbeo.ai/api-reference/campaign/start.md) it, or, if you gave it a `scheduled_at`, it becomes `scheduled` and starts at that time on its own.

**Who may call it:** any API key of the workspace; in the dashboard, an owner, admin or developer. The workspace needs the [Pro plan](https://docs.verbeo.ai/api-reference/campaign/overview.md#who-may-do-what).

## Body

**import\_id** `string` *required*

The `import.id` that [Reserve an upload](https://docs.verbeo.ai/api-reference/campaign/reserve-import.md) answered, once its file has finished uploading. One upload makes one campaign.

**campaign\_name** `string` *required*

Display name, 1 to 255 characters.

**agent\_id** `string` *required*

UUID of the [assistant](https://docs.verbeo.ai/api-reference/assistants/overview.md) that places every call. It must be your workspace's.

**phone\_number\_id** `string` *required*

UUID of the [phone number](https://docs.verbeo.ai/api-reference/phone-numbers/overview.md) the calls come from: the caller ID. It must be your workspace's.

**max\_retries** `number` (default: 0)

How many more times to call a contact that was not reached, from `0` to `6`. `2` means up to 3 calls in all. A contact is called again after no answer, voicemail, or a dial that failed or never connected; never after a call that was answered, declined or busy.

**retry\_intervals** `number[]` (default: \[])

Minutes to wait before each retry, the first retry first: each from `1` to `10080` (7 days), and no more of them than `max_retries`. A retry with no interval of its own waits 5 minutes. A retry that falls outside `business_hours` waits for the next window.

**scheduled\_at** `string | null`

When to start, as an ISO 8601 date and time with its offset: `2026-11-02T14:00:00Z`, or `2026-11-02T09:00:00-05:00` for the same moment. The campaign becomes `scheduled` once its import is done and starts at this time. Leave it out to [start](https://docs.verbeo.ai/api-reference/campaign/start.md) the campaign yourself.

**business\_hours** `object | null`

When calls may be placed. Leave it out, or send `null`, for any time. Outside these hours a running campaign goes `dormant` and wakes on its own when the next window opens.

**business\_hours properties**

**tz** `string` *required*

IANA time zone, e.g. `"America/New_York"`.

**days** `number[]` *required*

The weekdays calls may be placed on: `1` = Monday … `7` = Sunday. At least one. They are stored sorted, each once.

**windows** `object[]` *required*

One or more daily windows, each `{ "start", "end" }` in **minutes since local midnight**, `0 ≤ start < end ≤ 1440`: `{ "start": 540, "end": 1020 }` is 9:00 AM to 5:00 PM. Windows may not overlap, and none may cross midnight: split one into two windows on adjacent days.

**default\_country** `string | null`

A two-letter ISO 3166-1 country code in capitals, e.g. `"US"`, stored with the campaign: the dashboard keeps here the country it read numbers without a country code in. The import does not use it: every number in your file must already be in +E.164.

## Request

```bash theme={null}
curl -X POST "https://api.verbeo.ai/v2/campaign" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "import_id": "9b2f5c1e-4d3a-4e8b-a1f0-6c7d8e9f0a1b",
    "campaign_name": "Spring renewals",
    "agent_id": "550e8400-e29b-41d4-a716-446655440000",
    "phone_number_id": "7d9f3b52-4c1e-4a8e-9b1a-2f6c0d4e8a11",
    "max_retries": 2,
    "retry_intervals": [30, 120],
    "scheduled_at": "2026-11-02T14:00:00Z",
    "business_hours": {
      "tz": "America/New_York",
      "days": [1, 2, 3, 4, 5],
      "windows": [{ "start": 540, "end": 1020 }]
    }
  }'
```

## Response

`201 Created` with the [campaign object](https://docs.verbeo.ai/api-reference/campaign/overview.md#the-campaign-object): a `draft` with no contacts yet, its import `queued` (or already `importing`, when Verbeo picked it up at once).

```json theme={null}
{
  "success": true,
  "data": {
    "id": "0175091d-2c3b-4aef-8c45-dbbe24f7b3ff",
    "campaign_name": "Spring renewals",
    "status": "draft",
    "total_contacts": 0,
    "max_retries": 2,
    "retry_intervals": [30, 120],
    "scheduled_at": "2026-11-02T14:00:00+00:00",
    "business_hours": {
      "tz": "America/New_York",
      "days": [1, 2, 3, 4, 5],
      "windows": [{ "start": 540, "end": 1020 }]
    },
    "import": {
      "id": "9b2f5c1e-4d3a-4e8b-a1f0-6c7d8e9f0a1b",
      "status": "queued",
      "file_name": "contacts.ndjson",
      "file_size": 164,
      "expected_count": 2,
      "total_lines": null,
      "lines_read": 0,
      "contacts_added": 0,
      "rows_skipped": 0,
      "skipped": [],
      "error_message": null,
      "attempts": 0,
      "created_at": "2026-11-02T08:58:30.000123+00:00",
      "updated_at": "2026-11-02T09:00:00.123456+00:00"
    },
    "…": "the rest of the campaign object"
  }
}
```

A refusal creates nothing, and the upload stays yours: fix the request and send it again with the same `import_id` before the upload expires. A refusal about the file itself (empty, too large, already used, expired) needs a new upload.

## Errors

| Code | Status | When |
| - | - | - |
| `VALIDATION_FAILED` | 422 | A field breaks its rule. The message names the first, for example `campaign_name: required`, `max_retries: must be at most 6`, `retry_intervals: must have at most max_retries intervals`, `retry_intervals.0: must be at least 1 minute`, `retry_intervals.0: must be at most 10,080 minutes (7 days)`, `scheduled_at: must be an ISO 8601 date and time, e.g. 2026-11-02T09:30:00Z`, `default_country: must be a two-letter country code in capitals, e.g. US`. |
| `VALIDATION_FAILED` | 422 | `business_hours` that do not hold up: the first problem, for example `business_hours: Pick at least one day for the campaign to run.`, `business_hours: Add at least one time window.`, `business_hours: "Nowhere/Land" is not a valid timezone.` |
| `VALIDATION_FAILED` | 422 | `agent_id: no agent with this id in the workspace`, or `phone_number_id: no phone number with this id in the workspace`. |
| `VALIDATION_FAILED` | 422 | `import_id: no upload with this id in the workspace`. |
| `VALIDATION_FAILED` | 422 | The uploaded file cannot be used: `The contacts file is empty.`, or `The contacts file is over 50 MB.` Reserve again and upload a new file. |
| `CONFLICT` | 409 | `The contacts file has not finished uploading. Finish the upload, then create the campaign.` |
| `CONFLICT` | 409 | `This upload already belongs to a campaign. Upload the file again to create another one.` |
| `CONFLICT` | 409 | `The upload expired before the campaign was created. Upload the file again.` |
| `PAYMENT_REQUIRED` | 402 | `Campaigns are a Pro feature. Upgrade this workspace to the Pro plan to create or start a campaign.` |
| `FORBIDDEN` | 403 | A dashboard member below developer: `Creating a campaign requires the developer, admin or owner role`. An API key acts as the owner and never gets it. |

And the [errors every route can give](https://docs.verbeo.ai/api-reference/campaign/overview.md#errors-every-route-can-give).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.