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)
const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
input: '<string>',
persist_results: false,
classification_schema: [],
page_range: {start: 123, end: 123},
document_metadata: '<string>'
})
};

fetch('https://platform.reducto.ai/classify', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
package main

import (
"fmt"
"strings"
"net/http"
"io"
)

func main() {

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

payload := strings.NewReader("{\n \"input\": \"<string>\",\n \"persist_results\": false,\n \"classification_schema\": [],\n \"page_range\": {\n \"start\": 123,\n \"end\": 123\n },\n \"document_metadata\": \"<string>\"\n}")

req, _ := http.NewRequest("POST", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")

res, _ := http.DefaultClient.Do(req)

defer res.Body.Close()
body, _ := io.ReadAll(res.Body)

fmt.Println(string(body))

}
{
  "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
}
{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}

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

Overall confidence breakdown for classification response.

usage
ClassifyUsage · object | null
duration
number | null

The duration of the classify request in seconds.