# move_folder_to_workspace

Source: https://modulify.ai/docs/api/folders/move-folder-to-workspace

Moves a folder and every site inside it into a different workspace, in a one-way move that cannot be undone.

- Title: Move a folder to another workspace
- Scope: `sites:delete`
- Access: Destructive
- Endpoint: `POST /v1/move_folder_to_workspace`

The folder and all of its sites change owner, and each one has its creator rewritten to you, which cannot be recovered. Deleted sites stay behind in the old workspace. The tool tells the client to confirm with you before calling it.

You need the **Move folders** permission in the workspace the folder is leaving and an accepted membership in the one it is going to. The move is refused when the destination already holds a folder with the same name, when the two workspace ids are the same, and when the destination has too few project or site slots left on its plan.

A site whose code was moved to a connected GitHub account has that code copied back to Modulify first. So the move is also refused while that code is still being moved, when the Modulify app lost access to its repository, or when the repository was deleted on GitHub, and it stops when a copy fails, naming any sites whose code was already copied back. These answers start with `The folder was not moved.` See [Move your code to GitHub](https://modulify.ai/docs/editor/move-code-to-github#handing-the-site-to-someone-else).

## Request

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

> **Warning**
>
> This method is marked destructive: it deletes or overwrites data. Check the inputs before you call it, and send an [Idempotency-Key](https://modulify.ai/docs/api/idempotency) header whenever you might retry it.

```bash
curl -X POST https://api.modulify.ai/v1/move_folder_to_workspace \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"folderId":"FOLDER_ID","currentWorkspaceId":"CURRENT_WORKSPACE_ID","workspaceId":"WORKSPACE_ID"}'
```

Over MCP, the same method is the [move_folder_to_workspace tool](https://modulify.ai/docs/mcp/folders/move-folder-to-workspace).

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `folderId` | string | Yes | The folder to move, from `list_folders`. |
| `currentWorkspaceId` | string | Yes | The workspace it is in today. |
| `workspaceId` | string | Yes | The workspace to move it into, from `list_workspaces`. A token limited to specific workspaces must be allowed in both. |

## 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.