Classifier API

POST
/api/v1/classify/{classifierId}

Use AI-powered classification to automatically route documents to the correct processing pipeline. The classifier analyzes your document and determines which extraction schema should be used for optimal data extraction.

How Classification Works

Classification Workflow
Complete process for automatically routing documents to the optimal extraction schema
1.

Create Classifier in Platform

Set up a classifier and configure which deployments it should route to based on document type

2.

Get Upload URL

Request a signed URL for uploading your document that needs to be classified

3.

Upload and Classify Document

Upload your file, then send it for classification. AI analyzes the document and determines the best extraction schema

4.

Process with Optimal Schema

Use the returned fileId and extractionSchemaId to process the document with the optimal configuration

Request Parameters

Path Parameters
required
classifierIdstring

The unique identifier of the classifier you created in the platform. You can find this ID in your classifier settings.

Request Body
required
unclassifiedFileIdstring

The unclassified file ID returned from the classifier get-url endpoint after uploading your document.

Headers
required
Authorizationstring

Bearer token for authentication.

required
Content-Typestring

Must be set to application/json

Response

Success Response (200) - Classified

When the document is successfully classified and routed to a deployment.

classified-response.json

Response Fields

fileId
string

The classified file ID. Use this with the process-file endpoint to extract data.

deploymentName
string

Human-readable name of the deployment the document was routed to.

extractionSchemaId
string

The extraction schema ID to use for processing. Use this with the process-file endpoint.

Success Response (200) - Unclassified

When the document cannot be classified into any of the configured deployment routes.

unclassified-response.json

Document Not Classified

The document doesn't match any of the configured deployment routes. You may need to add more deployment options to your classifier or process the document manually.

Error Responses

Common error responses you might encounter.

error-responses.json

Complete Classification Workflow

End-to-End Example
Complete workflow from document upload through classification to data extraction
complete-classification-workflow.js

Next Steps

Process Classified Documents

Use the fileId and extractionSchemaId from classification results to extract structured data using the async process-file endpoint for scalable processing.

POST /api/v1/document/{extractionSchemaId}/process-file-async/{fileId}
Async Processing Documentation →
Get Upload URL for Classification

Start the classification workflow by getting an upload URL for your documents.

Get Classifier Upload URL →