The API

Data & variables

Renderly injects the data object into the document through variables. This page covers every syntax form — escaped, raw, with fallback and by nested path — plus how tables, QR codes and charts are driven by your data.

Anatomy of a variable

A variable is a {{...}} marker inside the content. At render time, Renderly looks up the given path inside the request’s data object and replaces it with the value found.

SyntaxBehaviorWhen to use
{{x}}Inserts the value with HTML escaping (characters like < > & become entities).The default and the safe one. Use for any user-supplied data.
{{{x}}}Inserts the value raw, without escaping — the HTML is interpreted.Only for HTML you trust (e.g. a snippet generated by your own system).
{{x|fallback}}Uses the text after the bar when the value is missing, null or empty.Optional fields; avoids gaps in the document.
{{a.b.c}}Walks nested paths in data using dots.Data structured into objects.

Escaped vs. raw

The difference between {{x}} and {{{x}}} is about safety. The escaped one neutralizes HTML — if the value is <b>oi</b>, it appears literally as text. The raw one injects the HTML to be rendered. Use raw only with trusted content; with third-party data, escaping prevents markup injection.

Raw = your responsibility
{{{x}}} does not sanitize anything. If the value comes from an end user, prefer {{x}}. Reserve raw for fragments your own system generates.

Fallback — {{x|default value}}

When a piece of data can be missing, the fallback keeps the document from having an empty gap. The text after the bar | is used if the path does not resolve.

VariabledataOutput
{{status|pending}}{ "status": "paid" }paid
{{status|pending}}{}pending
{{notes|—}}{ "notes": "" }

Nested paths

Reach deep objects with dots. Given this data:

nested data
{
  "data": {
    "company": {
      "name": "Acme",
      "address": { "city": "San Francisco", "state": "CA" }
    }
  }
}

you reference {{company.name}}Acme and {{company.address.city}}São Paulo.

All together in the HTML path

In raw HTML, all three scalar forms work. An example combining fallback, nested and raw:

application/json
{
  "html": "<h1>{{title|Document}}</h1>\n<p>Customer: {{client.name}}</p>\n<div>{{{signature_html}}}</div>",
  "data": {
    "title": "Receipt",
    "client": { "name": "Acme Ltda" },
    "signature_html": "<img src='https://example.com/signature.png' />"
  }
}
Raw HTML: scalars only
In the html path, substitution is scalar — {{x}}, {{{x}}} and {{x|fallback}}. Tables that iterate over arrays, QR and charts are features of the template path, where the document is structured.

Tables — iterating over an array

In the template, a table points to an array in data through a source field (the dataField). Renderly iterates that array and generates one row per item, mapping each column to a key of the item.

data with array for a table
{
  "template": "invoice",
  "data": {
    "client": "Acme Ltda",
    "items": [
      { "description": "Pro Plan", "qty": 1, "amount": "$99.00" },
      { "description": "Extra user", "qty": 3, "amount": "$135.00" },
      { "description": "Support", "qty": 1, "amount": "$0.00" }
    ],
    "total": "$234.00"
  }
}

Here the table’s dataField is items. Each object in the array becomes a row; the columns reference description, qty and amount. Scalar fields like client and total are used normally outside the table.

ConceptWhat it is
dataFieldThe data key that holds the array of rows.
rowAn item of the array. Repeated automatically for each element.
columnMaps a key of the item (e.g. valor) to a cell.
An empty array is valid
If the array has zero items, the table renders only the header. Use this for documents that may have no rows (e.g. a statement with no transactions).

QR codes

A QR block in the template generates the code from a value in data — typically a URL. It is exactly the mechanism behind the verification mark embedded in every output, but you can also add your own QRs (tickets, links, PIX).

data with a value for a QR
{
  "template": "ticket",
  "data": {
    "event": "Winter Concert",
    "holder": "Maria Silva",
    "qr": "https://acme.com/ticket/8f2a-1c9d"
  }
}

Charts

Charts in the template consume a data series from data — usually an array of label/value pairs — and are drawn into the document. Good for reports, printed dashboards and summaries.

data with a series for a chart
{
  "template": "monthly-report",
  "data": {
    "month": "May/2026",
    "sales": [
      { "label": "Week 1", "value": 1200 },
      { "label": "Week 2", "value": 1850 },
      { "label": "Week 3", "value": 1600 },
      { "label": "Week 4", "value": 2300 }
    ]
  }
}

Best practices with data

PracticeWhy
Format numbers and currencies on your sideRenderly inserts the value as it came; “R$ 99.00” is more predictable than 99.
Use a fallback on every optional fieldDocuments stay intact even with partial data.
Escape by default, raw only when you trust itPrevents HTML injection from third-party data.
Keep the data shape stableTables and charts depend on the keys the template expects.
Next
Verifiable documents
SHA-256 hash, /api/verify, the verification mark and the /verify/<id> page.