> This page is optimized for agents. Use the linked Markdown pages and llms.txt indexes for related API content.

# Classify

- Product: Reducto API
- Section: Classify
- Snapshot: Current
- Method: `POST`
- Path: `/classify`

## Request body

Required: yes  
Content types: `application/json`  

### `model`

Type: `string`  
Required: no  
Allowed values: `default`, `accurate`  
Default: `default`  

The classification model to use. Set to "accurate" to run Deep Classify for higher accuracy on hard documents. Defaults to "default".

### `priority`

Type: `boolean`  
Required: no  
Default: `true`  

Workers poll the priority queue ahead of the standard queue, so priority jobs start sooner when there is queued work; sync jobs are prioritized above async jobs by default.

### `async`

Type: `config__v3__AsyncConfig`  
Required: no  

The configuration options for asynchronous processing. Used by /classify_async.

#### `metadata`

Type: `unknown`  
Required: no  

JSON metadata included in webhook request body. Defaults to None.

#### `priority`

Type: `boolean`  
Required: no  
Default: `false`  

Workers poll the priority queue ahead of the standard queue, so priority jobs start sooner when there is queued work; sync jobs are prioritized above async jobs by default.

#### `webhook`

Type: `SvixWebhookConfig | DirectWebhookConfig`  
Required: no  

The webhook configuration for the asynchronous processing.

##### SvixWebhookConfig

Type: `SvixWebhookConfig`  

###### `mode`

Type: `string`  
Required: no  
Default: `svix`  

###### `channels`

Type: `string[]`  
Required: no  

A list of Svix channels the message will be delivered down, omit to send to all channels.

###### string

Type: `string`  

##### DirectWebhookConfig

Type: `DirectWebhookConfig`  

###### `mode`

Type: `string`  
Required: no  
Default: `direct`  

###### `url`

Type: `string`  
Required: yes  

##### unknown

Type: `unknown`  

### `force_url_result`

Type: `boolean`  
Required: no  
Default: `false`  

Force the endpoint result to be returned in URL form.

### `input`

Type: `string | string[] | UploadResponse`  
Required: yes  

The URL of the document to be classified. You can provide one of the following:
1. A publicly available URL
2. A presigned S3 URL
3. A reducto:// prefixed URL obtained from the /upload endpoint after directly uploading a document

#### string

Type: `string`  

#### string[]

Type: `string[]`  

##### string

Type: `string`  

#### UploadResponse

Type: `UploadResponse`  

##### `file_id`

Type: `string`  
Required: yes  

##### `presigned_url`

Type: `string`  
Required: no  

###### string

Type: `string`  

###### unknown

Type: `unknown`  

### `classification_schema`

Type: `ClassificationCategory[]`  
Required: no  

A list of classification categories and their matching criteria.

#### ClassificationCategory

Type: `ClassificationCategory`  

A single classification category with its matching criteria.

##### `category`

Type: `string`  
Required: yes  

The category name/label that documents will be classified into (e.g., 'invoice', 'contract', 'receipt').

##### `criteria`

Type: `string[]`  
Required: yes  

A list of criteria, keywords, or descriptions that define what characteristics a document must have to be classified into this category (e.g., ['contains billing information', 'has itemized charges']).

###### string

Type: `string`  

### `category_groups`

Type: `object`  
Required: no  

A mapping of higher-level classify groups to the category labels that belong to each group. When provided, the response includes `extra_metadata.grouping` with the matched group name, or `ungrouped` if the selected category is not in any group.

### `page_range`

Type: `PageRange | PageRange[] | number[]`  
Required: no  

The page range to process (1-indexed). By default, the first 5 pages are used. At most 10 pages can be selected. Only applies to PDFs; ignored for other document types.

#### PageRange

Type: `PageRange`  

##### `start`

Type: `number`  
Required: no  

The page number to start processing from (1-indexed).

###### number

Type: `number`  

###### unknown

Type: `unknown`  

##### `end`

Type: `number`  
Required: no  

The page number to stop processing at (1-indexed).

###### number

Type: `number`  

###### unknown

Type: `unknown`  

#### PageRange[]

Type: `PageRange[]`  

##### PageRange

Type: `PageRange`  

###### `start`

Type: `number`  
Required: no  

The page number to start processing from (1-indexed).

###### number

Type: `number`  

###### unknown

Type: `unknown`  

###### `end`

Type: `number`  
Required: no  

The page number to stop processing at (1-indexed).

###### number

Type: `number`  

###### unknown

Type: `unknown`  

#### number[]

Type: `number[]`  

##### number

Type: `number`  

#### unknown

Type: `unknown`  

### `document_metadata`

Type: `string`  
Required: no  

Optional document-level metadata to include in classification prompts.

#### string

Type: `string`  

