import requests
url = "https://platform.reducto.ai/classify"
payload = {
"input": "<string>",
"model": "default",
"priority": True,
"force_url_result": False,
"classification_schema": [],
"category_groups": {},
"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>',
model: 'default',
priority: true,
force_url_result: false,
classification_schema: [],
category_groups: {},
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 \"model\": \"default\",\n \"priority\": true,\n \"force_url_result\": false,\n \"classification_schema\": [],\n \"category_groups\": {},\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>",
"confidence": "high"
}
]
}
]
},
"usage": {
"num_pages": 123,
"num_categories": 123,
"credits": 123,
"usage_breakdown": {
"classify_model": "Classify",
"classify_pages": 0
}
},
"extra_metadata": {},
"duration": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Classify
import requests
url = "https://platform.reducto.ai/classify"
payload = {
"input": "<string>",
"model": "default",
"priority": True,
"force_url_result": False,
"classification_schema": [],
"category_groups": {},
"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>',
model: 'default',
priority: true,
force_url_result: false,
classification_schema: [],
category_groups: {},
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 \"model\": \"default\",\n \"priority\": true,\n \"force_url_result\": false,\n \"classification_schema\": [],\n \"category_groups\": {},\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>",
"confidence": "high"
}
]
}
]
},
"usage": {
"num_pages": 123,
"num_categories": 123,
"credits": 123,
"usage_breakdown": {
"classify_model": "Classify",
"classify_pages": 0
}
},
"extra_metadata": {},
"duration": 123
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
The URL of the document to be classified. You can provide one of the following:
- A publicly available URL
- A presigned S3 URL
- A reducto:// prefixed URL obtained from the /upload endpoint after directly uploading a document
The classification model to use. Set to "accurate" to run Deep Classify for higher accuracy on hard documents. Defaults to "default".
default, accurate 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.
Force the endpoint result to be returned in URL form.
A list of classification categories and their matching criteria.
Show child attributes
Show child attributes
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.
Show child attributes
Show child attributes
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.
Show child attributes
Show child attributes
Optional document-level metadata to include in classification prompts.
Response
Successful Response
Response from classify job - returned when polling /job/{job_id}
- ClassifyResponseCategory
- UrlResult
Show child attributes
Show child attributes
"classify"Overall confidence breakdown for classification response.
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Additional metadata for the classify response. Contains grouping when the request set category_groups. Omitted when empty.
Show child attributes
Show child attributes
The duration of the classify request in seconds.
Was this page helpful?