Cancel Pipeline
Stop a running document processing pipeline: no new work starts, documents still in flight are marked cancelled, finished documents keep their results, and the run stays available for new submissions.
POST /v1/pipelines/{id}/cancel stops a running pipeline. From the moment the call returns, no new phase starts for any of its documents; documents that were still mid-phase finish their current step and are then marked cancelled; documents that had already completed keep their results and stay readable through GET /v1/pipelines/{id}/results. The run's status becomes cancelled, and every live POST /v1/run request attached to the pipeline is cancelled with it (each receives its own run.cancelled webhook).
A cancel is not a delete. Nothing is removed, and the pipeline keeps accepting work afterwards: a new /v1/run submission in append mode, POST /v1/pipelines/{id}/rerun, or adding documents reopens it exactly like a completed run. Cancelling stops further spend; it does not refund calls that were already made.
The call is idempotent. Cancelling a run that is already completed, cancelled, or archived returns 200 with already: true and changes nothing, so a retrying client never fails on its own success. Requires an API key with the write scope.
documents.cancelled count is final once status reads cancelled; poll GET /v1/pipelines/{id}/progress to watch the last documents drain./v1/pipelines/{id}/cancelBody parameters
Request
curl -X POST https://api.talonic.com/v1/pipelines/a1b2c3d4-e5f6-7890-abcd-ef1234567890/cancel \
-H "Authorization: Bearer $TALONIC_API_KEY" \
-H "Content-Type: application/json" \
-d '{"reason": "wrong Spec version"}'Response
Response fields
Response
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"status": "cancelled",
"already": false,
"cancelled_at": "2026-08-28T10:15:00.000Z",
"documents": { "total": 120, "completed": 83, "cancelled": 37, "errored": 0 },
"run_requests": ["9f3c1e2a-0b7d-4c8e-9a1f-2d3e4f5a6b7c"],
"jobs": { "removed": 37, "failed": 0, "scanned": 412, "scan_capped": false, "timed_out": false }
}Errors
Error responses