Create Classify Job
Create a classify job.
Classifies a document against a set of rules. Set file_input to a file ID (dfl-...) or parse job ID (pjb-...), and provide either inline configuration with rules or a configuration_id referencing a saved preset.
Each rule has a type (the label to assign) and a description (natural language criteria). The classifier returns the best matching rule with a confidence score.
The job runs asynchronously. Poll GET /classify/{job_id} to check status and retrieve results.
Query parameters
Cookies
Request body
Example request
{
"webhook_configurations": [
{
"webhook_url": "https://example.com/webhooks/llamacloud",
"webhook_headers": {
"Authorization": "Bearer sk-..."
},
"webhook_events": [
"parse.success",
"parse.error"
],
"webhook_output_format": "json"
}
],
"configuration_id": "cfg-11111111-2222-3333-4444-555555555555",
"configuration": {
"rules": [
{
"type": "invoice",
"description": "contains invoice number, line items, and total amount"
}
],
"parsing_configuration": {
"lang": "en",
"target_pages": "1,3,5-7",
"max_pages": 10
}
},
"file_input": "dfl-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
"file_id": "dfl-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
"parse_job_id": "pjb-aaaaaaaa-bbbb-cccc-dddd-eeeeeeeeeeee",
"transaction_id": "tx-unique-idempotency-key"
}Response
Successful Response
Example response
{
"configuration": {
"rules": [
{
"type": "invoice",
"description": "contains invoice number, line items, and total amount"
}
],
"parsing_configuration": {
"lang": "en",
"target_pages": "1,3,5-7",
"max_pages": 10
}
}
}Changes
Changed in 3 of the 33 revisions of this API.17
- ○
added the optional property
detail/items/ctxto the response with the422statusresponse-optional-property-added
- ○
added the optional property
detail/items/inputto the response with the422statusresponse-optional-property-added
This revision also has 5 changes that name no endpoint, such as unreferenced schemas being removed. See the revision's changelog
- ○
- ○
added the new optional request property
webhook_configurationsnew-optional-request-property
- ○
- ▲
removed the required property
document_input_valuefrom the response with the200statusresponse-required-property-removed
- ○
added the new optional request property
file_inputnew-optional-request-property
- ○
request property
file_iddeprecatedrequest-property-deprecated
- ○
request property
parse_job_iddeprecatedrequest-property-deprecated
- ○
added the required property
file_inputto the response with the200statusresponse-required-property-added
- ▲