# get_storage_stats

Source: https://modulify.ai/docs/api/storage/get-storage-stats

Reads how much a site is storing, with the total number of files, the number of folders and the combined size in bytes.

- Title: Get storage usage
- Scope: `data:read`
- Access: Read only
- Endpoint: `POST /v1/get_storage_stats`

Use it to answer how big a bucket has grown before deciding what to clear out. The totals come back as `objectCount`, `folderCount` and `totalSize`, in bytes.

The scan is capped, so a very large bucket comes back with `truncated` set to true and the numbers are a floor rather than an exact total. It keeps working while a storage backup is being restored. See [Usage and limits](https://modulify.ai/docs/data/storage#usage-and-limits).

## Request

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

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

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

Over MCP, the same method is the [get_storage_stats tool](https://modulify.ai/docs/mcp/storage/get-storage-stats).

## Inputs

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

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