---
title: "Create a folder under a project"
method: POST
path: "/api/v1/projects/{id}/folders"
tags: ["workspace"]
---

# Create a folder under a project

`POST /api/v1/projects/{id}/folders`

## Request

- Base URL: `https://mdtidy.com`
- URL: `https://mdtidy.com/api/v1/projects/{id}/folders`
- Auth: HTTP bearer

## Request body

- CreateFolderRequest
  - `name` string, required
  - `parent_folder_id` string, uuid, nullable: Optional parent folder (nesting). When set, the folder is created inside it; omit/null for the project root. Must belong to the addressed project.

## Response `201`

Folder created.

- Folder
  - `id` string, uuid, required
  - `type` 'folder', required
  - `project_id` string, uuid, required
  - `parent_id` string, uuid, required: Immediate parent: the project id (root folder) or another folder id.
  - `name` string, required
  - `created_at` string, required
  - `updated_at` string, required

## Other responses

- `401`: X-API-KEY is malformed, unknown, or revoked.
- `404`: Resource not found, or not owned by the caller (IDOR-safe).
- `409`: Name collision, stale write, or a resource limit was reached.
- `422`: Request body failed validation.
- `429`: Per-key rate limit (60/min) exceeded.

---

[API](https://skmtc.dev/mdtidy/apis/markdown-tidy-api.md) · [All operations](https://skmtc.dev/mdtidy/apis/markdown-tidy-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mdtidy/apis/markdown-tidy-api/revisions/caeec6fad155?raw)
