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

# Rename a folder

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

## Request

- Base URL: `https://app.khotan.com`
- URL: `https://app.khotan.com/api/v1/folders/{folderId}`
- Auth: one of:
  - HTTP bearer
  - API key in header `x-api-key`

Renames the folder. Descendant folder paths update automatically; previously stored paths into the subtree stop resolving, so store folder ids rather than paths. Sibling name conflicts respond 409.

## Path parameters

- `folderId` string, required

## Request body

- object
  - `name` string, required

## Response `200`

The renamed folder.

- object
  - `id` string, required
  - `name` string, required
  - `parentId` string, nullable, required: The parent folder's id, or null for a top-level folder.
  - `path` string, required: The folder's full path. Paths change on rename; store ids.

## Other responses

- `400`: The request was malformed or failed validation.
- `401`: Authentication is missing or invalid.
- `403`: The caller is not permitted to perform this action.
- `404`: The resource was not found.
- `409`: Response.
- `429`: Too many requests; retry after the indicated delay.

---

[API](https://skmtc.dev/khotan/apis/khotan-api.md) - [All operations](https://skmtc.dev/khotan/apis/khotan-api/llms.txt) - [OpenAPI document](https://skmtc.dev/khotan/apis/khotan-api/revisions/90b512a53e42?raw)
