---
title: "Delete a folder (409 if it holds active files; archived files move to root)"
method: DELETE
path: "/api/v1/folders/{id}"
tags: ["workspace"]
---

# Delete a folder (409 if it holds active files; archived files move to root)

`DELETE /api/v1/folders/{id}`

## Request

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

By default a folder holding active files is refused with `409 folder_not_empty` and archived files inside move up to the parent. Pass `cascade=true` to permanently delete the entire subtree (files + subfolders, archived included) and sweep its objects.

## Query parameters

- `cascade` boolean

## Response `200`

Deleted.

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