# Delete a document

`DELETE` `https://goblins-call-api.onrender.com/v1/knowledge/documents/:id`

Removes the document, everything taken from it and its file. Agents that named it no longer have it on their next call.

Needs a [workspace API key](https://www.cracklehq.com/docs/authentication).

## Path parameters

- `id` (string, required): The document’s ID, such as `kd_4b1f0c9d2e7a6f53`.

## Errors

- `404`: No document in your workspace has that ID.

Every request can also answer `401`, `429` and `500`: see [Errors](https://www.cracklehq.com/docs/errors).

Request:

cURL:

```bash
curl -X DELETE "https://goblins-call-api.onrender.com/v1/knowledge/documents/kd_4b1f0c9d2e7a6f53" \
  -H "Authorization: Bearer $CRACKLE_API_KEY"
```

Node.js:

```js
const response = await fetch('https://goblins-call-api.onrender.com/v1/knowledge/documents/kd_4b1f0c9d2e7a6f53', {
  method: 'DELETE',
  headers: {
    Authorization: `Bearer ${process.env.CRACKLE_API_KEY}`,
  },
});
if (!response.ok) throw new Error(await response.text());
const data = await response.json();
```

Python:

```python
import os
import requests

response = requests.delete(
    "https://goblins-call-api.onrender.com/v1/knowledge/documents/kd_4b1f0c9d2e7a6f53",
    headers={"Authorization": f"Bearer {os.environ['CRACKLE_API_KEY']}"},
    timeout=30,
)
response.raise_for_status()
data = response.json()
```

Response · 200 OK:

```json
{
  "ok": true,
  "id": "kd_4b1f0c9d2e7a6f53"
}
```

Source: https://www.cracklehq.com/docs/reference/knowledge/delete
