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

# Update Document

> Update the details or contents of an existing document.



## OpenAPI

````yaml put /v1/documents/{document_id}
openapi: 3.1.0
info:
  title: AI Form-Filler API
  version: 0.1.0
servers:
  - url: https://api.simplicity.ai
    description: Production
  - url: http://localhost:8000
    description: Local
security: []
paths:
  /v1/documents/{document_id}:
    put:
      tags:
        - Documents
      summary: Update Document
      description: Update the details or contents of an existing document.
      operationId: update_document_v1_documents__document_id__put
      parameters:
        - name: document_id
          in: path
          required: true
          schema:
            type: string
            title: Document Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentUpdateResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
      security:
        - APIKeyHeader: []
components:
  schemas:
    DocumentUpdate:
      properties:
        original_filename:
          anyOf:
            - type: string
            - type: 'null'
          title: Original Filename
          description: The original filename of the document
        metadata:
          properties:
            title:
              anyOf:
                - type: string
                - type: 'null'
              title: Document title
              description: The new title of the document
            keywords:
              anyOf:
                - items:
                    type: string
                  type: array
                - type: 'null'
              title: Document title
              description: The new title of the document
          title: Metadata
          description: The metadata of the document
      type: object
      title: DocumentUpdate
    DocumentUpdateResponse:
      properties:
        form_id:
          type: string
          title: Form ID
        form_description:
          type: string
          title: Form Description
        form_title:
          type: string
          title: Form Title
        form_name:
          type: string
          title: Form Name
        original_form_name:
          type: string
          title: Original Form Name
        form_url:
          type: string
          title: Form URL
        updated_at:
          type: string
          format: date-time
          title: Updated At
        created_at:
          type: string
          format: date-time
          title: Created At
        last_filled_at:
          type: string
          format: date-time
          title: Last Filled At
        file_size:
          type: integer
          title: File Size
        fillable_field_count:
          type: integer
          title: Fillable Field Count
        source_document_details:
          type: array
          title: Source Document Details
          items:
            type: object
            properties:
              file_key:
                type: string
              external_document_id:
                type: string
              document_id:
                type: string
              extension:
                type: string
              original_filename:
                type: string
              metadata:
                type: object
                additionalProperties: {}
              created_at:
                type: string
                format: date-time
              updated_at:
                type: string
                format: date-time
      type: object
      required:
        - form_id
        - form_name
        - original_form_name
        - created_at
        - updated_at
      title: DocumentUpdateResponse
    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:
    APIKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key

````