---
title: "Cancel a running pipeline"
method: POST
path: "/v1/pipelines/{id}/cancel"
tags: ["Pipelines"]
---

# Cancel a running pipeline

`POST /v1/pipelines/{id}/cancel`

## Request

- Base URL: `https://api.talonic.com`
- URL: `https://api.talonic.com/v1/pipelines/{id}/cancel`
- Auth: HTTP bearer

Stops the run: no new phase starts, documents still in flight finish their current step and are marked cancelled, finished documents keep their results, every live /v1/run request on the pipeline is cancelled with it (each gets its own run.cancelled webhook). The pipeline keeps accepting new submissions and reruns afterwards. Requires write scope.

## Path parameters

- `id` string, uuid, required

## Request body

- object
  - `reason` string: Optional free text recorded on the run and carried by the run.cancelled webhook.

## Response `200`

Cancel result (idempotent: `already: true` on a run that was already terminal).

- PipelineCancelResponse
  - `id` string, uuid, required
  - `status` string, required: The run's status after the call: cancelled, or the terminal state it already had.
  - `already` boolean, required: True when the run was already terminal and nothing changed.
  - `cancelled_at` string, date-time, nullable, required
  - `documents` object, required
    - `total` integer
    - `completed` integer
    - `cancelled` integer
    - `errored` integer
  - `run_requests` string[], required: run_ids of the /v1/run requests cancelled along with the pipeline.
  - `jobs` object, required: Best-effort removal of the run's queued jobs (a survivor stops at its next checkpoint).
    - `removed` integer
    - `failed` integer
    - `scanned` integer
    - `scan_capped` boolean
    - `timed_out` boolean
  - `run_id` string, uuid: Present on /v1/run/{id}/cancel: the request that was cancelled.
  - `pipeline_id` string, uuid, nullable: Present on /v1/run/{id}/cancel.

## Other responses

- `401`: Missing or invalid API key.
- `404`: The requested resource was not found.

---

[API](https://skmtc.dev/talonic/apis/talonic-api.md) · [All operations](https://skmtc.dev/talonic/apis/talonic-api/llms.txt) · [OpenAPI document](https://skmtc.dev/talonic/apis/talonic-api/revisions/678fe5f8c9c3?raw)
