> ## 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.

# Delete a document and all its chunks

> Remove a document from the knowledge base:

1. Delete vector points from Qdrant.
2. Delete rows from ``knowledge_chunks`` and ``knowledge_documents``
   (PostgreSQL CASCADE handles the chunks automatically).
3. If ``source == 'filesystem'``, delete the raw file from disk.



## OpenAPI

````yaml /api-reference/knowledge-api.json delete /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}:
    delete:
      tags:
        - ingest
        - ingest
      summary: Delete a document and all its chunks
      description: |-
        Remove a document from the knowledge base:

        1. Delete vector points from Qdrant.
        2. Delete rows from ``knowledge_chunks`` and ``knowledge_documents``
           (PostgreSQL CASCADE handles the chunks automatically).
        3. If ``source == 'filesystem'``, delete the raw file from disk.
      operationId: delete_document_v1_knowledge_documents__doc_id__delete
      parameters:
        - name: doc_id
          in: path
          required: true
          schema:
            type: string
            title: Doc Id
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DeleteResponse'
        '404':
          description: Document not found
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '503':
          description: PostgreSQL unavailable
components:
  schemas:
    DeleteResponse:
      properties:
        doc_id:
          type: string
          title: Doc Id
        deleted:
          type: boolean
          title: Deleted
        message:
          type: string
          title: Message
      type: object
      required:
        - doc_id
        - deleted
        - message
      title: DeleteResponse
      description: Response for DELETE /v1/knowledge/documents/{doc_id}.
    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
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````