Preview a template
Authorization
ApiKeyAuth API key from Settings → API Keys.
In: header
Path Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/v1/templates/string/preview" \ -H "Content-Type: application/json" \ -d '{ "data": { "customer": "Acme Ltd" }, "format": "png" }'{ "format": "png", "url": "https://docuagen.s3.amazonaws.com/temp-uploads/.../preview.png?X-Amz-Signature=...", "expires_in": 3600}Validate a template POST
Checks a template for problems and returns structured findings. Send `document` to check a candidate before saving it, or an empty body to check what is stored. Findings come at three severities: - **error** — the template will not render, or will render something wrong. An unavailable font silently substitutes another face; a missing image asset leaves a hole. `ok` is `false` when there is at least one. - **warning** — quality problems that still render: placeholder text left in, a real company's trademark used as sample data, a symbol set in a font that has no glyph for it. - **suggestion** — smaller improvements. Asset names and custom font families are read from the template itself, not from your request, so a filename that does not exist is caught rather than trusted. Typst **syntax** is not checked here — the compiler is the authority on that. Call `preview` to find out whether it compiles.
Get a template's field schema GET
The template's fields on their own, without the document body beside them. Same `fields` and `layers` as `GET /api/v1/templates/{id}`, but a document can be large and a caller that only needs to know what to put in `data` should not have to download one to find out. Add `?primary=true` for content fields only. A canvas layer carries every typography property it supports, so a five-layer template answers with 56 fields of which four are the ones anyone means. `field_count` reports both totals either way, so a filtered response never looks like the whole picture. `sample_data` is a ready-to-send `data` object built from the fields' own example values, and always contains the primary fields only.