Skip to content

Unified Test Endpoint

POST
/v1/templates/test
curl --request POST \
--url http://localhost:8080/v1/templates/test \
--header 'Content-Type: application/json' \
--data '{ "ocr_markdown": "example", "template_id": "example", "draft_id": "example", "ad_hoc_template": { "prompt_overlay": "", "json_schema": {}, "validation_rules": [ {} ], "review_thresholds": {} } }'

Unified dry-run for templates, pending drafts, and ad-hoc schemas.

Discriminated by exactly one of template_id / draft_id / ad_hoc_template. See docs/intelligent-extraction-design.md §12.7.

Media type application/json
UnifiedTestPayload

Discriminated test body — exactly one of template_id / draft_id / ad_hoc_template must be supplied.

See docs/intelligent-extraction-design.md §12.7 for the three modes (by template id, by pending draft id, by ad-hoc schema). The VFE uses Mode C to preview live edits without persisting.

object
ocr_markdown
required
Ocr Markdown
string
>= 1 characters <= 200000 characters
template_id
Any of:
string
draft_id
Any of:
string
ad_hoc_template
Any of:
AdHocTemplatePayload

Template shape for Mode C of the unified test endpoint.

object
prompt_overlay
Prompt Overlay
string
""
json_schema
required
Json Schema
object
key
additional properties
any
validation_rules
Validation Rules
Array<object>
object
key
additional properties
any
review_thresholds
Review Thresholds
object
key
additional properties
any

Successful Response

Media type application/json
Response Unified Test Endpoint V1 Templates 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": {}
}
]
}