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

# Update a Document

> Updates an existing document's content and/or title



## OpenAPI

````yaml PUT /docs/{uuid}
openapi: 3.0.1
info:
  title: Lex API
  description: An API to manage your documents
  license:
    name: MIT
  version: 1.0.0
servers:
  - url: https://lex.page/api/v1
security:
  - bearerAuth: []
paths:
  /docs/{uuid}:
    put:
      description: Updates an existing document's content and/or title
      parameters:
        - name: uuid
          in: path
          description: The UUID of the document to update
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        description: Document update data
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocUpdate'
        required: true
      responses:
        '204':
          description: Document updated successfully
        '400':
          description: Bad Request - At least one of title or html must be provided
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Document not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    DocUpdate:
      type: object
      description: Document update data. At least one of title or html must be provided.
      properties:
        title:
          type: string
          description: The new title for the document.
        html:
          type: string
          description: The new HTML content for the document.
      anyOf:
        - required:
            - title
        - required:
            - html
    Error:
      type: object
      properties:
        error:
          type: string
          description: The error message
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer

````