Skip to main content

Render a template (/apply)

Render a template into DOCX or PDF.

Endpoint

POST /api/v1/templates/{workspaceId}/{templateName}/apply

Base URL (production): https://api.templi.dev

Headers

  • X-Templi-Token (required)
  • Content-Type: application/json
  • Accept: application/pdf (optional, return PDF instead of DOCX)

Request body

Payloads are JSON objects keyed by placeholder name.

{
"title": {
"type": "text",
"text": "Templi Report",
"style": {
"bold": true,
"color": "5B2DFF",
"fontFamily": "Arial",
"fontSize": 14
}
},
"logo": {
"type": "picture",
"pictureType": "PNG",
"url": "https://example.com/logo.png",
"pictureStyle": {
"width": 300,
"height": 62
},
"altMeta": "Templi logo"
}
}

Response

  • 200 with a DOCX file by default.
  • 200 with a PDF file if Accept: application/pdf is provided.

Common errors

  • 400 invalid payload
  • 401 missing or invalid API key
  • 403 template not allowed
  • 404 workspace or template not found
  • 413 payload or template exceeds plan limits
  • 429 render limit exceeded