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/jsonAccept: 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
200with a DOCX file by default.200with a PDF file ifAccept: application/pdfis provided.
Common errors
400invalid payload401missing or invalid API key403template not allowed404workspace or template not found413payload or template exceeds plan limits429render limit exceeded