# list_code_backups

Source: https://modulify.ai/docs/api/backups/list-code-backups

Lists the code backup history of a site, newest first, with the title, file count and author of each code backup.

- Title: List site code backups
- Scope: `chat:read`
- Access: Read only
- Endpoint: `POST /v1/list_code_backups`

Each code backup is a commit that changed the site's code. The individual file names are not recorded, so it cannot answer which files a code backup changed.

This is what the editor shows in the **Code** tab of [Backups](https://modulify.ai/docs/editor/backups), and it is separate from the page and component snapshots `list_backups` returns. It returns 10 per page, so pass `page` to go further back, and the response carries the total `count`. Use a row's `_id` as the `codeBackupId` for `restore_code_backup`. See [Read an entry](https://modulify.ai/docs/editor/backups#read-an-entry).

## Request

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

It only reads and changes nothing, so retrying it is safe.

```bash
curl -X POST https://api.modulify.ai/v1/list_code_backups \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"projectId":"PROJECT_ID"}'
```

Over MCP, the same method is the [list_code_backups tool](https://modulify.ai/docs/mcp/backups/list-code-backups).

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `projectId` | string | Yes | The site id. |
| `page` | integer | No | Which page of history to read, starting at 1. Defaults to 1. |

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