Skip to main content

Placeholders

Placeholders are tags inside your .docx template. Templi parses them and expects a matching JSON payload.

Tag syntax

  • Text: {{name}}
  • Picture: {{@logo}}
  • Table: {{#table}}
  • List: {{*items}}

Payload shape (high level)

Each field is an object with a type and its data.

{
"title": {
"type": "text",
"text": "Quarterly Report"
},
"logo": {
"type": "picture",
"pictureType": "PNG",
"url": "https://example.com/logo.png",
"pictureStyle": {"width": 120, "height": 40}
}
}

Notes

  • Use lowercase types in payloads: text, picture, table, list.
  • Templates with missing fields return a validation error.
  • Tables and lists accept nested content (text and images).