Cancel Job
Cancel a pending or processing extraction job with POST /v1/jobs/:id/cancel. The job is marked failed, and rows processed before cancellation stay readable.
POST /v1/jobs/:id/cancel cancels a running extraction job that is currently pending or processing. The job is immediately marked as failed with an error message indicating it was cancelled via the API. Any results that were already processed are preserved and can still be retrieved via the results endpoint.
409 conflict error. Already-completed or already-failed jobs cannot be cancelled./v1/jobs/:id/cancelRequest
Response
Response fields
Response
{
"id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"name": "Q4 Invoice Run",
"status": "failed",
"progress": null,
"estimated_seconds_remaining": null,
"schema": { "id": "sch_uuid_1", "name": "Invoice" },
"document_count": 48,
"completed_documents": 12,
"grid_stats": null,
"current_phase": null,
"error": {
"code": "job_failed",
"message": "Cancelled via API"
},
"created_at": "2024-09-14T10:32:00.000Z",
"started_at": "2024-09-14T10:32:05.000Z",
"completed_at": "2024-09-14T10:33:10.000Z",
"links": {
"self": "/v1/jobs/a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"dashboard": "https://app.talonic.com/jobs/a1b2c3d4-e5f6-7890-abcd-ef1234567890"
}
}Pair this with GET /v1/jobs/:id/results to retrieve any rows that were processed before cancellation. The completed_documents field in the response tells you how many documents finished before the job was stopped, so you can decide whether the partial results are usable or if a new job is needed.
Errors
Error responses