# clear_storage_backups

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

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

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

It is the same as **Delete all storage backups** in the editor. All of the archives are destroyed and cannot be recovered, so the site is left with no copy of its files 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 taken is left alone. While a restore of the site's storage is running, the whole call is refused with a `409` and `A restore of this storage is still running, so its backups cannot be deleted yet. Try again when it finishes!`, and `get_storage_restore_status` says when that restore ends.

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. `pending` counts the archives still being taken that were left alone, which stay in the list and read `ready` or `failed` in `list_storage_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_storage_backups` and confirm it with you before calling it, and never to call it to tidy up on its own initiative. See [Delete a backup](https://modulify.ai/docs/editor/backups#delete-a-backup).

## Request

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

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

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `projectId` | string | Yes | The site whose storage 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.