# reorder_folders

Source: https://modulify.ai/docs/api/folders/reorder-folders

Sets the order the folders of a workspace appear in on the dashboard.

- Title: Reorder the folders
- Scope: `sites:write`
- Access: Makes changes
- Endpoint: `POST /v1/reorder_folders`

Send every folder id in the order you want them. Each id you send takes its position from the list, while a folder you leave out keeps its old position and can end up tied with one you sent. Ids that do not belong to the workspace are ignored and the call still reports success, so call `list_folders` afterwards to confirm.

It needs the **Edit folders** permission in that workspace, and being a folder's creator is not enough. The built-in Archive is not a folder: it is not in `list_folders` and keeps its place in the sidebar. See [Folders](https://modulify.ai/docs/projects/folders#reorder-folders).

## Request

Call it with a `POST` to `https://api.modulify.ai/v1/reorder_folders`, sending the inputs below as a JSON object. The token needs the `sites:write` scope.

It makes changes, so send an [Idempotency-Key](https://modulify.ai/docs/api/idempotency) header whenever you might retry it. A retry with the same key gets the first answer back instead of running again.

```bash
curl -X POST https://api.modulify.ai/v1/reorder_folders \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"workspaceId":"WORKSPACE_ID","folderIds":[]}'
```

Over MCP, the same method is the [reorder_folders tool](https://modulify.ai/docs/mcp/folders/reorder-folders).

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `workspaceId` | string | Yes | The workspace whose folders are being ordered. |
| `folderIds` | array of strings | Yes | Every folder id, in the order they should appear. An empty list is refused. |

## Response

Every call answers with the [JSON envelope](https://modulify.ai/docs/api/requests-and-responses#the-response) of `success`, `message`, `data`, `code` and `version`. `data` holds the result described above, and on a method that returns a total, `count` carries it. The [response headers](https://modulify.ai/docs/api/requests-and-responses#headers-on-every-method-call) carry the call's `X-Request-Id` and what is left of your per-minute budget in `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. [Errors](https://modulify.ai/docs/api/errors) explains every status code a call can answer with.