Skip to main content
POST
/
classify
Classify
import requests

url = "https://platform.reducto.ai/classify"

payload = {
    "input": "<string>",
    "persist_results": False,
    "classification_schema": [],
    "page_range": {
        "start": 123,
        "end": 123
    },
    "document_metadata": "<string>"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
{
  "job_id": "<string>",
  "result": {
    "category": "<string>"
  },
  "response_type": "classify",
  "response_confidence": {
    "categories": [
      {
        "category": "<string>",
        "confidence": 123,
        "criteria_confidence": [
          {
            "criterion": "<string>"
          }
        ]
      }
    ]
  },
  "usage": {
    "num_pages": 123,
    "num_categories": 123,
    "credits": 123
  },
  "duration": 123
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
input
required

For parse/split/extract pipelines, the URL of the document to be processed. 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 4. A jobid:// prefixed URL obtained from a previous /parse invocation 5. A list of URLs (for multi-document pipelines, V3 API only)

For edit pipelines, this should be a string containing the edit instructions
persist_results
boolean
default:false

If True, persist the results indefinitely. Defaults to False.

classification_schema
ClassificationCategory · object[]

A list of classification categories and their matching criteria.

page_range

The page range to process (1-indexed). By default, the first 5 pages are used. If more than 25 pages are selected, only the first 25 (after sorting) are used. Only applies to PDFs; ignored for other document types.

document_metadata
string | null

Optional document-level metadata to include in classification prompts.

Response

Successful Response

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

job_id
string
required
result
ClassifyResponseCategory · object
required
response_type
string
default:classify
Allowed value: "classify"
response_confidence
ResponseConfidence · object

Overall confidence breakdown for classification response.

usage
ClassifyUsage · object
duration
number | null

The duration of the classify request in seconds.