---
title: "Cancel an unfinished import of any organization: the customer's own cancel path (temporary access and copies are cleaned up), audited with the admin as actor; an import that already ended is a replay"
method: POST
path: "/operator/migrations/{migrationId}/cancel"
tags: ["Operator"]
---

# Cancel an unfinished import of any organization: the customer's own cancel path (temporary access and copies are cleaned up), audited with the admin as actor; an import that already ended is a replay

`POST /operator/migrations/{migrationId}/cancel`

## Request

- Base URL: `https://hostingsurge.com/api/v1`
- URL: `https://hostingsurge.com/api/v1/operator/migrations/{migrationId}/cancel`
- Auth: one of:
  - HTTP bearer
  - API key in cookie `__Host-hs_session`

## Path parameters

- `migrationId` string, uuid, required

## Request body

- object
  - `reason` string, required: required: shown in the audit log verbatim

## Response `200`

Canceled, or the cancel requested from the running step

- object
  - `status` 'ok', required
  - `state` string, required
  - `cancelRequested` boolean, required
  - `replay` boolean, required: true when the import had already ended: nothing changed

## Other responses

- `400`: Invalid request (code invalid_request)
- `403`: An action on an operator-console session older than 5 minutes (code forbidden, details.reauthenticate: sign in again at /admin/login), or an operator removed since the session was resolved
- `404`: Not found (code not_found); also the answer to any request without a live operator-console session (no admin cookie, a dashboard session, an API/MCP key or OAuth token, or a caller who is not a platform operator)
- `429`: Too many requests (code rate_limited); see Retry-After
- `501`: Not available on this server (code not_configured)

---

[API](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api.md) · [All operations](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/llms.txt) · [OpenAPI document](https://skmtc.dev/hostingsurge/apis/hostingsurge-platform-api/revisions/4d08337cdff1?raw)
