---
title: "Cancel a running operation"
method: POST
path: "/api/recovery/operations/{id}/cancel"
tags: ["Recovery"]
---

# Cancel a running operation

`POST /api/recovery/operations/{id}/cancel`

## Request

- Base URL: `https://localhost:1852`
- URL: `https://localhost:1852/api/recovery/operations/{id}/cancel`
- Auth: HTTP bearer

Asks a running operation to stop. A capture settles its point as failed before it
settles the operation. A repository provisioning operation is refused as an
invalid request (`reason: not_cancellable`), because a half-provisioned repository
is settled by the next provisioning attempt. Access is checked first: a caller who
may not configure the repository gets 403, and an unknown id answers 403 to a caller
who cannot cancel every kind of operation.
Only a Full Admin API token may call it; any other scope is refused with `403 SCOPE_DENIED`.

## Path parameters

- `id` string, required

## Headers

- `x-node-id` integer

## Response `202`

Cancellation requested.

- object
  - `operation` RecoveryOperation, required
    - `id` string, uuid, required
    - `idempotencyKey` string, required: Caller-supplied key. A replay of the same key answers the same operation.
    - `kind` 'create_point' | 'verify_point' | 'restore' | 'repository_init', required
    - `storageId` string, nullable, required
    - `pointId` string, nullable, required
    - `actor` string, required
    - `transport` 'local' | 'node_proxy' | 'pilot_tunnel', required
    - `state` 'queued' | 'running' | 'succeeded' | 'partial' | 'failed' | 'cancelled' | 'completion_unknown', required: `completion_unknown` means the process was lost mid-operation. It is never success and is never retried silently.
    - `errorClass` 'invalid_request' | 'permission_denied' | 'capability_unavailable' | 'update_required' | 'schema_unsupported' | 'identity_unknown' | 'lock_held' | 'lock_stale' | 'repository_unavailable' | 'repository_key_unavailable' | 'source_unreadable' | 'integrity_mismatch' | 'attributes_not_restored' | 'interrupted' | 'transport_unreachable' | 'node_refused' | 'node_error' | 'internal' | 'null', nullable, required
    - `errorDetail` string, nullable, required
    - `processEpoch` string, required
    - `createdAt` integer, required
    - `updatedAt` integer, required
    - `completedAt` integer, nullable, required

## Other responses

- `400`: The request is not valid for this storage.
- `401`: Authentication required. Provide a valid Bearer token.
- `403`: The caller lacks the access this recovery action needs. An API token whose scope does not allow the call is refused before the route runs, with `code: SCOPE_DENIED` and no `errorClass`.
- `500`: The recovery operation failed.

## Changes

- **2026-11-02** `1f7572eb735f`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/studio-saelix/apis/sencho-api/changes/api/recovery/operations/:id/cancel/post.md)

---

[API](https://skmtc.dev/studio-saelix/apis/sencho-api.md) - [All operations](https://skmtc.dev/studio-saelix/apis/sencho-api/llms.txt) - [OpenAPI document](https://skmtc.dev/studio-saelix/apis/sencho-api/revisions/1f7572eb735f?raw)
