---
title: "Move a document"
description: "Moves one document to a folder (folder_id), or to the top level (null)."
canonical_url: https://docs.markdrop.in/api/folders/move-a-document
last_updated: 2026-10-30
site: "Markdrop Docs"
index: https://docs.markdrop.in/llms.txt
---

# Move a document

`POST https://api.markdrop.in/api/v1/workspaces/{workspace_id}/documents/move`

Moves one document to a folder (`folder_id`), or to the top level (`null`).

- **Authentication:** API token required: `Authorization: Bearer mdk_…`.
- **Rate limit:** 120 per minute per IP address.

## Path parameters

- `workspace_id` (string, required): The workspace's id, from the address of its settings page (`markdrop.in/settings/workspaces/<workspace-id>`) or from [List workspaces](https://docs.markdrop.in/api/workspaces/list-workspaces).

## Request body

`application/json`, required.

- `slug` (string, required): 1–50 characters.
- `folder_id` (string)

## 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 POST https://api.markdrop.in/api/v1/workspaces/WORKSPACE_ID/documents/move \
  -H "Authorization: Bearer $MARKDROP_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"slug":"k3x9q2m","folder_id":"FOLDER_ID"}'
```

**JavaScript**

```javascript
const res = await fetch("https://api.markdrop.in/api/v1/workspaces/WORKSPACE_ID/documents/move", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MARKDROP_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "slug": "k3x9q2m",
    "folder_id": "FOLDER_ID"
  }),
});
if (!res.ok) throw new Error(`${res.status}`);
```

**Python**

```python
import os

import requests

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