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.
GuidesAPI ReferenceChangelogModel Versioning
GuidesAPI ReferenceChangelogModel Versioning
    • Getting Started
    • Authentication
    • API Versioning
    • SDKs
    • Deployments
    • Error Codes
    • Async Processing
  • Endpoints
      • POSTClassify File (Sync)
      • POSTClassify File (Async)
      • GETGet Classify Run
      • POSTCancel Classify Run
      • DELDelete Classify Run
      • GETList Classify Runs
      • POSTCreate Classifier
      • GETGet Classifier
      • POSTUpdate Classifier
      • GETList Classifiers
      • POSTCreate Classifier Version
      • GETGet Classifier Version
      • GETList Classifier Versions
  • Webhook Events
LogoLogo
EndpointsClassify

Cancel Classify Run

POST
/classify_runs/:id/cancel
POST
/classify_runs/:id/cancel
1import { ExtendClient } from "extend-ai";
2
3const client = new ExtendClient({ token: "YOUR_TOKEN" });
4await client.classifyRuns.cancel("classify_run_id_here");
1{
2 "object": "classify_run",
3 "id": "clr_Xj8mK2pL9nR4vT7qY5wZ",
4 "status": "PROCESSING",
5 "output": {
6 "id": "string",
7 "type": "string",
8 "confidence": 1.1,
9 "insights": [
10 {
11 "type": "reasoning",
12 "content": "string"
13 }
14 ]
15 },
16 "classifier": {
17 "object": "classifier",
18 "id": "cl_Xj8mK2pL9nR4vT7qY5wZ",
19 "name": "Document Type Classifier",
20 "createdAt": "2024-03-21T16:45:00Z",
21 "updatedAt": "2024-03-21T16:45:00Z"
22 },
23 "classifierVersion": {
24 "object": "classifier_version",
25 "id": "clv_xK9mLPqRtN3vS8wF5hB2cQ",
26 "description": "Added new document types for Q4 processing",
27 "version": "draft",
28 "classifierId": "cl_Xj8mK2pL9nR4vT7qY5wZ",
29 "createdAt": "2024-03-21T16:45:00Z"
30 },
31 "initialOutput": {
32 "id": "string",
33 "type": "string",
34 "confidence": 1.1,
35 "insights": [
36 {
37 "type": "reasoning",
38 "content": "string"
39 }
40 ]
41 },
42 "reviewedOutput": {
43 "id": "string",
44 "type": "string",
45 "confidence": 1.1,
46 "insights": [
47 {
48 "type": "reasoning",
49 "content": "string"
50 }
51 ]
52 },
53 "failureReason": "PARSING_ERROR",
54 "failureMessage": "string",
55 "metadata": {},
56 "reviewed": false,
57 "edited": false,
58 "config": {
59 "classifications": [
60 {
61 "id": "my_unique_id",
62 "type": "invoice",
63 "description": "An invoice is a document that lists the items purchased and the total amount due."
64 }
65 ],
66 "baseProcessor": "classification_performance",
67 "baseVersion": "3.2.0",
68 "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.",
69 "advancedOptions": {
70 "context": "default",
71 "advancedMultimodalEnabled": true,
72 "memoryEnabled": false,
73 "pageRanges": [
74 {
75 "start": 1,
76 "end": 10
77 },
78 {
79 "start": 20,
80 "end": 30
81 }
82 ]
83 },
84 "parseConfig": {
85 "target": "markdown",
86 "chunkingStrategy": {
87 "type": "page",
88 "options": {
89 "minCharacters": 500,
90 "maxCharacters": 10000
91 }
92 },
93 "engine": "parse_performance",
94 "engineVersion": "latest",
95 "blockOptions": {
96 "figures": {
97 "enabled": true,
98 "figureImageClippingEnabled": true,
99 "advancedChartExtractionEnabled": false
100 },
101 "tables": {
102 "targetFormat": "html",
103 "tableHeaderContinuationEnabled": false,
104 "cellBlocksEnabled": false,
105 "agentic": {
106 "enabled": false,
107 "customInstructions": "string"
108 },
109 "enabled": true
110 },
111 "text": {
112 "signatureDetectionEnabled": false,
113 "agentic": {
114 "enabled": false,
115 "customInstructions": "string"
116 }
117 },
118 "keyValue": {
119 "blankFieldFormattingEnabled": false
120 },
121 "barcodes": {
122 "imageClippingEnabled": false,
123 "readingEnabled": false
124 },
125 "formulas": {
126 "enabled": false
127 }
128 },
129 "advancedOptions": {
130 "pageRotationEnabled": true,
131 "pageRanges": [
132 {
133 "start": 1,
134 "end": 10
135 },
136 {
137 "start": 20,
138 "end": 30
139 }
140 ],
141 "excelParsingMode": "basic",
142 "excelSkipHiddenContent": false,
143 "excelUseRawCellValues": false,
144 "excelSkipCalculation": true,
145 "verticalGroupingThreshold": 1,
146 "returnOcr": {
147 "words": false
148 },
149 "alwaysConvertToPdf": false,
150 "enrichmentFormat": "xml",
151 "imageConversionQuality": "medium",
152 "formattingDetection": [
153 {
154 "type": "change_tracking"
155 }
156 ]
157 }
158 }
159 },
160 "file": {
161 "object": "file",
162 "id": "file_xK9mLPqRtN3vS8wF5hB2cQ",
163 "name": "Invoices.pdf",
164 "type": "PDF",
165 "parentFileId": "file_Zk9mNP12Qw4yTv8BdR3H",
166 "metadata": {
167 "pageCount": 30,
168 "parentSplit": {
169 "id": "string",
170 "type": "Invoice",
171 "identifier": "other_2_9",
172 "startPage": 1,
173 "endPage": 10
174 }
175 },
176 "createdAt": "2024-03-21T16:45:00Z",
177 "updatedAt": "2024-03-21T16:45:00Z"
178 },
179 "parseRunId": "pr_Xj8mK2pL9nR4vT7qY5wZ",
180 "dashboardUrl": "https://dashboard.extend.ai/runs/clr_Xj8mK2pL9nR4vT7qY5wZ",
181 "usage": {
182 "credits": 9,
183 "totalCredits": 15,
184 "breakdown": [
185 {
186 "object": "parse_run",
187 "id": "pr_3UZSj69pYZDKHFuuX57ic",
188 "credits": 6
189 }
190 ]
191 },
192 "createdAt": "2024-03-21T16:45:00Z",
193 "updatedAt": "2024-03-21T16:45:00Z"
194}

