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

# Delete Document

Delete a knowledge base document. This removes it from storage and all agent attachments.

<Warning>
  Cannot delete documents that are attached to agents. Detach first using the detach endpoint.
</Warning>

### Headers

<ParamField header="X-API-Key" type="string" required>
  Your API key for authentication.
</ParamField>

<ParamField header="X-Organization-Id" type="string" required>
  The organization ID.
</ParamField>

### Path Parameters

<ParamField path="documentation_id" type="string" required>
  The unique identifier of the document to delete.
</ParamField>

### Permissions

* `kb:delete` (admin, agent\_manager)

### Response

<ResponseField name="success" type="boolean">
  Indicates if the deletion was successful.
</ResponseField>

<ResponseField name="message" type="string">
  Human-readable success message.
</ResponseField>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "message": "Document 'Product Manual' deleted successfully"
  }
  ```
</ResponseExample>

### Errors

<ResponseField name="404" type="object">
  Document not found.
</ResponseField>

<ResponseField name="403" type="object">
  Document belongs to different organization.
</ResponseField>

<ResponseField name="409" type="object">
  Cannot delete - document is attached to agents. Detach it first.
</ResponseField>
