Stats a domain

GET/api/v1/domains/{domain}/stats
Requires anorganization API keywith the scopereports:read

Parameters

NameInTypeDescription
domainrequiredpathstringThe domain id, or the domain name itself.

Request

GET/api/v1/domains/{domain}/stats
curl -X GET 'https://app.mailyte.com/api/v1/domains/yourdomain.com/stats' \
  -H 'Authorization: Bearer mk_live_YOUR_API_KEY'
The key names its own organization, so no X-Organization-ID header is needed.

Response

Success.

  • dataobject
    • objectstringdomain_usage
    • domain_idstring
    • mailboxesobject

      Counted from the mailbox rows themselves at request time, not from a rollup, so these two are never stale and never unknown.

      • totalinteger

        Mailboxes on this domain. A live `COUNT`, so it is never null and 0 means the domain genuinely has none.

      • activeinteger

        Of those, how many are active. A live `COUNT`, never null; 0 means none are active, which on a domain with mailboxes is a real finding rather than a missing reading.

    • storageobject
      • used_bytesinteger

        Bytes, summed across this domain's mailboxes. Never null: it is a `SUM` over rows this API owns, and a domain with no mailboxes sums to a genuine 0.

      • quota_bytesinteger

        Bytes. The same value as `limits.storage_bytes` on the domain, and never null for the same reason -- the column is NOT NULL. **0 means no quota is enforced**; that is how "unlimited" is said here, not null.

    • todayobject

      Since midnight UTC.

      • emails_sentinteger

        Messages accepted for delivery since midnight UTC. Never null -- it is read from the daily rollup, which answers 0 for a day it holds no rows for. **So 0 means "the rollup records nothing today", which is not the same as proof that nothing was sent**: a rollup that has not run yet reports the same 0. Treat it as a lower bound, and do not bill from it.

      • emails_receivedinteger

        Messages delivered to this domain since midnight UTC. Never null, and 0 carries the same caveat as `emails_sent`: it is the absence of recorded events, not measured silence.

      • delivery_ratenumber

        Percentage. Null when nothing was sent today -- there is no rate without a denominator.

      • bounce_ratenumber

        Percentage. Null when nothing was sent today.

Returned inside the standard envelope.

Errors

StatusWhen
401The API key is missing, unknown, revoked or expired. All four answer identically, on purpose: distinguishing them would confirm which keys exist.
403The key is valid but may not do this: it lacks the required scope, its IP allowlist does not include you, or this endpoint does not accept API keys.
404No such resource in this organization.
422The request was understood but the values were not acceptable.
429Too many requests, or the organization has spent its sending allowance. `Retry-After` says how long to wait.

Every status, with what causes it and what to do, is on the error reference.