> ## Documentation Index
> Fetch the complete documentation index at: https://docs.superdocs.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Rename a saved document and/or update its out-of-flow parts (headers, footers, footnotes, endnotes, comments, sections).

> Rename one of your saved documents and/or update its out-of-flow parts. Parts are
the document's out-of-flow content — headers/footers, footnote and endnote bodies,
comments, and per-section page geometry. Every fragment is sanitized on write, writes
are versioned and safe under concurrent editors, and parts revert with the document.
A title-only call behaves exactly as the original rename (response `status:"renamed"`);
a parts call returns the new `version`, the part families written (`parts_updated`),
and any concurrently-overwritten families (`parts_conflicts`, newest-write-wins).
Note: parts editing is moving to the document body itself — when the new model is
active on this deployment, a `parts` payload returns 400 `parts_moved_to_chunks` and
part content is edited exactly like any other document content (via chat or the
document write endpoints).



## OpenAPI

````yaml /openapi.json patch /v1/documents/{document_id}
openapi: 3.1.0
info:
  title: Universal Document AI API
  version: 2.0.0
servers: []
security: []
paths:
  /v1/documents/{document_id}:
    patch:
      tags:
        - v1
        - mcp
      summary: >-
        Rename a saved document and/or update its out-of-flow parts (headers,
        footers, footnotes, endnotes, comments, sections).
      description: >-
        Rename one of your saved documents and/or update its out-of-flow parts.
        Parts are

        the document's out-of-flow content — headers/footers, footnote and
        endnote bodies,

        comments, and per-section page geometry. Every fragment is sanitized on
        write, writes

        are versioned and safe under concurrent editors, and parts revert with
        the document.

        A title-only call behaves exactly as the original rename (response
        `status:"renamed"`);

        a parts call returns the new `version`, the part families written
        (`parts_updated`),

        and any concurrently-overwritten families (`parts_conflicts`,
        newest-write-wins).

        Note: parts editing is moving to the document body itself — when the new
        model is

        active on this deployment, a `parts` payload returns 400
        `parts_moved_to_chunks` and

        part content is edited exactly like any other document content (via chat
        or the

        document write endpoints).
      operationId: rename_document
      parameters:
        - name: document_id
          in: path
          required: true
          schema:
            type: string
            title: Document Id
        - name: authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDocumentRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - HTTPBearer: []
components:
  schemas:
    UpdateDocumentRequest:
      properties:
        title:
          anyOf:
            - type: string
              maxLength: 255
              minLength: 1
            - type: 'null'
          title: Title
          description: New document title.
        parts:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Parts
          description: >-
            Document-parts patch — the document's OUT-OF-FLOW content, keyed by
            any of: sections, headers, footers, footnotes, endnotes, comments.
            Each key you send REPLACES that whole part family; a null value
            clears it; keys you omit are untouched. Every HTML fragment is
            sanitized server-side. Headers/footers are keyed by section index
            with default/first/even variants; dynamic page fields use <span
            data-field="PAGE|NUMPAGES|DATE">cached text</span>.
        base_parts:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Base Parts
          description: >-
            Optional concurrency guard: the parts subtree your edit was based on
            (as last read). If another writer changed one of the same part
            families since, your write still lands (newest-write-wins) and the
            overwritten families are reported in `parts_conflicts`.
      type: object
      title: UpdateDocumentRequest
      description: >-
        PATCH /v1/documents/{id} body — rename a document and/or update its
        out-of-flow

        parts. Both fields optional; at least one must be present.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

````