Update office template
PUT/office/templates/{id}
Updates an existing template's name, body, output formats, or notes. Each save creates a new draft version; the published version is not changed until /publish is called. Use to iterate on template design before releasing to production document generation.
Request
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | integer | Yes | The numeric ID of the template to update. |
Request body
Content type application/json (required).
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Human-readable template name (must be unique within the tenant). Max length: 255 |
binding | string | Yes | Data binding context (e.g. "invoice", "contract", "payslip"). |
template_format | string | Yes | Source format of the template body field. One of: |
body | string | Yes | Template content — HTML string for html format, base64-encoded binary for docx/odt. |
output_formats | array of string | No | Output formats to generate when this template is rendered. |
notes | string | No | Internal notes or changelog entry for this template. |
Example
{
"name": "Standard Invoice Template (v2 layout)",
"body": "<html><body><h1>Invoice {{invoice_number}}</h1><p>Updated footer...</p></body></html>",
"output_formats": [
"pdf",
"docx",
"odt"
]
}
Responses
200 Template updated; new draft version created
404 Template not found
422 Validation failed
Example request
curl -X PUT "https://{tenant}.faciotech.net/api/v1/office/templates/{id}" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"name": "Standard Invoice Template (v2 layout)", "body": "<html><body><h1>Invoice {{invoice_number}}</h1><p>Updated footer...</p></body></html>", "output_formats": ["pdf", "docx", "odt"]}'