---
title: "Classify a document inline"
method: POST
path: "/v1/classify"
tags: ["Classify"]
---

# Classify a document inline

`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`

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.

## Request body

- ClassifyRequest
  - `document_id` string, uuid, required
  - `classification_schema` ClassCategory[], required
    - `label` string, required
    - `description` string, required
  - `page_range` string
  - `query_model` 'gpt-4o-mini' | 'gpt-4o'

## Response `200`

Classification result.

- ClassificationResult
  - `request_id` string, uuid
  - `document_id` string, uuid
  - `classifier_id` string, uuid, nullable: null for inline classification via POST /v1/classify.
  - `classification` string: The best-matching label.
  - `confidence_scores` object: Score 0.0-1.0 per label, summing to ~1.0.
  - `request_status` 'completed' | 'failed' | 'exception'
  - `credits_used` integer
  - `num_pages` integer
  - `duration` number, float: Seconds.

## Other responses

- `400`: Malformed request or invalid arguments.
- `403`: API key does not have access to the requested resource, or a plan limit was hit.
- `404`: The requested resource does not exist on this account.
- `500`: Something went wrong on DocumentPro's side.

---

[API](https://skmtc.dev/documentpro/apis/documentpro-api.md) · [All operations](https://skmtc.dev/documentpro/apis/documentpro-api/llms.txt) · [OpenAPI document](https://skmtc.dev/documentpro/apis/documentpro-api/revisions/05d6bd485e28?raw)
