---
title: "Archive a migration"
method: DELETE
path: "/migrations/{migration_id}"
tags: ["Migrations"]
---

# Archive a migration

`DELETE /migrations/{migration_id}`

## Request

- Base URL: `https://app.vern.so/api/v1`
- URL: `https://app.vern.so/api/v1/migrations/{migration_id}`
- Auth: API key in header `x-api-key`
- TypeScript: <https://skmtc.dev/vern-so/apis/vern-api/docs/migrations/:migration_id/delete.ts> (a function with typed inputs; its response is checked against the schema)

Archives the migration, like Archive in the app — nothing is deleted. It drops out of `GET /migrations` (unless `include_archived=true`), stays readable and exportable, and every call that changes it (uploads, runs, answers, credentials, knowledge, the source connection, cancelling, PATCH) returns 409 with `code: migration_archived`. Restore it from the Archived page in Vern. Refused with 409 (`code: imports_in_flight`) while an import is in progress, including a preview waiting for approval — cancel the listed runs first. Archiving an archived migration is a no-op.

## Response `200`

The archived migration (`archived: true`).

- object
  - `migration` Migration
    - `id` string, uuid: The migration ID — pass it to every later call.
    - `name` string
    - `external_id` string, nullable: Your own identifier for this customer.
    - `source` string, nullable
    - `status` 'awaiting_files' | 'ready' | 'awaiting_approval' | 'completed': Omitted from `GET /migrations` list items.
    - `templates` object[]
      - `slug` string
      - `name` string
    - `archived` boolean: Archived migrations stay readable and exportable but refuse uploads, runs and edits. Restore one from the Archived page in Vern.
    - `created_at` string, date-time
    - `url` string, uri: Opens the company in Vern. `/companies/open/{key}` also accepts the `external_id`.

## Other responses

- `401`: API key missing, malformed, or revoked.
- `404`: No migration with this id in your organisation. Returned rather than `403` so the existence of another organisation's migration is not disclosed.
- `409`: An import is in progress (`code: imports_in_flight`). `runs` lists the runs to cancel or wait for.
- `429`: Rate limit hit. Counted per account (company), not per API key or IP. Each endpoint is in one class: reads 30/minute, writes 30/minute, jobs (starting an export) 15/hour, agent (starting a run, answering, submitting credentials) 30/hour. Creating a migration and starting a `generate` run also have their own 30/hour caps. A separate per-IP ceiling absorbs floods before authentication. `Retry-After` gives the seconds until the window resets, alongside `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`.
- `500`: Unexpected server error.

## Changes

- **2026-11-08** `0ae6ef5f1887`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/vern-so/apis/vern-api/changes/migrations/:migration_id/delete.md)

---

[API](https://skmtc.dev/vern-so/apis/vern-api.md) - [All operations](https://skmtc.dev/vern-so/apis/vern-api/llms.txt) - [OpenAPI document](https://skmtc.dev/vern-so/apis/vern-api/revisions/0ae6ef5f1887?raw)
