---
search:
  tags:
    - administration
    - PATCH
seo:
  description: >-
    Updates only the content and/or custom variables of a… Reference for the
    PATCH /administration/document-templates/{id} endpoint in the Leadtime
    Public API API.
sidebar:
  badge: PATCH
  label: Partially update document template
title: Partially update document template
type: openapi-operation
---
Updates only the content and/or custom variables of a document template. All other fields remain unchanged.

**What can be updated:**
- Template content (optional - only if provided)
- Custom variables (optional - only if provided)
- Metadata fields (name, description, language, type) are NOT updated via this endpoint

**Content format:**
If provided, content should be 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:**
If provided, the entire custom variables array replaces the existing one. 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 full updates including metadata, use the PUT endpoint instead.

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