Skip to content

Reprocess Document Job Endpoint

POST
/v1/documents/{job_id}/reprocess
curl --request POST \
--url http://localhost:8080/v1/documents/example/reprocess \
--header 'Content-Type: application/json' \
--data '{ "template_id": "example", "clear_template": false, "processing_mode": "example", "page_range": "example" }'

Re-enqueue any terminal-status job, optionally swapping templates.

Body is optional; {} keeps the existing template. See the ReprocessPayload docstring for the keep / clear / swap matrix.

job_id
required
Job Id
string
Media type application/json
Any of:
ReprocessPayload

Body for POST /v1/documents/{job_id}/reprocess.

Same auth-header keep/clear pattern as the infra-endpoints router:

  • template_id omitted (default None) → keep current.
  • clear_template: true → reset to auto-classify.
  • template_id set → swap.

The two cannot both be supplied (clear_template=true with a template_id); pydantic catches that with the validator below.

processing_mode (omitted → keep the job’s current mode) switches the pipeline depth on re-run: canonical / entities / extraction. The service rejects a canonical / entities mode paired with a template_id (400, with an actionable message).

page_range (omitted → keep the job’s current selection) re-selects PDF pages on re-run — e.g. narrow a job that failed “all pages” over the page cap to 1-3, or widen back to all.

object
template_id
Any of:
string
<= 64 characters
clear_template
Clear Template
boolean
processing_mode
Any of:
string
page_range
Any of:
string
<= 255 characters

Successful Response

Media type application/json
JobActionResponse
object
job_id
required
Job Id
string
status
required
Status
string
Allowed values: queued processing completed needs_review rejected failed
failure_code
Any of:
string
failure_message
Any of:
string
Example
{
"status": "queued"
}

Validation Error

Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationError
object
loc
required
Location
Array
msg
required
Message
string
type
required
Error Type
string
input
Input
ctx
Context
object
Example generated
{
"detail": [
{
"loc": [
"example"
],
"msg": "example",
"type": "example",
"input": "example",
"ctx": {}
}
]
}