---
title: "Validate Document Template"
method: POST
path: "/document_generation/template-validate"
tags: ["Document AI — DMS"]
---

# Validate Document Template

`POST /document_generation/template-validate`

## Request

- Base URL: `https://api.paperoffice.ai/latest`
- URL: `https://api.paperoffice.ai/latest/document_generation/template-validate`
- Auth: HTTP bearer

Check a stored template (template_id, optional template_version) or an inline html_content: syntax errors with line and column, used variables, lists, conditions and images, unknown helpers, schema cross-check and sample data check...

## Request body

- object
  - `template_id` string: Stored template to check.
  - `template_version` integer: Version to check (default: current).
  - `html_content` string: Inline template to check instead of template_id.
  - `engine` 'hbs_v2' | 'po_regex_v1': Engine for inline templates (default hbs_v2).
  - `variables_schema` object: Inline schema to cross-check.
  - `sample_data` object: Inline sample data to check against the schema.

## Response `200`

Success

- SuccessEnvelope: Success envelope. Payload fields are endpoint-specific (top-level fields, `result`/`job_result` for jobs, `data` on some account endpoints).
  - `status` 'success', required
  - `processing_time` union
    - string
    - number
  - `_billing` object

## Other responses

- `4XX`: Error
- `5XX`: Error

---

[API](https://skmtc.dev/paperoffice/apis/paperoffice-ai-api.md) · [All operations](https://skmtc.dev/paperoffice/apis/paperoffice-ai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/paperoffice/apis/paperoffice-ai-api/revisions/c6a6228a4509?raw)
