Classification
Classify Document
Classify PDF and image documents into predefined categories with confidence scoring using job-based processing
POST
Overview
The Classify Document endpoint analyzes documents and assigns them to predefined categories based on their content, structure, and visual characteristics. This endpoint uses job-based processing where files are uploaded to cloud storage and processed asynchronously.The endpoint supports both single-page and multi-page classification with detailed confidence scoring for each page. Documents longer than 4 pages are classified from their first 4 pages. Files are uploaded to cloud storage and processed in the background.
Request
The document to classify: a PDF or an image (JPG, PNG, GIF, WebP, BMP, TIFF). Either
pdf_file or file_url must be provided, but not both. Maximum file size: 500MB.URL to a document to classify (PDF or image). Either
pdf_file or file_url must be provided, but not both.JSON string containing an array of category objects with a required name (e.g.,
[{"name":"invoice"},{"name":"contract"}]). A description key is accepted for compatibility but is not used by classification; only the names guide the result.Response
Unique identifier for the classification job
Current status of the job (“processing”)
Human-readable status message
Remaining API quota after this request
Examples
Job Status Checking
After starting a classification job, you can check its status using the job ID by making a GET request to/classify/{job_id}.
Job Status Values
queued: Job is waiting to be picked up for processingprocessing: Job is currently being processedcompleted: Job completed successfully with results availablefailed: Job failed with error details
Authorizations
Body
multipart/form-data
JSON string containing an array of category objects with a required name. Example: [{"name":"invoice"},{"name":"contract"},{"name":"receipt"}]. A "description" key is accepted for compatibility but is not used by classification.
The document to classify: a PDF or an image (JPG, PNG, GIF, WebP, BMP, TIFF). Provide either pdf_file or file_url, not both. Maximum file size: 500MB.
URL to a document to classify (PDF or image). Provide either pdf_file or file_url, not both.

