---
title: "Rename a folder in place"
method: POST
path: "/v1/vault/folders/{id}/rename"
tags: ["Vault"]
---

# Rename a folder in place

`POST /v1/vault/folders/{id}/rename`

## Request

- Base URL: `http://localhost:9998`
- URL: `http://localhost:9998/v1/vault/folders/{id}/rename`
- Auth: HTTP bearer

Renames the leaf only (folders split rename from move, mirroring the
native service API). Every descendant path repaths; ids stay stable.
Returns the renamed folder as a bare tree node.

## Path parameters

- `id` string, required

## Request body

- object
  - `newName` string, required: The new leaf name.

## Response `200`

The renamed folder as a bare tree node

- WireVaultTreeNode: A node in the DECRYPTED vault tree. Recursive: a folder carries its children in tree responses. Mutation responses (note move, folder create/rename/move) return the bare relocated node with `children` omitted regardless of kind.
  - `id` string, required: Stable random UUID; unchanged by move/rename.
  - `kind` 'folder' | 'note', required: Whether a vault tree node is a folder or a note.
  - `name` string, required: Leaf display name, no path.
  - `path` string, required: Vault-relative, '/'-separated path, e.g. "ideas/2026/pitch".
  - `children` WireVaultTreeNode[]: Present on a folder in tree responses; omitted on a note and in mutation responses.

## Other responses

- `400`: Invalid request
- `404`: Resource not found
- `409`: The target path is already taken
- `423`: The vault is locked (no VMK loaded). Unlock natively in ToolPiper — there is no unlock route. The body is the standard nested error envelope with type `vault_locked`.
- `503`: Vault service unavailable

---

[API](https://skmtc.dev/modelpiper/apis/toolpiper-api.md) · [All operations](https://skmtc.dev/modelpiper/apis/toolpiper-api/llms.txt) · [OpenAPI document](https://skmtc.dev/modelpiper/apis/toolpiper-api/revisions/6722bf56385c?raw)
