Skip to content

Test Template Endpoint

POST
/v1/templates/{template_id}/test
curl --request POST \
--url http://localhost:8080/v1/templates/example/test \
--header 'Content-Type: application/json' \
--data '{ "ocr_markdown": "example" }'

Dry-run a template against sample OCR markdown.

Runs the extraction engine and returns the parsed output plus validation flags, without persisting anything to the database or artefact storage. See also the unified POST /v1/templates/test endpoint for draft + ad-hoc variants (Modes B + C).

template_id
required
Template Id
string
Media type application/json
TemplateTestPayload

Dry-run body for POST /v1/templates/{id}/test.

We accept OCR markdown directly (rather than a fresh file upload) because the pipeline runs in the worker process and the API is deliberately thin. Callers can either paste sample markdown for template-authoring iteration, or reuse the canonical.markdown returned by a prior /v1/documents call.

object
ocr_markdown
required
Ocr Markdown
string
>= 1 characters <= 200000 characters
Example generated
{
"ocr_markdown": "example"
}

Successful Response

Media type application/json
Response Test Template Endpoint V1 Templates Template Id Test Post
object
key
additional properties
any
Example generated
{}

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