# clear_database_backups

Source: https://modulify.ai/docs/api/backups/clear-database-backups

Permanently deletes every database backup of a site in one call, leaving the live database of the site untouched.

- Title: Delete all database backups
- Scope: `sites:delete`
- Access: Destructive
- Endpoint: `POST /v1/clear_database_backups`

It is the same as **Delete all database backups** in the editor. All of the archives are destroyed and cannot be recovered, so the site is left with no copy of its rows from any earlier moment, and the daily backup only begins building that history again from its next run. Deleting them does not hand any manual backup slot back.

An archive still being exported is left alone. The response counts `removed`, the bytes `freed`, `failed` and `pending`. A failed one could not be reached and is still there, so call it again, and `pending` counts the archives still being exported that were left alone, which stay in the list and read `ready` or `failed` in `list_database_backups` when they finish.

It needs the **Delete projects** permission in the workspace. The tool tells the client to read the whole list with `list_database_backups` and confirm it with you before calling it, and never to call it to tidy up on its own initiative. See [Delete a database backup](https://modulify.ai/docs/editor/backups#delete-a-database-backup).

## Request

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

Over MCP, the same method is the [clear_database_backups tool](https://modulify.ai/docs/mcp/backups/clear-database-backups).

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `projectId` | string | Yes | The site whose database backups should all be deleted. |

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