---
title: "File documents"
description: "Files documents you own into the workspace."
canonical_url: https://docs.markdrop.in/api/folders/file-documents
last_updated: 2026-10-30
site: "Markdrop Docs"
index: https://docs.markdrop.in/llms.txt
---

# File documents

`POST https://api.markdrop.in/api/v1/workspaces/{workspace_id}/items/add`

Files documents you own into the workspace. Their access stays the same unless you send `access`.

- **Authentication:** API token required: `Authorization: Bearer mdk_…`.
- **Rate limit:** 60 per minute per IP address.
- **MCP tool:** `add_to_workspace` ([tools](https://docs.markdrop.in/ai/tools))

## 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.

- `slugs` (array of string, required): Addresses of documents you own. 1–200 items.
- `folder_id` (string): File them in this folder. Leave it out for the top level.
- `access` ("link" | "private" | "workspace"): Also change who can open them. Left out, their access doesn't change.

## 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`).
- `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/items/add \
  -H "Authorization: Bearer $MARKDROP_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"slugs":["k3x9q2m"],"folder_id":"FOLDER_ID"}'
```

**JavaScript**

```javascript
const res = await fetch("https://api.markdrop.in/api/v1/workspaces/WORKSPACE_ID/items/add", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MARKDROP_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "slugs": [
      "k3x9q2m"
    ],
    "folder_id": "FOLDER_ID"
  }),
});
const data = await res.json();
```

**Python**

```python
import os

import requests

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