Skip to main content
POST
Preview a template

Authorizations

Authorization
string
header
required

JWT bearer token issued by the identity provider.

Body

application/json

Template markup and the sample data to render it against.

content
string
required

Raw pongo2 template markup to render. At most 512 KiB, measured on the decoded bytes.

Maximum string length: 524288
Example:

"Total: {{ ledger.accounts.0.balance }}"

outputFormat
string

One of Html, Csv, Txt, Xml or Pdf, matched case-insensitively. Decides the response content type only; defaults to Html when omitted or empty.

Pattern: ^([Hh][Tt][Mm][Ll]|[Cc][Ss][Vv]|[Tt][Xx][Tt]|[Xx][Mm][Ll]|[Pp][Dd][Ff])?$
Example:

"Html"

sampleData
object

Render context shaped as data source, then table, then rows. At most 1 MiB, measured on the raw JSON bytes sent for this member.

Response

OK

contentType
string
required

Content type the rendered output should be displayed as.

Example:

"text/html"

durationMs
integer<int64>
required

How long the preview took, in milliseconds.

Example:

12

rendered
string
required

Rendered output. For a Pdf template this is the HTML stage that would feed the PDF engine.

Example:

"Total: 1500.00"

warnings
string[]
required

Non-fatal render notes, such as output having been truncated.