Render a document
renderRender a template plus a JSON payload into a PDF, PNG or JPG and return a signed URL. This is the one tool most calls need.
Small jobs finish inside the call and come back status: "succeeded" with a url you can hand straight to a user. Anything with a webhook_url, async: true or a large payload comes back status: "queued" with an id for get_render.
Renders are deterministic and cached: the same template version, data and options return the stored object with cached: true, free and instant. Billing is per PNG or JPG and per PDF page; cache hits are never billed.
For a reader who is not in the US, send data.lang (a BCP 47 tag such as fi or pt-BR) if the template's schema has a lang property (check get_template first; the starter library's templates do for new accounts and after a library refresh): the document's fixed text, dates, money and paper size follow it, and data.labels overrides single strings. On a template that does not declare them they are ordinary unknown fields (a warning, or a 422 on a closed schema). Read warnings in the answer: fields the template did not use, and a language it has no text for.
No API key needed to start — the first call mints a trial of 10 PDF pages or 10 images and returns its token.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| data | Yes | The JSON payload for the template, matching its schema. Call get_template for the schema, or validate_data to dry-run a payload for free. If get_template shows a `lang` property in the schema, add `lang` (a BCP 47 tag such as `fi` or `pt-BR`) for the reader's language, and `labels` (key to text) to reword single strings. Do not send them to a template whose schema lacks them: they are unknown fields there (a warning on an open schema, a 422 on a closed one). | |
| async | No | Force the queued path even for a small job. Default false: small jobs finish inside the call and come back with a URL already. | |
| format | No | Output format. Defaults to `pdf` for chromium templates and `png` for satori ones. `webp` is not supported in v1. | |
| options | No | Render options, merged over the template's own defaults. Options are part of the cache key, so two calls that differ only here are two different renders. | |
| template | Yes | Template to use: `invoice` for the latest version, or `invoice@3` to pin version 3. Pin the version in anything you ship — a new version changes the output and the cache key. Call list_templates to see what this account has. | |
| webhook_url | No | Absolute https URL to POST the finished render to. Supplying one forces the queued path: the call returns immediately with status `queued`. |