---
search:
  tags:
    - projects
    - PATCH
seo:
  description: >-
    How partial updates work: Only fields provided in the… Reference for the
    PATCH /projects/{projectId}/documents/{id} endpoint in the Leadtime Public
    API API.
sidebar:
  badge: PATCH
  label: Partially update document
title: Partially update document
type: openapi-operation
---
**How partial updates work:**
Only fields provided in the request body will be updated. All other fields remain unchanged. This allows flexible updates without needing to send the entire document.

**Content updates:**
- If description or customEditorContent is provided, it replaces the existing content
- If set to null or empty string, the content is cleared
- If omitted, existing content is preserved
- Content accepts HTML or Markdown and is converted to internal format

**Custom variables:**
- If customVariables array is provided, it completely replaces all existing custom variables
- If omitted, existing custom variables are preserved
- To update individual variables, include all variables (updated and unchanged) in the array

**Validation:**
- Project version (if provided) must exist and belong to the project
- Contact person (if provided) must be available for this project type
- All provided custom variables must have valid values matching their types

**Common update scenarios:**
- Change document status (e.g., Draft → Waiting for Approval)
- Update document title or description
- Modify custom variable values
- Change contact person assignment
- Update layout options (table of contents, title page, etc.)
- Switch to a different project version

**What is returned:**
The updated document with all fields, including converted HTML content and custom variable values.

<Operation source="api-reference" id="projectdocumentscontroller-updatedocument" />
