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

# Delete Document

> Permanently delete a document and its file from storage



## OpenAPI

````yaml api/openapi.json delete /api/documents/{id}
openapi: 3.1.0
info:
  version: '0.1'
  title: Orchata API
servers:
  - url: https://api.orchata.ai
    description: Orchata API Server
security:
  - ApiKey: []
paths:
  /api/documents/{id}:
    delete:
      tags:
        - Documents
      summary: Delete Document
      description: Permanently delete a document and its file from storage
      parameters:
        - schema:
            type: string
            example: document_123
          required: true
          name: id
          in: path
        - schema:
            type: string
            example: space_123
            description: The ID of the space containing the documents
          required: true
          description: The ID of the space containing the documents
          name: spaceId
          in: query
      responses:
        '200':
          description: Document deleted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  message:
                    type: string
                required:
                  - success
                  - message
        '404':
          description: Document not found
      x-codeSamples:
        - lang: typescript
          label: TypeScript SDK
          source: |-
            import { Orchata } from '@orchata-ai/sdk';

            const client = new Orchata({ apiKey: 'oai_your_api_key' });

            await client.documents.delete('doc_123', 'space_123');
components:
  securitySchemes:
    ApiKey:
      type: apiKey
      in: header
      name: Oai-Api-Key

````