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

# Update document metadata (tags, folder grouping)

> Partially update a document's metadata.

Currently supports updating the ``tags`` array, which controls folder
grouping (tags prefixed with ``folder:``) and other categorisation.



## OpenAPI

````yaml /api-reference/knowledge-api.json patch /v1/knowledge/documents/{doc_id}
openapi: 3.1.0
info:
  title: Strattum Knowledge API
  description: >-
    REST API that serves semantic document search — embeddings via the
    configured LLM provider, indexed in Qdrant, with metadata stored in
    PostgreSQL. (PRD-004, Workstream 1.4)
  version: 1.0.0
servers: []
security: []
paths:
  /v1/knowledge/documents/{doc_id}:
    patch:
      tags:
        - knowledge
      summary: Update document metadata (tags, folder grouping)
      description: |-
        Partially update a document's metadata.

        Currently supports updating the ``tags`` array, which controls folder
        grouping (tags prefixed with ``folder:``) and other categorisation.
      operationId: patch_document_v1_knowledge_documents__doc_id__patch
      parameters:
        - name: doc_id
          in: path
          required: true
          schema:
            type: string
            title: Doc Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/DocumentPatchRequest'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DocumentResponse'
        '404':
          description: Document not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '503':
          description: PostgreSQL is unavailable
components:
  schemas:
    DocumentPatchRequest:
      properties:
        tags:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Tags
          description: Replace the document tags array (used for folder grouping, etc.).
      type: object
      title: DocumentPatchRequest
      description: Request body for PATCH /v1/knowledge/documents/{doc_id}.
    DocumentResponse:
      properties:
        doc_id:
          type: string
          title: Doc Id
        source:
          type: string
          title: Source
        title:
          type: string
          title: Title
        content_hash:
          anyOf:
            - type: string
            - type: 'null'
          title: Content Hash
        chunk_count:
          type: integer
          title: Chunk Count
        owner:
          anyOf:
            - type: string
            - type: 'null'
          title: Owner
        tags:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Tags
        summary:
          anyOf:
            - type: string
            - type: 'null'
          title: Summary
        summary_model:
          anyOf:
            - type: string
            - type: 'null'
          title: Summary Model
        status:
          anyOf:
            - type: string
            - type: 'null'
          title: Status
        indexed_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Indexed At
        updated_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Updated At
        entity_tags:
          anyOf:
            - items:
                $ref: '#/components/schemas/EmbeddedTagResponse'
              type: array
            - type: 'null'
          title: Entity Tags
      type: object
      required:
        - doc_id
        - source
        - title
        - chunk_count
      title: DocumentResponse
      description: A single document record from knowledge_documents.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    EmbeddedTagResponse:
      properties:
        tag:
          type: string
          title: Tag
        status:
          type: string
          title: Status
        source:
          type: string
          title: Source
        created_at:
          anyOf:
            - type: string
            - type: 'null'
          title: Created At
      type: object
      required:
        - tag
        - status
        - source
      title: EmbeddedTagResponse
      description: >-
        A tag embedded in a document list response (used when
        include_tags=true).
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````