Classify

Classify a document inline

Classifies a document into one of the categories provided in the request body. No saved Classifier required. The document must already be uploaded and OCR-processed (see Run Extract) before it can be classified.

post/v1/classify

Request

  • Base URL: https://api.documentpro.ai
  • URL: https://api.documentpro.ai/v1/classify
  • Auth: API key in header x-api-key

Request body

document_idstring uuid required
page_rangestring
query_model'gpt-4o-mini' | 'gpt-4o'

Example request

{
  "classification_schema": [
    {
      "label": "invoice",
      "description": "A document requesting payment for goods or services rendered"
    }
  ],
  "page_range": "1-3"
}

Response

Classification result.

request_idstring uuid
document_idstring uuid
classifier_idstring uuid nullable

null for inline classification via POST /v1/classify.

classificationstring

The best-matching label.

confidence_scoresobject

Score 0.0-1.0 per label, summing to ~1.0.

request_status'completed' | 'failed' | 'exception'
credits_usedinteger
num_pagesinteger
durationnumber float

Seconds.

Changes

No recorded changes to this operation across all 1 revision of this API.