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

# Delete a knowledge document

> Permanently removes a document and all its chunks from the knowledge base. Search results will no longer include content from this document.



## OpenAPI

````yaml /openapi.json delete /api/v1/knowledge-documents/{id}
openapi: 3.1.1
info:
  title: PromptJuggler
  description: PromptJuggler API
  version: 1.0.0
servers:
  - url: https://promptjuggler.com
security:
  - Bearer: []
tags:
  - name: Prompts
    description: Fetch prompts and revisions.
  - name: Prompt Runs
    description: Execute published prompts and retrieve results.
  - name: Workflow Runs
    description: Execute multi-step workflows and retrieve results.
  - name: Knowledge Bases
    description: Upload and manage documents used for retrieval-augmented generation.
paths:
  /api/v1/knowledge-documents/{id}:
    delete:
      tags:
        - Knowledge Bases
      summary: Delete a knowledge document
      description: >-
        Permanently removes a document and all its chunks from the knowledge
        base. Search results will no longer include content from this document.
      operationId: public_delete_document
      parameters:
        - name: id
          in: path
          description: Document ID
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '204':
          description: Document deleted
        '401':
          description: Missing or invalid API key
        '403':
          description: No active subscription
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '404':
          description: Document not found
      x-codeSamples:
        - lang: PHP
          label: PromptJuggler PHP SDK
          source: $pj->deleteKnowledgeDocument('01J...');
        - lang: TypeScript
          label: PromptJuggler TypeScript SDK
          source: await pj.deleteKnowledgeDocument('01J...');
        - lang: Python
          label: PromptJuggler Python SDK
          source: pj.delete_knowledge_document('01J...')
        - lang: Java
          label: PromptJuggler Java SDK
          source: pj.deleteKnowledgeDocument("01J...");
        - lang: Go
          label: PromptJuggler Go SDK
          source: err := pj.DeleteKnowledgeDocument(ctx, "01J...")
components:
  schemas:
    ErrorResponse:
      description: Error response.
      required:
        - error
      properties:
        error:
          description: Error message.
          type: string
      type: object
  securitySchemes:
    Bearer:
      type: http
      scheme: bearer

````