---
title: "Delete a file version"
description: "Deletes one earlier version for good and frees its space."
canonical_url: https://docs.markdrop.in/api/files/delete-a-file-version
last_updated: 2026-10-30
site: "Markdrop Docs"
index: https://docs.markdrop.in/llms.txt
---

# Delete a file version

`DELETE https://api.markdrop.in/api/v1/files/{slug}/versions/{version}`

Deletes one earlier version for good and frees its space. Only the file's owner can do this, and never for the current version.

- **Authentication:** API token required: `Authorization: Bearer mdk_…`.
- **Rate limit:** 30 per minute per IP address.
- **Guide:** [Replace and versions](https://docs.markdrop.in/files/replace-and-versions)

## Path parameters

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

## Responses

- `204`: Deleted.
- `401`: No token, or the token is revoked or mistyped.
- `403`: You can edit the file but don't own it.
- `404`: That version isn't kept.
- `409`: That's the current version. Restore another one first, or delete the file.
- `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/files/k3x9q2m/versions/1 \
  -H "Authorization: Bearer $MARKDROP_TOKEN"
```

**JavaScript**

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