# See an account's drive usage

`GET https://api.mailmasker.org/api/v1/drive/admin/usage`

How much one account keeps in drive, and the limit that applies to it.

- Who can use it: Site admins
- Area: Users and roles
- Answers 200 OK when it works
- Page: https://developer.mailmasker.org/admin-drive-usage

The bytes the account keeps in drive, not counting its trash, and its limit: its own if one is set, otherwise the 1 TB default (1099511627776 bytes).

## Parameters

| Name | In | Required | What it is | Example |
|---|---|---|---|---|
| `user_email` | query | yes | The account's address, exactly as the account has it. | `alice@example.com` |

## Good to know

- An address with no account answers 0 bytes used and the default limit.

## Examples

cURL:

```bash
curl -s 'https://api.mailmasker.org/api/v1/drive/admin/usage?user_email=alice%40example.com' \
  -H "Authorization: Bearer $TOKEN"
```

Perl:

```perl
use Mojo::Base -strict;
use Mojo::UserAgent;

my $ua  = Mojo::UserAgent->new;
my $res = $ua->get('https://api.mailmasker.org/api/v1/drive/admin/usage',
    { Authorization => "Bearer $ENV{TOKEN}" },
    form => { user_email => 'alice@example.com' })->result;
die $res->code, ' ', ($res->json('/error') // $res->message), "\n" unless $res->is_success;
print $res->body, "\n";
```

homelab-cli:

There is no homelab-cli command for this yet.

## Response

200 OK:

```json
{ "user_email": "alice@example.com", "used_bytes": 2147483648, "limit_bytes": 53687091200 }
```
