Cancel an operation

PATCH/operations/{operation_id}

Requests cancellation of an operation. Set cancellation_requested to true and optionally provide a reason.

Cancellation is cooperative: a queued operation is canceled immediately, while a running operation stops between items. Items that have already been processed are not reverted.

Setting cancellation_requested to false has no effect; a cancellation request cannot be withdrawn. Operations that have already reached a terminal status return operation_not_cancelable.

AuthorizationBearer <token>

Autonomous mode: the API credential secret, sent as a bearer token. Credential secrets are identified by a fixed prefix.

In: header

Path Parameters

operation_id*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

application/json

curl -X PATCH "https://example.com/operations/string" \  -H "Content-Type: application/json" \  -d '{    "cancellation_requested": true  }'
{  "data": {    "attempt": {      "number": 0,      "status": "running"    },    "cancellation_requested": true,    "created_at": "2019-08-24T14:15:22Z",    "error": {},    "expires_at": "2019-08-24T14:15:22Z",    "finished_at": "2019-08-24T14:15:22Z",    "id": "string",    "items_url": "string",    "object": "operation",    "progress": {      "done": 0,      "failed": 0,      "total": 0    },    "result_url": "string",    "started_at": "2019-08-24T14:15:22Z",    "status": "queued",    "type": "string"  }}