---
title: "Remove a file from a draft comment"
description: "Removes a file you uploaded before it's posted."
canonical_url: https://docs.markdrop.in/api/comments/remove-a-file-from-a-draft-comment
last_updated: 2026-11-20
site: "Markdrop Docs"
index: https://docs.markdrop.in/llms.txt
---

# Remove a file from a draft comment

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

Removes a file you uploaded before it's posted.

- **Authentication:** API token required: `Authorization: Bearer mdk_…`.
- **Rate limit:** 60 per minute per IP address.
- **Guide:** [Comments](https://docs.markdrop.in/collaboration/comments#images-and-files)

## Path parameters

- `slug` (string, required): The document's address: the part after `markdrop.in/`.
- `attachment_id` (string, required): Matches `^[0-9a-f]{24}$`.

## Headers

- `X-Read-Password` (string): The password of a password-protected document.
- `X-Markdrop-Workspace` (string): A workspace's id: answer only if the document is in that workspace, else `404`. Workspace domains send it; you rarely need it.

## Responses

- `204`: No content.
- `401`: No token, or the token is revoked or mistyped.
- `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/comments/attachments/ATTACHMENT_ID \
  -H "Authorization: Bearer $MARKDROP_TOKEN"
```

**JavaScript**

```javascript
const res = await fetch("https://api.markdrop.in/api/v1/documents/k3x9q2m/comments/attachments/ATTACHMENT_ID", {
  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/comments/attachments/ATTACHMENT_ID",
    headers={"Authorization": f"Bearer {os.environ['MARKDROP_TOKEN']}"},
)
r.raise_for_status()
```
