# list()

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

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

Every contact of the account, with its name and the address of its photo.

Status: free · account-wide · absolute photo address

```javascript
for (const contact of await api.mail.contacts.list()) {
  console.log(contact.address, contact.name, contact.image);
}
```

| Name | Type | Requirement | Description |
| --- | --- | --- | --- |
| `address` | string |  | The correspondent's address — the key. |
| `name` | string |  | What to show instead of the address. |
| `image` | string|null |  | An absolute address for the photo, or `null`. |

## They belong to the account {#account}

Not to a mailbox. A contact saved once applies to every mailbox of the account — which is what you want, since the same person writes to several addresses.

## The photo address is stable and cacheable {#stable}

> **Not a short-lived signed link**
>
> A signed link would die in a list left open, the way message attachments do. A new photo gets a new address instead, which expires browser caches by itself.

## Building a picker {#ui}

```javascript
const byAddress = new Map((await api.mail.contacts.list()).map((c) => [c.address, c]));
const display = (address) => byAddress.get(address)?.name ?? address;
```

- [save()](/sdk/ref/mail/contacts/save): Adding one.
- [get()](/sdk/ref/mail/contacts/get): One by address.

```python
for contact in api.mail.contacts.list():
    print(contact["address"], contact.get("name"), contact.get("avatar"))
```

```python
by_address = {c["address"]: c for c in api.mail.contacts.list()}
def display(address): return (by_address.get(address) or {}).get("name") or address
```
