# move_sites_to_folder

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

Puts one or more sites into a folder, at most 200 per call, moving them out of whichever folder they were in.

- Title: Move sites into a folder
- Scope: `sites:write`
- Access: Makes changes
- Endpoint: `POST /v1/move_sites_to_folder`

A site belongs to at most one folder, and a folder only ever holds sites from its own workspace. Moving an archived site into a folder also takes it out of the Archive, and those ids come back in `unarchivedIds`. Nothing else about the sites changes.

Sites from another workspace, sites already in the folder and deleted sites are skipped rather than failing the call, so read `movedIds` in the response to see what actually moved. When every site is skipped, the whole call is refused instead of returning an empty result. See [Folders](https://modulify.ai/docs/projects/folders#add-projects-to-a-folder).

## Request

Call it with a `POST` to `https://api.modulify.ai/v1/move_sites_to_folder`, 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/move_sites_to_folder \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"folderId":"FOLDER_ID","projectIds":[]}'
```

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

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `folderId` | string | Yes | The destination folder, from `list_folders`. |
| `projectIds` | array of strings | Yes | The site ids to move in, from `list_sites`, at most 200. |

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