Async Classifier API

POST
/api/v1/classify/{classifierId}/async

Classify documents and automatically trigger extraction with a single API call. Classification happens immediately and returns the result, while extraction runs in the background. This eliminates the need to manually queue extraction after classification completes.

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
fileIdstring

The 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)

Returns the classification result immediately. Extraction is triggered automatically in the background.

async-success-response.json

Response Fields

fileId
string

The classified file ID. Use this to poll for extraction results with the get-file-data endpoint.

deploymentName
string

The name of the deployment the document was routed to based on classification.

extractionSchemaId
string

The extraction schema ID that will be used for data extraction. This is determined automatically based on classification results.

Error Responses

Common error responses you might encounter.

error-responses.json

Complete Async Workflow

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

Next Steps

Poll for Results

Use the get-file-data endpoint with just the fileId to check status and retrieve extracted data when processing completes.

GET /api/v1/document/get-file-data?fileId={fileId}
Get File Data Documentation →
Sync Classification

Need to wait for classification results before proceeding? Use the sync endpoint for immediate classification responses.

Sync Classification Documentation →