Unified Test Endpoint
POST
/v1/templates/test
const url = 'http://localhost:8080/v1/templates/test';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"ocr_markdown":"example","template_id":"example","draft_id":"example","ad_hoc_template":{"prompt_overlay":"","json_schema":{},"validation_rules":[{}],"review_thresholds":{}}}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Request Body required
Section titled “Request Body required ” 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
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
null
Responses
Section titled “ Responses ”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>
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": {} } ]}