# read_storage_file

Source: https://modulify.ai/docs/api/storage/read-storage-file

Returns the contents of one stored file, base64 encoded.

- Title: Read a stored file
- Scope: `data:read`
- Access: Read only
- Endpoint: `POST /v1/read_storage_file`

The bytes arrive base64 encoded in a `content` field alongside the content type and size, so decode them before use. Pass the full key exactly as `list_storage_files` returned it.

Files over 5 MB are refused with a `413`, but the practical limit is far lower. A tool result is cut off at 60,000 characters and base64 inflates by a third, so any file larger than about three quarters of that many bytes comes back truncated and will not decode. Use it for small text, JSON, CSV and SVG files, and `get_storage_file_url` for anything bigger.

It reads the `CMS` folder at the top level like any other folder, and keeps working while a storage backup is being restored. See [The CMS folder](https://modulify.ai/docs/data/storage#the-cms-folder).

## Request

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

Over MCP, the same method is the [read_storage_file tool](https://modulify.ai/docs/mcp/storage/read-storage-file).

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `projectId` | string | Yes | The site id. |
| `key` | string | Yes | The full key of the file, from `list_storage_files`. |

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