Skip to content

Reextract Document Job Endpoint

POST
/v1/documents/{job_id}/reextract
curl --request POST \
--url http://localhost:8080/v1/documents/example/reextract \
--header 'Content-Type: application/json' \
--data '{ "template_id": "example", "template_name": "example" }'

Re-run extraction against the job’s stored canonical — no re-OCR.

The cheap path for “the template changed, re-extract this document”: only the extraction stage (LLM call + judge + validation) runs, and the result row / status / review queue update in place. Requires a terminal job with a persisted canonical in extraction mode. Body is optional; {} re-applies the job’s current template, or pass template_id / template_name to swap. Use /reprocess when the document itself (or the processing mode / page range) changed.

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

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

Both selectors omitted → re-apply the job’s previously resolved (else requested) template. At most one of template_id / template_name may be supplied (the service 400s on both).

object
template_id
Any of:
string
<= 64 characters
template_name
Any of:
string
<= 128 characters
Example generated
{
"template_id": "example",
"template_name": "example"
}

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": {}
}
]
}