# clear_storage

Source: https://modulify.ai/docs/mcp/storage/clear-storage

Permanently deletes the files and folders in a site's storage bucket, public and private alike.

- Title: Clear all storage
- Scope: `data:write`
- Access: Destructive

This is the whole bucket, not a folder, and it cannot be undone. Every published page pointing at a stored file breaks immediately. The tool tells the client to read the bucket with `list_storage_files` and confirm the whole contents with you first, and never to call it to tidy up on its own initiative.

Nothing deleted here is in any archive unless one was taken first. When the client has `create_storage_backup`, the tool tells it to take one and wait until `list_storage_backups` reports that backup `ready` before clearing, because a file removed before the archive is read is left out of the zip.

One call removes at most 20,000 objects, and the response sets `complete` to false when more remain, so call it again with the same input until `complete` is true. The response also counts what was removed in `deleted` and what could not be removed in `failed`.

The CDN link and the private storage key survive, so the bucket keeps working, it is simply empty. Every folder visibility setting is deleted too, so files written afterwards follow the top level default until folders are made private again. The `CMS` folder at the top level is kept, because the CMS manages it and deletes its files with their items, as [Clear storage](https://modulify.ai/docs/data/clearing-and-exporting#clear-storage) describes.

Without the **Delete projects** permission in the workspace, the call is refused with a `403` and `You are not allowed to clear the storage of this site!` While a storage backup is being restored, it is refused with a `409` and `Your storage is being restored from a backup. Try again when the restore finishes!` See [While a restore runs](https://modulify.ai/docs/editor/backups#while-a-restore-runs).

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `projectId` | string | Yes | The site id. |