For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Book a demoLog in
GuidesAPI ReferenceChangelogModel Versioning
GuidesAPI ReferenceChangelogModel Versioning
    • Getting Started
    • Authentication
    • API Versioning
    • SDKs
    • Deployments
  • Processor Endpoints
    • POSTRun Processor
    • GETGet Processor Run
    • GETList Processor Runs
    • POSTCancel Processor Run
    • DELDelete Processor Run
    • GETGet Batch Processor Run
    • GETList Processors
    • POSTCreate Processor
    • POSTUpdate Processor
    • POSTPublish Processor Version
    • GETGet Processor Version
    • GETList Processor Versions
  • Parse Endpoints
    • POSTParse File
    • POSTParse File Async
    • GETGet Parser Run
    • DELDelete Parser Run
  • Workflow Endpoints
    • POSTRun Workflow
    • GETGet Workflow Run
    • GETList Workflow Runs
    • POSTUpdate Workflow Run
    • POSTCancel Workflow Run
    • DELDelete Workflow Run
    • POSTCreate Workflow
    • POSTBatch Run Workflow
    • POSTCorrect Workflow Run Outputs
  • File Endpoints
    • POSTUpload File
    • GETGet File
    • DELDelete File
    • GETList Files
    • POSTCreate File
  • Edit Endpoints
    • POSTEdit File
    • POSTEdit File Async
    • POSTGenerate Edit Schema
    • GETGet Edit Run
    • DELDelete Edit Run
    • GETGet Edit Template
  • Evaluation Set Endpoints
    • GETGet Evaluation Set
    • GETList Evaluation Sets
    • POSTCreate Evaluation Set
    • GETList Evaluation Set Items
    • POSTCreate Evaluation Set Item
    • POSTUpdate Evaluation Set Item
    • DELDelete Evaluation Set Item
    • POSTBulk Create Evaluation Set Items
LogoLogo
Book a demoLog in
Processor Endpoints

Cancel Processor Run

