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

# Detach from Agent

Detach a knowledge base document from an agent.

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

<ParamField header="Content-Type" type="string" required>
  Must be `application/json`.
</ParamField>

### Request Body

<ParamField body="documentation_id" type="string" required>
  The ID of the document to detach.
</ParamField>

<ParamField body="agent_id" type="string" required>
  The ID of the agent to detach from.
</ParamField>

### Permissions

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

### Response

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

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

<RequestExample>
  ```json Request theme={null}
  {
    "documentation_id": "doc_a1b2c3d4e5f6",
    "agent_id": "agent_b2c3d4e5f6a7"
  }
  ```
</RequestExample>

<ResponseExample>
  ```json Response theme={null}
  {
    "success": true,
    "message": "Document detached from agent successfully"
  }
  ```
</ResponseExample>

### Errors

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