variables object and reference them using {{varName}} syntax in text or via variableRef elements.
Alternative syntax for integrations: The API also accepts
${varName} as an alternative to {{varName}} on input. This is useful when working with automation platforms like Make.com, Zapier, or n8n whose template engines conflict with the {{...}} syntax. Both forms are normalized to {{...}} internally. API responses always use {{...}}.Defining variables
Thevariables object is a key-value map where each key is the variable name and the value defines the content.
Variable names must:
- Start with a letter (
a-z,A-Z) - Contain only letters, digits, and underscores
- Be at most 50 characters long
Variable types
Text variable
A simple string value. Referenced via{{varName}} in any text content (headings, paragraphs, list items, table cells, header/footer).
Usage in text:
Text variable substitution works in all text content: element text, list items, table cells, and header/footer strings.
Number variable
A numeric value. Can be referenced via{{varName}} in text (rendered as string) or via a variableRef element. Useful for charts, calculations, and dynamic numeric content.
Usage in text:
Number variables are automatically converted to strings when used in
{{varName}} text substitution. When rendered via variableRef, they produce a text element.Image variable
An image with optional dimensions and alignment. Must be referenced via avariableRef element or {{varName}} in a table cell.
List variable
An ordered or unordered list of string items.Table variable
A 2D data array with optional named columns. Can be used withvariableRef or bound to a table element via dataSource.
Referencing variables
Inline text substitution
Use{{varName}} anywhere in text content. Text variables (strings) and number variables are substituted inline. Number values are automatically converted to their string representation. Non-text/non-number variables and undefined references are left as-is.
- List items (both string items and
textproperty of object items) - Table cells (both string cells and
textproperty of object cells) - Header/footer content (both simple strings and rich text
contentarrays)
variableRef element
ThevariableRef element renders a variable as a full content element. The rendering type is determined automatically by the variable’s type:
- Text variable → rendered as a
textelement - Number variable → rendered as a
textelement (value converted to string) - Image variable → rendered as an
imageelement (with alignment if specified) - List variable → rendered as a
listelement - Table variable → rendered as a
tableelement (columns become headers, data becomes rows)
Table dataSource binding
Table elements can bind to a table variable via thedataSource property instead of defining rows inline. Use mapping to select and reorder columns.
When
mapping is provided, only the specified columns (matched by name against columns in the table variable) are included. Without mapping, all data columns are used as-is.
Image variables in table cells
When a table cell contains exactly one variable reference ({{varName}}) that resolves to an image variable, the cell is automatically rendered as an image instead of text.
Built-in variables
The following variables are always available and do not need to be defined:
These are especially useful in header/footer configurations:
Defaults for variables
There are no global default styles specific to variables. However, the rendered output ofvariableRef elements inherits the global defaults for the respective element type:
- Text variables inherit
defaults.styles.textanddefaults.fontSize,defaults.fontFamily, etc. - Number variables inherit the same defaults as text variables (rendered as text)
- Image variables inherit default image spacing from
defaults.spacing - List variables inherit default list spacing
- Table variables inherit
defaults.styles.tablefor styling
