api.mail

get()

api.mail.get(id) → Promise<Mailbox>

One mailbox, by its identifier or by its address — get("hello@example.com") works.

id or addressfree404 if unknown
Using Python?

Switch any code block to Python: the choice applies to every page. Python SDK guide and resource reference.

const box  = await api.mail.get("hello@example.com");
const same = await api.mail.get(box.id);
box = api.mail.get("hello@example.com")
same = api.mail.get(box.id)
Taking the address is the useful part

A mailbox is identified by its address everywhere a human refers to it. Having to look up an identifier first would be a step for nothing.

It is a read

usedBytes, quotaBytes and the rest are what the platform has now — a newer snapshot than one from a list taken earlier.

messages and aliases come with it

const box = await api.mail.get("hello@example.com");

await box.messages.list({ folder: "inbox" });
await box.aliases.add("hi@example.com");
box = api.mail.get("hello@example.com")

box.messages.list(folder="inbox")
box.aliases.add("hi@example.com")

An alias does not resolve here

Aliases are addresses that land in a mailbox; the mailbox is identified by its own address. Look an alias up in aliasList on the mailboxes you hold.