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

# Create a migration

> Create an isolated migration workspace for one customer — a workbook with one sheet per template.

```http theme={null}
POST https://app.vern.so/api/v1/migrations
```

Creates a **migration** for one of your customers — a workbook with one sheet per
template. You can name the system you're migrating from in the `source` field,
but **no import logic is bound** to the migration: the
[managed agent](https://docs.vern.so/migration-api/concepts.md#the-managed-agent) decides what to run.
Later calls reference only the migration ID.

A new migration starts in `awaiting_files` — your next step is to give it data,
either by [uploading files](https://docs.vern.so/migration-api/upload-files.md) or by
[connecting a live source](https://docs.vern.so/migration-api/source-connection.md).

## Authentication

Requires an `x-api-key` header — this endpoint requires **API-key auth
specifically** (a session token is rejected). The key is scoped to your account
and can address every migration in it. See [Authentication](https://docs.vern.so/migration-api/authentication.md).

## Request body

**name** `string` *required*

Display name for the migration. Typically your customer's organization name.

**source** `string`

The **name** of the source this migration comes from — the system its data is
coming out of. [List your sources](https://docs.vern.so/migration-api/list-sources.md) to find it.
**Optional**: omit it (or pass `null`/empty) for a **sourceless** migration,
where the agent works purely from the uploaded files.

**external\_id** `string`

Your own identifier for this customer (e.g. their ID in your database). Echoed
back so you can match the migration to your records. Max 255 characters;
alphanumeric, hyphens, and underscores only. Makes creation **idempotent** —
re-sending the same `external_id` (with the same source) returns the existing
migration with a `200`, unchanged (to change it, use
[`PATCH /migrations/{id}`](https://docs.vern.so/migration-api/manage-migrations#update-a-migration)).
If that existing migration is archived you get `409` with
`code: "migration_archived"` and its `id` instead. See
[Errors & limits](https://docs.vern.so/migration-api/errors.md#idempotency).

**templates** `string[]`

The **slugs** of the templates to create sheets from — the objects this customer
will import. [List your templates](https://docs.vern.so/migration-api/list-templates.md) to choose. If
omitted, **every active template in your account** is used.

## Response

`201 Created` (or `200 OK` when an existing migration is returned via
`external_id` idempotency).

```json theme={null}
{
  "migration": {
    "id": "c0a8012e-4f1b-4d3a-9b2c-7e6f5a4b3c2d",
    "name": "Acme Corp",
    "external_id": "acme-001",
    "source": "Salesforce",
    "status": "awaiting_files",
    "templates": [
      { "slug": "contacts", "name": "Contacts" }
    ],
    "archived": false,
    "created_at": "2026-06-19T15:29:40.000Z",
    "url": "https://app.vern.so/companies/open/c0a8012e-4f1b-4d3a-9b2c-7e6f5a4b3c2d"
  }
}
```

**migration.id** `string (uuid)`

The migration ID — pass it to every run and export call.

**migration.name** `string`

The display name you provided.

**migration.external\_id** `string | null`

Your `external_id`, or `null` if you didn't send one.

**migration.source** `string | null`

The source name, or `null` for a sourceless migration.

**migration.status** `string`

The migration's overall state. `awaiting_files` for a fresh migration; for one
returned via idempotency it reflects progress so far (`awaiting_files`, `ready`,
`awaiting_approval`, or `completed`). See
[Core concepts → Migration](https://docs.vern.so/migration-api/concepts.md#migration-the-instance).

**migration.templates** `object[]`

The templates that became sheets, each `{ slug, name }`.

**migration.archived** `boolean`

Always `false` for a new migration. See
[Archive a migration](https://docs.vern.so/migration-api/manage-migrations.md#archive-a-migration).

**migration.created\_at** `string (date-time)`

When the migration was created.

**migration.url** `string`

Opens the migration's company page in the Vern app.

## Errors

| Status | Meaning |
| - | - |
| `400` | `name` missing; `source` not a string; `external_id` malformed; `templates` not an array of slugs; one or more template slugs not found (`Unknown template slug(s): …`). |
| `401` | API key missing or invalid, or the request used a session token instead of an API key. |
| `403` | Your account has no active plan. See [Plans](https://docs.vern.so/migration-api/errors.md#plans). |
| `404` | The named `source` isn't a source in your account. |
| `409` | `external_id` already used by another migration (under a different source), the migration it names is archived (`code: "migration_archived"`, with its `id`), the source name is ambiguous (two sources share it), or your account's region isn't live yet. |
| `429` | **Limited to 30 migrations per hour** per account. Check `Retry-After`. See [Rate limits](https://docs.vern.so/migration-api/errors.md#rate-limits). |
| `500` | Server error. |

See [Errors & limits](https://docs.vern.so/migration-api/errors.md) for the shared error model.

## Example

```bash theme={null}
curl -X POST https://app.vern.so/api/v1/migrations \
  -H "x-api-key: $VERN_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Acme Corp",
    "source": "Salesforce",
    "external_id": "acme-001",
    "templates": ["contacts"]
  }'
```

## Next

* [Manage migrations](https://docs.vern.so/migration-api/manage-migrations.md) — list, read, update and archive migrations.
* [Upload files](https://docs.vern.so/migration-api/upload-files.md) — push the customer's data into the migration.
* [Connect a live source](https://docs.vern.so/migration-api/source-connection.md) — extract from an API instead of files.
* [Start a run](https://docs.vern.so/migration-api/start-a-run.md) — generate a preview once data is in place.


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