# archive_sites

Source: https://modulify.ai/docs/api/sites/archive-sites

Puts one or more sites in the Archive of their workspace, at most 200 per call.

- Title: Archive sites
- Scope: `sites:write`
- Access: Makes changes
- Endpoint: `POST /v1/archive_sites`

Archived sites leave the dashboard lists and `list_sites`, unless `list_sites` is called with `archived` as true, but they still count toward the plan and are billed exactly the same. A site in a folder leaves that folder, and `unarchive_sites` puts it back there when the folder still exists.

Archiving never unpublishes, so a live site stays live. If you also want it offline, the tool tells the client to confirm with you first and then call `unpublish_site`, which needs `publish:write`.

Sites from another workspace, sites already archived and deleted sites are skipped rather than failing the call, so read `archivedIds` in the response to see what was archived. When every site is skipped, the whole call is refused. See [Archive projects](https://modulify.ai/docs/projects/archive).

## Request

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

Over MCP, the same method is the [archive_sites tool](https://modulify.ai/docs/mcp/sites/archive-sites).

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `workspaceId` | string | Yes | The workspace the sites belong to. |
| `projectIds` | array of strings | Yes | The site ids to archive, 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.