# Update Document

PATCH https://fai.buildwithfern.com/document/{domain}/{document_id}
Content-Type: application/json

Reference: https://buildwithfern.com/learn/docs/ai-features/ask-fern/api-reference/document/update-document

## OpenAPI Specification

```yaml
openapi: 3.1.1
info:
  title: Update Document
  version: endpoint_document.update_document
paths:
  /document/{domain}/{document_id}:
    patch:
      operationId: update-document
      summary: Update Document
      tags:
        - - subpackage_document
      parameters:
        - name: domain
          in: path
          required: true
          schema:
            type: string
        - name: document_id
          in: path
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: >-
            Bearer authentication of the form `Bearer <token>`, where token is
            your auth token.
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UpdateDocumentResponse'
        '422':
          description: Validation Error
          content: {}
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateDocumentRequest'
components:
  schemas:
    UpdateDocumentRequest:
      type: object
      properties:
        document:
          type:
            - string
            - 'null'
          description: >-
            The updated content of the document that will be returned to Ask
            Fern during document retrieval. If not provided, this field will
            remain unchanged.
        chunk:
          type:
            - string
            - 'null'
          description: >-
            The updated textual content that should be vectorized when indexing
            the document. If not provided, this field will remain unchanged.
        title:
          type:
            - string
            - 'null'
          description: >-
            The updated title of the document. If not provided, this field will
            remain unchanged.
        url:
          type:
            - string
            - 'null'
          description: >-
            The updated url of the document. If not provided, this field will
            remain unchanged.
        version:
          type:
            - string
            - 'null'
          description: >-
            The updated version of the document. If not provided, this field
            will remain unchanged.
        product:
          type:
            - string
            - 'null'
          description: >-
            The updated product of the document. If not provided, this field
            will remain unchanged.
        keywords:
          type:
            - array
            - 'null'
          items:
            type: string
          description: >-
            The updated keywords of the document. If not provided, this field
            will remain unchanged.
        authed:
          type:
            - boolean
            - 'null'
          description: >-
            The updated authed status of the document. If not provided, this
            field will remain unchanged.
    Document:
      type: object
      properties:
        document_id:
          type: string
        domain:
          type: string
        chunk:
          type: string
        document:
          type: string
        title:
          type:
            - string
            - 'null'
        url:
          type:
            - string
            - 'null'
        version:
          type:
            - string
            - 'null'
        product:
          type:
            - string
            - 'null'
        keywords:
          type:
            - array
            - 'null'
          items:
            type: string
        authed:
          type:
            - boolean
            - 'null'
        created_at:
          type: string
          format: date-time
        updated_at:
          type: string
          format: date-time
      required:
        - document_id
        - domain
        - chunk
        - document
        - created_at
        - updated_at
    UpdateDocumentResponse:
      type: object
      properties:
        document:
          $ref: '#/components/schemas/Document'
          description: The updated document
      required:
        - document

```