Skip to content

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

NameTypeRequiredDescription
idintegerYes

The numeric ID of the template to update.

Request body

Content type application/json (required).

FieldTypeRequiredDescription
namestringYes

Human-readable template name (must be unique within the tenant).

Max length: 255

bindingstringYes

Data binding context (e.g. "invoice", "contract", "payslip").

template_formatstringYes

Source format of the template body field.

One of: "html", "docx", "odt"

bodystringYes

Template content — HTML string for html format, base64-encoded binary for docx/odt.

output_formatsarray of stringNo

Output formats to generate when this template is rendered.

notesstringNo

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"]}'
Loading