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

# Reserve an upload

> Reserve a slot for a campaign's contacts file and get the link to upload it to: the first step of creating a campaign.

Reserves a slot for one contacts file and answers with where to upload it. Upload the file there, then [create the campaign](https://docs.verbeo.ai/api-reference/campaign/create.md) with the slot's `import.id`. Nothing is created before that, so an upload that fails leaves no campaign behind.

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

**file\_name** `string` *required*

Your name for the file, 1 to 255 characters. It is shown with the campaign; the file is stored under a name Verbeo chooses.

**file\_size** `number` *required*

The file's size in bytes, from `1` to `52428800` (50 MB). `wc -c < contacts.ndjson` prints it. Once the campaign is created, the size it holds is the one stored.

**contact\_count** `number`

How many contacts the file holds, from `1` to `100000`. It is shown as the import's `expected_count` until Verbeo has counted the lines.

## Request

```bash theme={null}
curl -X POST "https://api.verbeo.ai/v2/campaign/imports" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{ "file_name": "contacts.ndjson", "file_size": 164, "contact_count": 2 }'
```

## Response

`201 Created`: the upload's [import object](https://docs.verbeo.ai/api-reference/campaign/overview.md#the-import-object), and where to send the file.

```json theme={null}
{
  "success": true,
  "data": {
    "import": {
      "id": "9b2f5c1e-4d3a-4e8b-a1f0-6c7d8e9f0a1b",
      "status": "uploading",
      "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-02T08:58:30.000123+00:00"
    },
    "upload": {
      "signed_url": "https://…/storage/v1/object/upload/sign/campaign-imports/123e4567-e89b-12d3-a456-426614174000/9b2f5c1e-4d3a-4e8b-a1f0-6c7d8e9f0a1b.ndjson?token=eyJhbGciOi…",
      "resumable_url": "https://…/storage/v1/upload/resumable/sign",
      "token": "eyJhbGciOi…",
      "bucket": "campaign-imports",
      "path": "123e4567-e89b-12d3-a456-426614174000/9b2f5c1e-4d3a-4e8b-a1f0-6c7d8e9f0a1b.ndjson",
      "content_type": "application/x-ndjson",
      "expires_at": "2026-11-02T10:58:30.000Z"
    }
  }
}
```

**import.id** `string` *required*

The `import_id` to [create the campaign](https://docs.verbeo.ai/api-reference/campaign/create.md) with.

**upload.signed\_url** `string` *required*

Where to upload the whole file with one `PUT`. Use it exactly as given.

**upload.content\_type** `string` *required*

Always `application/x-ndjson`: the `Content-Type` to upload with.

**upload.expires\_at** `string` *required*

When the link stops working, 2 hours after the reserve. Create the campaign before then.

**upload.resumable\_url** `string` *required*

For a resumable (TUS) upload, the way the dashboard sends the file: in 6 MB pieces, with `upload.token` as the `x-signature` header, and `bucketName`, `objectName` and `contentType` set to `upload.bucket`, `upload.path` and `upload.content_type`.

## Upload the file

```bash theme={null}
curl -X PUT "UPLOAD_SIGNED_URL" \
  -H "Content-Type: application/x-ndjson" \
  --data-binary @contacts.ndjson
```

* **Send only the `Content-Type`.** The link goes to Verbeo's file storage, not to `api.verbeo.ai`; the token in it is the credential, so no API key goes with it.
* **A `2xx` answer means the file is stored.** The storage takes files of up to 50 MB, of type `application/x-ndjson` only.
* **The format** is on the overview: [The contacts file](https://docs.verbeo.ai/api-reference/campaign/overview.md#the-contacts-file).

> [!WARNING]
>
> Use `--data-binary`. curl's `-d` strips the newlines between the lines, which turns the whole file into one line that is not a contact.

## Errors

| Code | Status | When |
| - | - | - |
| `VALIDATION_FAILED` | 422 | A `file_name` that is empty (`file_name: required`) or longer than 255 characters (`file_name: must be at most 255 characters`). A `file_size` below 1 byte (`file_size: must be at least 1 byte`), not whole (`file_size: must be a whole number of bytes`) or over 50 MB (`file_size: must be at most 50 MB (52,428,800 bytes)`). A `contact_count` below 1 (`contact_count: must be at least 1`), not whole (`contact_count: must be a whole number`) or over the limit (`contact_count: must be at most 100,000`). |
| `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: `Uploading a contacts file requires the developer, admin or owner role`. An API key acts as the owner and never gets it. |
| `INTERNAL_ERROR` | 500 | `The upload could not be started. Try again in a moment.` The storage gave no link, and nothing is kept. |

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.