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

Create Classifier

POST
/classifiers
POST
/classifiers
1import { ExtendClient } from "extend-ai";
2
3const client = new ExtendClient({ token: "YOUR_TOKEN" });
4await client.classifiers.create({
5 name: "Document Classifier",
6 config: {
7 classifications: [{
8 id: "invoice",
9 type: "invoice",
10 description: "An invoice or bill for goods or services"
11 }, {
12 id: "receipt",
13 type: "receipt",
14 description: "A receipt confirming payment"
15 }, {
16 id: "other",
17 type: "other",
18 description: "Any other document type"
19 }]
20 }
21});
1{
2 "object": "classifier",
3 "id": "cl_Xj8mK2pL9nR4vT7qY5wZ",
4 "name": "Document Type Classifier",
5 "createdAt": "2024-03-21T16:45:00Z",
6 "updatedAt": "2024-03-21T16:45:00Z",
7 "draftVersion": {
8 "object": "classifier_version",
9 "id": "clv_xK9mLPqRtN3vS8wF5hB2cQ",
10 "description": "Added new document types for Q4 processing",
11 "version": "draft",
12 "config": {
13 "classifications": [
14 {
15 "id": "my_unique_id",
16 "type": "invoice",
17 "description": "An invoice is a document that lists the items purchased and the total amount due."
18 }
19 ],
20 "baseProcessor": "classification_performance",
21 "baseVersion": "3.2.0",
22 "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.",
23 "advancedOptions": {
24 "context": "default",
25 "advancedMultimodalEnabled": true,
26 "memoryEnabled": false,
27 "pageRanges": [
28 {
29 "start": 1,
30 "end": 10
31 },
32 {
33 "start": 20,
34 "end": 30
35 }
36 ]
37 },
38 "parseConfig": {
39 "target": "markdown",
40 "chunkingStrategy": {
41 "type": "page",
42 "options": {
43 "minCharacters": 500,
44 "maxCharacters": 10000
45 }
46 },
47 "engine": "parse_performance",
48 "engineVersion": "latest",
49 "blockOptions": {
50 "figures": {
51 "enabled": true,
52 "figureImageClippingEnabled": true,
53 "advancedChartExtractionEnabled": false
54 },
55 "tables": {
56 "targetFormat": "html",
57 "tableHeaderContinuationEnabled": false,
58 "cellBlocksEnabled": false,
59 "agentic": {
60 "enabled": false,
61 "customInstructions": "string"
62 },
63 "enabled": true
64 },
65 "text": {
66 "signatureDetectionEnabled": false,
67 "agentic": {
68 "enabled": false,
69 "customInstructions": "string"
70 }
71 },
72 "keyValue": {
73 "blankFieldFormattingEnabled": false
74 },
75 "barcodes": {
76 "imageClippingEnabled": false,
77 "readingEnabled": false
78 },
79 "formulas": {
80 "enabled": false
81 }
82 },
83 "advancedOptions": {
84 "pageRotationEnabled": true,
85 "pageRanges": [
86 {
87 "start": 1,
88 "end": 10
89 },
90 {
91 "start": 20,
92 "end": 30
93 }
94 ],
95 "excelParsingMode": "basic",
96 "excelSkipHiddenContent": false,
97 "excelUseRawCellValues": false,
98 "excelSkipCalculation": true,
99 "verticalGroupingThreshold": 1,
100 "returnOcr": {
101 "words": false
102 },
103 "alwaysConvertToPdf": false,
104 "enrichmentFormat": "xml",
105 "imageConversionQuality": "medium",
106 "formattingDetection": [
107 {
108 "type": "change_tracking"
109 }
110 ]
111 }
112 }
113 },
114 "classifierId": "cl_Xj8mK2pL9nR4vT7qY5wZ",
115 "createdAt": "2024-03-21T16:45:00Z"
116 }
117}
Create a new classifier.
Was this page helpful?
Previous

Get Classifier

Next
Built with

Authentication

AuthorizationBearer

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

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.

Request

This endpoint expects an object.
namestringRequired
The name of the classifier.
cloneClassifierIdstringOptional

The ID of an existing classifier to clone. If provided, the new classifier will be created with the same config as the classifier with this ID. Cannot be provided together with config.

Example: "cl_BMdfq_yWM3sT-ZzvCnA3f"

configobjectOptional

The configuration for the classifier. Cannot be provided together with cloneClassifierId.

Response

Classifier created successfully
objectenum

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

Allowed values:
idstring

The ID of the classifier.

Example: "cl_Xj8mK2pL9nR4vT7qY5wZ"

namestring

The name of the classifier.

Example: "Document Type Classifier"

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"

draftVersionobject
The draft version of the classifier. This is the editable version in the Extend dashboard.

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.