api.domains

list()

api.domains.list() → Promise<Domain[]>

Every attached domain, each one a full Domain object with its records and its mail.

GET /api/domainsfreeDomain objects
Using Python?

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

for (const domain of await api.domains.list()) {
  console.log(domain.name, domain.status, domain.mailHosts.length, "mail hosts");
}
for domain in api.domains.list():
    print(domain.name, domain.status, len(domain.mail_hosts), "mail hosts")

status is the thing to show

statusMeans
pending_nameserversThe registrar does not point here yet. The zone serves nothing.
activeIt does. Everything in the zone is live.

It is refreshed by check(), not by listing — a list shows what was last known.

dns carries the mail witnesses

domain.dns;   // { mxOk, spfOk, dkimOk, dmarcOk, checkedAt }
domain.dns   # {"mxOk", "spfOk", "dkimOk", "dmarcOk", "checkedAt"}

Four booleans saying what the zone actually holds for mail. All four true is what « it works » means here.

Pending domains are worth separating

const waiting = (await api.domains.list()).filter((d) => d.status === "pending_nameservers");
waiting = [d for d in api.domains.list() if d.status == "pending_nameservers"]

A domain that has been pending for days usually means the customer never made the change — which nothing else will tell you.