---
title: "Create a folder"
description: "Creates a folder at the top level, or inside another folder with parent_id."
canonical_url: https://docs.markdrop.in/api/folders/create-a-folder
last_updated: 2026-10-30
site: "Markdrop Docs"
index: https://docs.markdrop.in/llms.txt
---

# Create a folder

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

Creates a folder at the top level, or inside another folder with `parent_id`.

- **Authentication:** API token required: `Authorization: Bearer mdk_…`.
- **Rate limit:** 60 per minute per IP address.
- **Guide:** [Folders](https://docs.markdrop.in/workspaces/folders)

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

- `name` (string, required): 1–80 characters.
- `parent_id` (string): Create it inside this folder. Leave it out for the top level.

## Responses

- `201`: Created.
  - `id` (string)
  - `workspace_id` (string)
  - `name` (string)
  - `parent_id` (string | null)
  - `created_at` (string (date-time)): ISO 8601, for example `2026-11-30T12:00:00Z`.
  - `updated_at` (string (date-time)): ISO 8601, for example `2026-11-30T12:00:00Z`.
  - `slug` (string): Default `""`.
  - `path` (array of string)
- `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/folders \
  -H "Authorization: Bearer $MARKDROP_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"name":"Guides"}'
```

**JavaScript**

```javascript
const res = await fetch("https://api.markdrop.in/api/v1/workspaces/WORKSPACE_ID/folders", {
  method: "POST",
  headers: {
    Authorization: `Bearer ${process.env.MARKDROP_TOKEN}`,
    "Content-Type": "application/json",
  },
  body: JSON.stringify({
    "name": "Guides"
  }),
});
const data = await res.json();
```

**Python**

```python
import os

import requests

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