Reprocess Document Job Endpoint
POST
/v1/documents/{job_id}/reprocess
const url = 'https://docstack.nvc.nxu.ae/v1/documents/example/reprocess';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"template_id":"example","clear_template":false,"output_mode":"example","processing_mode":"example","page_range":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://docstack.nvc.nxu.ae/v1/documents/example/reprocess \ --header 'Content-Type: application/json' \ --data '{ "template_id": "example", "clear_template": false, "output_mode": "example", "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.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” job_id
required
Job Id
string
Request Body
Section titled “Request Body ” 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_idomitted (defaultNone) → keep current.clear_template: true→ reset to auto-classify.template_idset → swap.
The two cannot both be supplied (clear_template=true with a
template_id); pydantic catches that with the validator below.
output_mode (omitted → keep current) is document or
extraction. processing_mode is a deprecated compatibility alias.
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.
null
Responses
Section titled “ Responses ”Successful Response
Media type application/json
Validation Error
Media type application/json
HTTPValidationError
object
detail
Detail
Array<object>
ValidationErrorobject
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": {} } ]}