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

# Delete source

> Delete a knowledge-base source and restore usage quota

Deletes a knowledge-base source (file, URL, or domain) and restores related usage quota.

<Warning>
  This action cannot be undone.
</Warning>

## Authentication

<ParamField header="X-API-Key" type="string" required>
  Project API key for this organization and project. Format: `bot_live_…`
</ParamField>

## Path parameters

<ParamField path="organization_id" type="string" required>
  Organization ID. Must match the API key.
</ParamField>

<ParamField path="project_id" type="string" required>
  Project ID. Must match the API key.
</ParamField>

<ParamField path="source_id" type="string" required>
  Source / document ID.
</ParamField>

## Response

Success message. `data` is typically `null`.

## Errors

<ResponseField name="401" type="Unauthorized">
  Missing, invalid, or revoked API key.
</ResponseField>

<ResponseField name="403" type="Forbidden">
  API key is not authorized for this organization or project.
</ResponseField>

<ResponseField name="404" type="Not Found">
  Source not found.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X DELETE "https://backend.botcadence.com/organizations/ORG_ID/projects/PROJECT_ID/sources/SOURCE_ID" \
    -H "X-API-Key: bot_live_YOUR_KEY"
  ```

  ```javascript JavaScript theme={null}
  await fetch(
    `https://backend.botcadence.com/organizations/${organizationId}/projects/${projectId}/sources/${sourceId}`,
    {
      method: "DELETE",
      headers: { "X-API-Key": process.env.BOTCADENCE_API_KEY },
    }
  );
  ```

  ```python Python theme={null}
  import os
  import requests

  requests.delete(
      f"https://backend.botcadence.com/organizations/{organization_id}/projects/{project_id}/sources/{source_id}",
      headers={"X-API-Key": os.environ["BOTCADENCE_API_KEY"]},
  )
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "status": "success",
    "message": "Document deleted successfully",
    "data": null,
    "status_code": 200
  }
  ```
</ResponseExample>
