---
title: "Delete a document"
description: "Deletes a document for good."
canonical_url: https://docs.markdrop.in/api/documents/delete-a-document
last_updated: 2026-10-30
site: "Markdrop Docs"
index: https://docs.markdrop.in/llms.txt
---

# Delete a document

`DELETE https://api.markdrop.in/api/v1/documents/{slug}`

Deletes a document for good. Send a token as the owner, or the document's edit secret in `X-Edit-Secret`.

- **Authentication:** Token optional: send `Authorization: Bearer mdk_…` to act as your account, or the document's edit secret in `X-Edit-Secret`.
- **Rate limit:** 10 per minute per IP address.
- **MCP tool:** `delete_document` ([tools](https://docs.markdrop.in/ai/tools))

## Path parameters

- `slug` (string, required): The document's address: the part after `markdrop.in/`.

## Headers

- `X-Edit-Secret` (string): The document's edit secret (`sk_…`), for a document published without an account. See [Edit key](https://docs.markdrop.in/documents/edit-key).

## Responses

- `204`: No content.
- `422`: The request didn't validate. `detail` lists each problem, with where it is (`loc`) and why (`msg`).
- `429`: Too many requests from your IP address. Wait the seconds in `Retry-After`.

## Examples

**curl**

```bash
curl -X DELETE https://api.markdrop.in/api/v1/documents/k3x9q2m \
  -H "Authorization: Bearer $MARKDROP_TOKEN"
```

**JavaScript**

```javascript
const res = await fetch("https://api.markdrop.in/api/v1/documents/k3x9q2m", {
  method: "DELETE",
  headers: {
    Authorization: `Bearer ${process.env.MARKDROP_TOKEN}`,
  },
});
if (!res.ok) throw new Error(`${res.status}`);
```

**Python**

```python
import os

import requests

r = requests.delete(
    "https://api.markdrop.in/api/v1/documents/k3x9q2m",
    headers={"Authorization": f"Bearer {os.environ['MARKDROP_TOKEN']}"},
)
r.raise_for_status()
```
