---
search:
  tags:
    - administration
    - PUT
seo:
  description: >-
    Updates an existing document template. All fields must… Reference for the
    PUT /administration/document-templates/{id} endpoint in the Leadtime Public
    API API.
sidebar:
  badge: PUT
  label: Update document template
title: Update document template
type: openapi-operation
---
Updates an existing document template. All fields must be provided as this is a full replacement operation.

**What gets updated:**
- Template metadata (name, description, language, type)
- Template content (replaced entirely with new HTML or Markdown)
- Custom variables (replaced entirely with new array)

**Content format:**
Provide content as HTML or Markdown with support for:
- Rich text formatting (headings, lists, tables, etc.)
- System variables (e.g., `#project.name`, `#organization.companyName`)
- Custom variables (defined in the `customVariables` array)
- Conditional sections and page breaks

**Using variables:**
Variables are represented as HTML spans: `<span data-type="variable" data-id="project.name">...</span>`
Custom variables use: `<span data-type="variable" data-id="custom.variable_name">...</span>`

**Custom variables:**
The entire custom variables array is replaced. Each variable defines a template-specific field with name, type, optional default value, and required flag.

**What is returned:**
The updated template with content converted to HTML format and all custom variables included.

**Note:** For partial updates (only content or custom variables), use the PATCH endpoint instead.

<Operation source="api-reference" id="documenttemplatescontroller-updatedocumenttemplate" />
