---
title: "Update a folder"
method: PATCH
path: "/api/v1/folders/{id}"
tags: ["Folders"]
---

# Update a folder

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

## Request

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

Updates a folder owned by the authenticated user. Provide at least one of name, description, or parent_id. Renaming or moving disambiguates the name against the destination siblings. Setting parent_id reparents the folder (null moves it to the top level); moving a folder under itself, one of its own descendants, or into a different workspace is rejected with 400.

## Path parameters

- `id` string, uuid, required

## Request body

- PatchFolderInput: At least one of name, description, or parent_id must be provided.
  - `name` string
  - `description` string
  - `parent_id` string, uuid, nullable

## Response `200`

Updated folder.

- Folder
  - `id` string, uuid, required
  - `name` string, required
  - `description` string, nullable, required
  - `parent_id` string, uuid, nullable, required
  - `workspace_id` string, uuid, required: The workspace this folder belongs to.
  - `path` PathSegment[]: Full path from the workspace root down to this folder, workspace first. Returned by the list and get endpoints; omitted from create and update responses.
    - `id` string, uuid, required
    - `name` string, required
    - `type` 'workspace' | 'folder' | 'document', required
  - `path_string` string: Path segment names joined by " / ". Returned by the list and get endpoints; omitted from create and update responses.
  - `created_at` string, date-time, required
  - `updated_at` string, date-time, required

## Other responses

- `400`: Request body was malformed or failed validation.
- `401`: Missing, malformed, invalid, or revoked bearer token. The body includes a `message` field with guidance for authenticating, and the response carries a `WWW-Authenticate` challenge.
- `403`: The bearer token is valid but its owner cannot use the API. Agent control (REST + MCP) requires an MDflow Pro plan, so a token owned by a non-Pro account returns 403 on every endpoint. POST /api/v1/documents additionally returns 403 when the account reaches its document limit. The body includes a `message` field with guidance.
- `404`: Folder was not found or is not owned by the authenticated user.
- `429`: The token or authenticated user exceeded a 60 requests per minute rate limit.
- `500`: Unexpected server error.

---

[API](https://skmtc.dev/mdflow/apis/mdflow-public-api.md) · [All operations](https://skmtc.dev/mdflow/apis/mdflow-public-api/llms.txt) · [OpenAPI document](https://skmtc.dev/mdflow/apis/mdflow-public-api/revisions/3691fc5d1688?raw)
