# list()

Canonical URL: https://developers.iagenify.com/sdk/ref/mail/list/
Language: en

`api.mail.list() → Promise<Mailbox[]>`

Every mailbox of the account, each a full object with its messages, its aliases and its settings.

Status: GET /api/mail · free · Mailbox objects

```javascript
for (const box of await api.mail.list()) {
  console.log(box.address, box.usedBytes, "/", box.quotaBytes, box.aliasList.length, "aliases");
}
```

## They are ready to use {#objects}

```javascript
const [box] = await api.mail.list();
const { messages } = await box.messages.list({ folder: "inbox", limit: 20 });
```

## quotaBytes is the same number on all of them {#quota}

It is the account's object storage. Three mailboxes do not have three quotas — they share the account's space, along with files and anything a host keeps online.

## source says where it lives {#source}

| source | Means |
| --- | --- |
| `iagenify` | A mailbox here. |
| `imap` | One hosted elsewhere, read directly. |

The field exists so a page does not have to change when a mailbox of the second kind appears beside one of the first.

## An empty list {#empty}

Either none has been created, or the plan has none — [usage()](/sdk/ref/mail/usage) says which, and a page should show the limit rather than an empty state.

- [get()](/sdk/ref/mail/get): One, by address.
- [Mailbox](/sdk/ref/mailbox): What a mailbox carries, and what you can do to it.

```python
for box in api.mail.list():
    print(box.address, box.used_bytes, "/", box.quota_bytes, len(box.alias_list), "aliases")
```

```python
box = api.mail.list()[0]
messages = box.messages.list(folder="inbox", limit=20)["messages"]
```
