---
title: "POST /restore-runs/{id}/cancel"
method: POST
path: "/restore-runs/{id}/cancel"
tags: ["Restore"]
---

# POST /restore-runs/{id}/cancel

`POST /restore-runs/{id}/cancel`

## Request

- Base URL: `/api` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/restore-runs/{id}/cancel`
- Auth: HTTP bearer

## Path parameters

- `id` integer, required

## Response `202`

Cancellation recorded (or already recorded); the run stops at its next check and ends as `cancelled`

- RestoreRunView
  - `cancel_requested_at` string, nullable: When cancellation was requested, if it was.
  - `cancellable` boolean, required: Whether `POST /restore-runs/{id}/cancel` would be accepted now.
  - `created_at` string, required
  - `error_message` string, nullable
  - `finished_at` string, nullable
  - `id` integer, required
  - `mode` string, required
  - `not_cancellable_reason` string, nullable: Why the run cannot be cancelled now; `None` when `cancellable`.
  - `phase` string, required
  - `recovery_target` unknown
  - `source_backup` RestoreRunSourceBackup, required: The backup this run restores from, so a client can show and link to it. Always present; its fields are `None` where they are unknown.
    - `backup_id` string, nullable: The backup's UUID, which addresses it in the console and the `/backups/{id}` API. `None` for a raw-location restore, or when the tracked backup has since been deleted.
    - `id` integer, nullable: `backups.id` of a tracked backup. `None` for a restore from a raw S3 location (a backup this instance did not record).
    - `location` string, nullable: Object key or `s3://` URL of the backup.
    - `s3_source_id` integer, nullable: S3 source holding the backup.
    - `taken_at` string, nullable: When the backup was taken (ISO 8601). `None` when unknown.
  - `source_backup_id` integer, nullable
  - `source_service_id` integer, required
  - `started_at` string, nullable
  - `status` string, required
  - `target_service_id` integer, nullable
  - `target_service_name` string, nullable

## Other responses

- `401`: Unauthorized
- `403`: Insufficient permissions
- `404`: Restore run not found
- `409`: Conflict: the run already finished (`restore-not-active`, with `run_status`), or it can no longer be stopped safely (`restore-not-cancellable`, with `phase`): an in-place restore has started writing data, or a new service is being registered

## Changes

- **2026-11-24** `cf1ae7a3fbbb`: 2 breaking
  - the response property `source_backup_id` became nullable for the status `202`
  - the response property `source_backup_id` became optional for the status `202`
- **2026-11-09** `12896146b193`: 4 breaking
  - removed the required property `extensions` from the response with the `401` status
  - removed the required property `extensions` from the response with the `403` status
  - removed the required property `extensions` from the response with the `404` status
  - removed the required property `extensions` from the response with the `409` status
- **2026-10-07** `2e9a6212c4d0`: 1 breaking, 1 info
  - removed the success response with the status `200`
  - added the success response with the status `202`
- **2026-10-07** `ba1c48bc59ad`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/gotempsh/apis/temps/changes/restore-runs/:id/cancel/post.md)

---

[API](https://skmtc.dev/gotempsh/apis/temps.md) - [All operations](https://skmtc.dev/gotempsh/apis/temps/llms.txt) - [OpenAPI document](https://skmtc.dev/gotempsh/apis/temps/revisions/3b040526eb43?raw)
