# create_backup

Source: https://modulify.ai/docs/api/backups/create-backup

Takes a snapshot of a site's pages and components as they are right now, so restore_backup can roll the site back to it later.

- Title: Take a site backup
- Scope: `sites:write`
- Access: Makes changes
- Endpoint: `POST /v1/create_backup`

Only the pages and components go into it. Stored files, database rows, environment variables and the site's source files do not, so a restore does not bring them back either. The source code has its own history in the **Code** tab of [Backups](https://modulify.ai/docs/editor/backups), which `list_code_backups` lists.

The snapshot is typed `manual`, and the response carries its row. The name is optional but well worth setting.

## Request

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

Over MCP, the same method is the [create_backup tool](https://modulify.ai/docs/mcp/backups/create-backup).

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `projectId` | string | Yes | The site to snapshot. |
| `name` | string | No | A short label saying what the snapshot is, for example `Before pricing rewrite`. When given, it must be 2 to 84 characters. |

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