Cancel an in-progress classify run.

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

Was this page helpful?
Previous

Delete Classify Run

Next
Built with

Authentication

AuthorizationBearer

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

Path parameters

idstringRequired

The ID of the classify run to cancel.

Example: "cl_Xj8mK2pL9nR4vT7qY5wZ"

Headers

x-extend-api-version"2026-02-09"Optional
API version to use for the request. If you're using an SDK, you can ignore this parameter. If you are not using an SDK and do not specify a version, you will either receive a `400 Bad Request` or be set to a previous legacy version. See [API Versioning](https://docs.extend.ai/2026-02-09/developers/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](https://docs.extend.ai/2026-02-09/developers/authentication) for details on API key scopes.

Response

Classifier run cancelled successfully
objectenum

The type of object. Will always be "classify_run".

Allowed values:
idstring

The unique identifier for this classify run.

Example: "clr_Xj8mK2pL9nR4vT7qY5wZ"

statusenum

The status of a processor run (extract, classify, or split):

  • "PENDING" - The run has been created and is waiting to be processed
  • "PROCESSING" - The run is in progress
  • "PROCESSED" - The run completed successfully
  • "FAILED" - The run failed
  • "CANCELLED" - The run was cancelled
Allowed values:
outputobject or null

The final output, either reviewed or initial.

Availability: Present when status is "PROCESSED".

classifierobject or null

The classifier that was used for this run.

Availability: Present when a classifier reference was provided. Not present when using inline config.

classifierVersionobject or null

The version of the classifier that was used for this run.

Availability: Present when a classifier reference was provided. Not present when using inline config.

initialOutputobject or null

The initial output from the classify run, before any review edits.

Availability: Present when reviewed is true.

reviewedOutputobject or null

The output after human review.

Availability: Present when reviewed is true.

failureReasonstring or null

The reason for failure.

Availability: Present when status is "FAILED".

Possible values include:

  • ABORTED - The run was aborted by the user
  • INTERNAL_ERROR - An unexpected internal error occurred
  • FAILED_TO_PROCESS_FILE - Failed to process the file (e.g., OCR failure, file access issues)
  • INVALID_PROCESSOR - The processor configuration is invalid
  • INVALID_CONFIGURATION - The provided configuration is incompatible with the selected model
  • PARSING_ERROR - Failed to parse the classification output
  • PRE_PROCESSING_FAILURE - An error occurred during preprocessing
  • POST_PROCESSING_FAILURE - An error occurred during postprocessing
  • OUT_OF_CREDITS - Insufficient credits to run the classification

Note: Additional failure reasons may be added in the future. Your integration should handle unknown values gracefully.

failureMessagestring or null

A detailed message about the failure.

Availability: Present when status is "FAILED".

metadatamap from strings to any or null

Any metadata that was provided when creating the classify run.

Availability: Present when metadata was provided during creation.

reviewedboolean
Indicates whether the run has been reviewed by a human.
editedboolean
Indicates whether the run results have been edited during review.
configobject
The configuration used for this classify run.
fileobject
The file that was processed.
parseRunIdstring or null

The ID of the parse run that was used for this classify run.

Availability: Present when a parse run was created.

dashboardUrlstring
The URL to view the classify run in the Extend dashboard.
usageobject or null

Usage credits consumed by this classify run.

Availability: Present when status is "PROCESSED". Will not be returned for runs created before October 7, 2025 or for customers on legacy billing systems.

createdAtstringformat: "date-time"

The time (in UTC) at which the object was created. Will follow the RFC 3339 format.

Example: "2024-03-21T16:45:00Z"

updatedAtstringformat: "date-time"

The time (in UTC) at which the object was last updated. Will follow the RFC 3339 format.

Example: "2024-03-21T16:45:00Z"

Errors

400
Bad Request Error
401
Unauthorized Error
402
Payment Required Error
403
Forbidden Error
404
Not Found Error
422
Unprocessable Entity Error
429
Too Many Requests Error
500
Internal Server Error

API version to use for the request. If you’re using an SDK, you can ignore this parameter. If you are not using an SDK and 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.

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.