# Rename or move a folder

> Page: https://docs.plotwork.dev/api/post-orgs-org-folders-move. Index of every page: https://docs.plotwork.dev/llms.txt

Moves the folders made in the portal at and under `from` to `to`, keeping what is below.

`POST /orgs/{org}/folders/move`

## TL;DR

| Question | Answer |
|---|---|
| What does it do? | Rename or move a folder. |
| What does it take? | A JSON body of type [`MoveFolderBody`](https://docs.plotwork.dev/api/schemas.md#movefolderbody). |
| What does it return? | Status 204 with no body. |
| What can go wrong? | `400` a path breaks the folder rule (validation.failed; details says why); `401` not signed in; `403` the role may not (orgs.forbidden), a rule keeps a place from the caller (orgs.folder_restricted), or the request came from an origin that may not make changes; `404` no such organisation, or the caller is not a member of it; `409` the folder would go into itself or a folder inside it (conflict); `429` too many requests; `503` organisations are not set up on this server. Every failure uses the one error envelope. |

## What it does

Moves the folders made in the portal at and under `from` to `to`, keeping what is below. Diagrams are moved one by one with the diagram route. Owner, admin or member.

## Path parameters

| Field | Type | Required | Description |
|---|---|---|---|
| `org` | `string` | yes | The organisation's id or its slug. |

## Request body

The body has the type [`MoveFolderBody`](https://docs.plotwork.dev/api/schemas.md#movefolderbody).

| Field | Type | Required | Description |
|---|---|---|---|
| `from` | `string` | yes | The folder that moves, with every folder inside it. at most 204 characters; pattern `^[A-Za-z0-9_-]+(?: [A-Za-z0-9_-]+)*(?:/[A-Za-z0-9_-]+(?: [A-Za-z0-9_-]+)*){0,4}$`. |
| `to` | `string` | yes | Where it goes: its new path, which may rename it, move it, or both. at most 204 characters; pattern `^[A-Za-z0-9_-]+(?: [A-Za-z0-9_-]+)*(?:/[A-Za-z0-9_-]+(?: [A-Za-z0-9_-]+)*){0,4}$`. |

## Responses

| Status | Meaning | Body |
|---|---|---|
| 204 | The folders moved, or there were none. | none |
| 400 | A path breaks the folder rule (validation.failed; details says why). | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 401 | Not signed in. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 403 | The role may not (orgs.forbidden), a rule keeps a place from the caller (orgs.folder_restricted), or the request came from an origin that may not make changes. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 404 | No such organisation, or the caller is not a member of it. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 409 | The folder would go into itself or a folder inside it (conflict). | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 429 | Too many requests. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |
| 503 | Organisations are not set up on this server. | [`ErrorResponse`](https://docs.plotwork.dev/api/schemas.md#errorresponse) |

## See also

| Doc | Why |
|---|---|
| [API reference](https://docs.plotwork.dev/api/reference.md) | Every endpoint, and the error envelope |
| [Schemas](https://docs.plotwork.dev/api/schemas.md) | Every request and response type |
| [Tool reference](https://docs.plotwork.dev/mcp/tools.md) | The operations as callable tools |
