Create Classification
Classify a document.
Runs a classification on the supplied document against the provided
categories. Tune the run with model, instructions, first_n_pages
(limit to the first pages), and n_consensus (number of votes to combine).
Returns the created classification with the chosen category and reasoning;
responds with 201.
Classify a document into one of the provided categories and persist the result as aDocumentation Index
Fetch the complete documentation index at: https://docs.retab.com/llms.txt
Use this file to discover all available pages before exploring further.
Classification resource that can later be retrieved via GET /v1/classifications/{classification_id} or listed via GET /v1/classifications.
Authorizations
Body
Public create-classification request body.
A file represented by its filename and a base64 data url.
- MIMEData
- FileRef
The categories to classify the document into
1The model to use for classification
Only use the first N pages of the document for classification. Useful for large documents where classification can be determined from early pages.
Free-form instructions appended to the system prompt to steer the classification.
Number of classification runs to use for consensus voting. Uses deterministic single-pass when set to 1.
If true, skip the LLM cache and force a fresh completion
If true, run asynchronously: returns immediately with status 'queued' and an empty output. Poll GET /v1//{id} until status is terminal. Mutually exclusive with stream.
Response
Successful Response
A classification result: the categories a document was scored against and the chosen output decision.
Unique identifier of the classification
Information about the classified file
Model used for classification
Categories the document was classified against
Number of consensus votes used
Free-form instructions supplied with the classification request.
The classification result with reasoning. A degenerate empty decision until status == 'completed'; gate reads on status.
Lifecycle status. The synchronous path returns 'completed'. Background runs progress pending -> queued -> in_progress -> completed | failed | cancelled.
pending, queued, in_progress, completed, failed, cancelled Error details when a background run fails; null otherwise. Always present so consumers can read it without an existence check.
Consensus metadata for multi-vote classification runs
Usage information for the classification