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

# Delete a source and all its documents

> Disconnect a source and remove every document it produced, their versions, the indexed content and its jobs. The content stops being cited; nothing is undone.

Deleting a source removes its documents, their stored versions, the indexed content retrieval answers from, and the source's ingestion jobs. The removed content stops being cited in answers. This cannot be undone. To ingest the same content again, create a new source and sync it. For an `upload` source, the files you uploaded are not deleted from storage.

Deleting a source requires a role that can delete documents. A read-only member receives `403`. An unknown ID, a malformed ID, or another organization's source returns `404`.

<ParamField path="source_id" type="string" required>
  Source ID (a UUID).
</ParamField>

## Response

Returns `204` with an empty body.

<RequestExample>
  ```bash cURL theme={"theme":{"light":"github-light","dark":"github-dark"}}
  curl --request DELETE "$MITHUNAI_URL/arukz/api/v1/knowledge/sources/5d1e7a90-3c4b-4f2a-8e61-7b9c0d2f4a13" \
    --header "Authorization: Bearer $MITHUNAI_API_KEY"
  ```

  ```python Python theme={"theme":{"light":"github-light","dark":"github-dark"}}
  import os, requests

  source_id = "5d1e7a90-3c4b-4f2a-8e61-7b9c0d2f4a13"
  response = requests.delete(
      f"{os.environ['MITHUNAI_URL']}/arukz/api/v1/knowledge/sources/{source_id}",
      headers={"Authorization": f"Bearer {os.environ['MITHUNAI_API_KEY']}"},
      timeout=60,
  )
  response.raise_for_status()
  print(response.status_code)
  ```

  ```javascript JavaScript theme={"theme":{"light":"github-light","dark":"github-dark"}}
  const sourceId = '5d1e7a90-3c4b-4f2a-8e61-7b9c0d2f4a13'
  const response = await fetch(
    `${process.env.MITHUNAI_URL}/arukz/api/v1/knowledge/sources/${sourceId}`,
    {
      method: 'DELETE',
      headers: { Authorization: `Bearer ${process.env.MITHUNAI_API_KEY}` },
    },
  )
  console.log(response.status)
  ```
</RequestExample>

<ResponseExample>
  ```text 204 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  (empty body)
  ```

  ```json 403 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  { "code": "authorization_error", "message": "You do not have permission to perform this action." }
  ```

  ```json 404 theme={"theme":{"light":"github-light","dark":"github-dark"}}
  { "code": "not_found", "message": "The knowledge source was not found." }
  ```
</ResponseExample>