POST
https://api.extend.ai/processor_runs/:id/cancel
POST
/processor_runs/:id/cancel
1from extend_ai import Extend
2
3client = Extend(
4 token="YOUR_TOKEN_HERE",
5 extend_api_version="2025-04-21",
6)
7
8client.processor_run.cancel(
9 id="processor_run_id_here",
10)
1{
2 "success": true,
3 "processorRun": {
4 "object": "document_processor_run",
5 "id": "dpr_Xj8mK2pL9nR4vT7qY5wZ",
6 "processorId": "dp_Xj8mK2pL9nR4vT7qY5wZ",
7 "processorVersionId": "dpv_Xj8mK2pL9nR4vT7qY5wZ",
8 "processorName": "Invoice Processor",
9 "status": "PENDING",
10 "output": {},
11 "reviewed": false,
12 "edited": false,
13 "edits": {},
14 "type": "CLASSIFY",
15 "config": {
16 "type": "CLASSIFY",
17 "baseProcessor": "classification_performance",
18 "baseVersion": "3.2.0",
19 "classifications": [
20 {
21 "id": "my_unique_id",
22 "type": "invoice",
23 "description": "An invoice is a document that lists the items purchased and the total amount due."
24 }
25 ],
26 "classificationRules": "Remember, when it comes to differentiating between invoices and purchase orders, the most important thing to look for is the date of the document.",
27 "advancedOptions": {
28 "context": "default",
29 "advancedMultimodalEnabled": false,
30 "fixedPageLimit": 30,
31 "pageRanges": [
32 {
33 "start": 1,
34 "end": 10
35 },
36 {
37 "start": 20,
38 "end": 30
39 }
40 ]
41 },
42 "parser": {
43 "target": "markdown",
44 "chunkingStrategy": {
45 "type": "page",
46 "options": {
47 "minCharacters": 100,
48 "maxCharacters": 1000
49 }
50 },
51 "engine": "parse_performance",
52 "blockOptions": {
53 "figures": {
54 "enabled": true,
55 "figureImageClippingEnabled": true
56 },
57 "tables": {
58 "enabled": true,
59 "targetFormat": "markdown",
60 "tableHeaderContinuationEnabled": false,
61 "cellBlocksEnabled": false,
62 "agentic": {
63 "enabled": false,
64 "customInstructions": "string"
65 }
66 },
67 "text": {
68 "signatureDetectionEnabled": true,
69 "agentic": {
70 "enabled": false,
71 "customInstructions": "string"
72 }
73 }
74 },
75 "advancedOptions": {
76 "pageRotationEnabled": true,
77 "agenticOcrEnabled": false,
78 "pageRanges": [
79 {
80 "start": 1,
81 "end": 10
82 },
83 {
84 "start": 20,
85 "end": 30
86 }
87 ],
88 "excelParsingMode": "basic",
89 "excelSkipHiddenContent": false,
90 "excelUseRawCellValues": false,
91 "excelSkipCalculation": true,
92 "verticalGroupingThreshold": 1,
93 "returnOcr": {
94 "words": false
95 },
96 "alwaysConvertToPdf": false
97 }
98 }
99 },
100 "files": [
101 {
102 "object": "file",
103 "id": "file_xK9mLPqRtN3vS8wF5hB2cQ",
104 "name": "Invoices.pdf",
105 "metadata": {
106 "pageCount": 30,
107 "parentSplit": {
108 "id": "string",
109 "type": "Invoice",
110 "identifier": "other_2_9",
111 "startPage": 1,
112 "endPage": 10
113 }
114 },
115 "createdAt": "2024-03-21T15:30:00Z",
116 "updatedAt": "2024-03-21T16:45:00Z",
117 "type": "PDF",
118 "presignedUrl": "https://www.w3.org/WAI/ER/tests/xhtml/testfiles/resources/pdf/dummy.pdf",
119 "parentFileId": "file_Zk9mNP12Qw4yTv8BdR3H",
120 "contents": {
121 "rawText": "string",
122 "markdown": "string",
123 "pages": [
124 {
125 "pageNumber": 1,
126 "pageHeight": 10,
127 "pageWidth": 10,
128 "rawText": "This is the raw text of the page.",
129 "markdown": "# Heading\n\nThis is a paragraph with **bold** and *italic* text.\n\n- List item 1\n- List item 2\n\n> This is a blockquote",
130 "html": "<div>This is the html of the page.</div>"
131 }
132 ],
133 "sheets": [
134 {
135 "sheetName": "Sheet1",
136 "rawText": "This is the raw text of the sheet."
137 }
138 ]
139 },
140 "usage": {
141 "credits": 10
142 }
143 }
144 ],
145 "mergedProcessors": [
146 {
147 "processorId": "dp_Xj8mK2pL9nR4vT7qY5wZ",
148 "processorVersionId": "dpv_Xj8mK2pL9nR4vT7qY5wZ",
149 "processorName": "Invoice Line Items Processor"
150 }
151 ],
152 "url": "https://dashboard.extend.ai/runs/dpr_Xj8mK2pL9nR4vT7qY5wZ",
153 "failureReason": "string",
154 "failureMessage": "string",
155 "metadata": {},
156 "initialOutput": {},
157 "reviewedOutput": {},
158 "usage": {
159 "credits": 3.5
160 }
161 }
162}

Cancel a running processor run by its ID. This endpoint allows you to stop a processor run that is currently in progress.

Note: Only processor runs with a status of "PROCESSING" can be cancelled. Processor runs that have already completed, failed, or been cancelled cannot be cancelled again.

Was this page helpful?
Previous

Delete Processor Run

Next
Built with

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

idstringRequired

The unique identifier for the processor run to cancel.

Example: "dpr_Xj8mK2pL9nR4vT7qY5wZ"

Headers

x-extend-api-version"2025-04-21"OptionalDefaults to 2025-04-21

API version to use for the request. If you do not specify a version, you will either receive a 400 Bad Request or be set to a previous legacy version. See API Versioning for more details.

x-extend-workspace-idstringOptional

The workspace ID to target. Required when using an organization-scoped API key; optional for workspace-scoped keys (the key is already tied to a workspace). See Authentication for details on API key scopes.

Response

Successfully cancelled processor run
successboolean
processorRunobject

Errors

400
Bad Request Error
401
Unauthorized Error
404
Not Found Error