# Storage

How much email each of your mailboxes holds.

An SDK signs every request with your key: [Authentication](https://mailset.app/docs/authentication.md). To sign one yourself, see [Calling the API without an SDK](https://mailset.app/docs/authentication/http.md).

## storage.usage

Show how much mail each mailbox holds.

`POST /v1/storage.usage`

Any signed-in person, with an API token.

### Parameters

It takes no input: send an empty object.

### Returns

`data` is an object with:

- `mailboxes` (array of objects)
  - `address` (string)
  - `messages` (number)
  - `bytes` (number)
- `contactPhotos` (number): Photos saved on contacts, which belong to the person and not a mailbox.
- `bytes` (number)
- `messages` (number)

### Request

TypeScript:

```typescript
import { Mailset } from 'mailset';

// Reads MAILSET_TOKEN from the environment.
const mailset = new Mailset();

const answer = await mailset.storage.usage();
console.log(answer);
```

Python:

```python
from mailset import Mailset

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset()

answer = mailset.storage.usage()
print(answer)
```

Go:

```go
package main

import (
	"context"
	"fmt"
	"log"

	mailset "mailset.app/go"
)

func main() {
	// Reads MAILSET_TOKEN from the environment.
	client, err := mailset.NewClient()
	if err != nil {
		log.Fatal(err)
	}
	ctx := context.Background()
	answer, err := client.Storage.Usage(ctx)
	if err != nil {
		log.Fatal(err)
	}
	fmt.Println(answer)
}
```

Ruby:

```ruby
require 'mailset'

# Reads MAILSET_TOKEN from the environment.
mailset = Mailset::Client.new

answer = mailset.storage.usage
p answer
```

PHP:

```php
<?php

require 'vendor/autoload.php';

// Reads MAILSET_TOKEN from the environment.
$mailset = new Mailset\Client();

$answer = $mailset->storage->usage();
echo json_encode($answer, JSON_PRETTY_PRINT), PHP_EOL;
```

Java:

```java
import app.mailset.Mailset;
import app.mailset.model.Storage;

// Reads MAILSET_TOKEN from the environment.
Mailset mailset = Mailset.fromEnv();

Storage answer = mailset.storage().usage();
System.out.println(answer);
```

Rust:

```rust
// Reads MAILSET_TOKEN from the environment.
let mailset = mailset::Client::from_env()?;

let answer = mailset.storage().usage().await?;
println!("{answer:?}");
```

curl:

```bash
curl https://mailset.app/v1/storage.usage \
  -H "Authorization: Bearer $TOKEN" \
  -H "ms-time: $MS_TIME" \
  -H "ms-proof: $MS_PROOF" \
  -H "Content-Type: application/json" \
  -d '{"input":{}}'
```

curl can’t sign a request. `$TOKEN` is your credential’s token, and `$MS_TIME` and `$MS_PROOF` sign this exact body: [Calling the API without an SDK](https://mailset.app/docs/authentication/http) shows how.

CLI:

```bash
mailset storage usage
```

### Response

```json
{
  "ok": true,
  "data": {
    "mailboxes": [
      {
        "address": "hello@example.com",
        "messages": 1,
        "bytes": 20480
      }
    ],
    "contactPhotos": 1,
    "bytes": 20480,
    "messages": 1
  }
}
```

In the CLI: [mailset reference](https://mailset.app/docs/cli/storage#storage-usage)

---

© 2026 Intenseloop, Inc. Mailset’s site, docs and guides are copyrighted. You may read them and use their code to build with Mailset. Don’t republish them or use them to build a copy of Mailset. Terms: https://mailset.app/terms#content