---
title: "Take the edit lock"
description: "Takes, or renews, a page's edit lock, so nobody else edits it at the same time."
canonical_url: https://docs.markdrop.in/api/pages/take-the-edit-lock
last_updated: 2026-11-04
site: "Markdrop Docs"
index: https://docs.markdrop.in/llms.txt
---

# Take the edit lock

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

Takes, or renews, a page's edit lock, so nobody else edits it at the same time. It lasts two minutes past your last call: renew it every 30 seconds while you edit.

- **Authentication:** API token required: `Authorization: Bearer mdk_…`.
- **Rate limit:** 60 per minute per IP address.
- **Guide:** [Pages and the block editor](https://docs.markdrop.in/pages/overview)

## Path parameters

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

## Responses

- `200`: OK.
- `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`).
- `423`: Someone else is editing: `code` is `locked`, with the `holder`'s name.
- `429`: Too many requests from your IP address. Wait the seconds in `Retry-After`.

## Examples

**curl**

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

**JavaScript**

```javascript
const res = await fetch("https://api.markdrop.in/api/v1/documents/k3x9q2m/lock", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MARKDROP_TOKEN}`,
  },
});
const data = await res.json();
```

**Python**

```python
import os

import requests

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