#### unknown

Type: `unknown`  

## Execute with cURL

```bash
curl -X POST "https://platform.reducto.ai/classify" \
  -H "Authorization: Bearer $REDUCTO_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{"input":"<value>"}'
```

## Responses

### Response `200`

Category: success  

Successful Response

#### `application/json`

##### Generated example

```json
{
  "job_id": "job_id",
  "result": {
    "category": "category"
  },
  "response_type": "classify",
  "response_confidence": {
    "categories": [
      {
        "category": "category",
        "confidence": 0,
        "criteria_confidence": [
          {}
        ]
      }
    ]
  },
  "usage": {
    "num_pages": 0,
    "num_categories": 0,
    "credits": 0,
    "usage_breakdown": {
      "classify_model": "Classify",
      "classify_pages": 0
    }
  },
  "extra_metadata": {},
  "duration": 0
}
```

##### Schema

###### ClassifyResponse

Type: `ClassifyResponse`  

Response from classify job - returned when polling /job/{job_id}

###### `response_type`

Type: `string`  
Required: no  
Default: `classify`  

###### `job_id`

Type: `string`  
Required: yes  

###### `result`

Type: `ClassifyResponseCategory | UrlResult`  
Required: yes  

###### ClassifyResponseCategory

Type: `ClassifyResponseCategory`  

###### `category`

Type: `string`  
Required: yes  

###### UrlResult

Type: `UrlResult`  

###### `type`

Type: `string`  
Required: yes  

type = 'url'

###### `url`

Type: `string`  
Required: yes  

###### `result_id`

Type: `string`  
Required: yes  

###### `response_confidence`

Type: `ResponseConfidence`  
Required: no  

###### ResponseConfidence

Type: `ResponseConfidence`  

Overall confidence breakdown for classification response.

###### `categories`

Type: `CategoryConfidence[]`  
Required: yes  

###### CategoryConfidence

Type: `CategoryConfidence`  

Confidence result for a category.

###### `category`

Type: `string`  
Required: yes  

###### `confidence`

Type: `number`  
Required: yes  

###### `criteria_confidence`

Type: `CriteriaConfidence[]`  
Required: yes  

###### CriteriaConfidence

Type: `CriteriaConfidence`  

Confidence result for a single criterion.

###### unknown

Type: `unknown`  

###### `usage`

Type: `ClassifyUsage`  
Required: no  

###### ClassifyUsage

Type: `ClassifyUsage`  

###### `num_pages`

Type: `number`  
Required: yes  

###### `num_categories`

Type: `number`  
Required: yes  

###### `credits`

Type: `number`  
Required: no  

###### number

Type: `number`  

###### unknown

Type: `unknown`  

###### `usage_breakdown`

Type: `ClassifyUsageBreakdown`  
Required: no  

Raw usage quantities. Only set for accounts on the new pricing model; credit fields are omitted for those accounts.

###### ClassifyUsageBreakdown

Type: `ClassifyUsageBreakdown`  

Raw classify quantities for accounts on the new pricing model.

``classify_pages`` is capped at 5, the same cap that the classify
credit computation uses.

###### `classify_model`

Type: `string`  
Required: yes  
Allowed values: `Classify`, `Deep Classify`  

###### `classify_pages`

Type: `number`  
Required: no  
Default: `0`  

###### unknown

Type: `unknown`  

###### unknown

Type: `unknown`  

###### `extra_metadata`

Type: `object`  
Required: no  

Additional metadata for the classify response. Contains `grouping` when the request set `category_groups`. Omitted when empty.

###### `duration`

Type: `number`  
Required: no  

The duration of the classify request in seconds.

###### number

Type: `number`  

###### unknown

Type: `unknown`  

### Response `422`

Category: client-error  

Validation Error

#### `application/json`

##### Generated example

```json
{
  "detail": [
    {
      "loc": [
        "loc"
      ],
      "msg": "msg",
      "type": "type",
      "ctx": {}
    }
  ]
}
```

##### Schema

###### HTTPValidationError

Type: `HTTPValidationError`  

###### `detail`

Type: `ValidationError[]`  
Required: no  

###### ValidationError

Type: `ValidationError`  

###### `loc`

Type: `string | number[]`  
Required: yes  

###### string | number

Type: `string | number`  

###### string

Type: `string`  

###### number

Type: `number`  

###### `msg`

Type: `string`  
Required: yes  

###### `type`

Type: `string`  
Required: yes  

###### `input`

Type: `unknown`  
Required: no  

###### `ctx`

Type: `object`  
Required: no  

## Related representations

- [Human documentation](/api-reference/api/sections/classify/operations/classify/)
- [cURL Markdown](https://docs.reducto.ai/api-reference/api/curl/sections/classify/operations/classify.md)
