Stats a domain
/api/v1/domains/{domain}/statsParameters
| Name | In | Type | Description |
|---|---|---|---|
domainrequired | path | string | The domain id, or the domain name itself. |
Request
/api/v1/domains/{domain}/statscurl -X GET 'https://app.mailyte.com/api/v1/domains/yourdomain.com/stats' \
-H 'Authorization: Bearer mk_live_YOUR_API_KEY'const response = await fetch('https://app.mailyte.com/api/v1/domains/yourdomain.com/stats', {
method: 'GET',
headers: {
Authorization: 'Bearer mk_live_YOUR_API_KEY',
},
});
const { data } = await response.json();import requests
response = requests.get(
"https://app.mailyte.com/api/v1/domains/yourdomain.com/stats",
headers={"Authorization": "Bearer mk_live_YOUR_API_KEY"},
)
data = response.json()["data"]<?php
$response = Http::withToken('mk_live_YOUR_API_KEY')
->get('https://app.mailyte.com/api/v1/domains/yourdomain.com/stats');
$data = $response->json('data');require "net/http"
require "json"
uri = URI("https://app.mailyte.com/api/v1/domains/yourdomain.com/stats")
request = Net::HTTP::Get.new(uri)
request["Authorization"] = "Bearer mk_live_YOUR_API_KEY"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: true) { |http| http.request(request) }Response
Success.
dataobjectobjectstringdomain_usagedomain_idstringmailboxesobjectCounted from the mailbox rows themselves at request time, not from a rollup, so these two are never stale and never unknown.
totalintegerMailboxes on this domain. A live `COUNT`, so it is never null and 0 means the domain genuinely has none.
activeintegerOf 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.
storageobjectused_bytesintegerBytes, 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_bytesintegerBytes. 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.
todayobjectSince midnight UTC.
emails_sentintegerMessages 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_receivedintegerMessages 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_ratenumberPercentage. Null when nothing was sent today -- there is no rate without a denominator.
bounce_ratenumberPercentage. Null when nothing was sent today.
Returned inside the standard envelope.
Errors
| Status | When |
|---|---|
401 | The API key is missing, unknown, revoked or expired. All four answer identically, on purpose: distinguishing them would confirm which keys exist. |
403 | The 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. |
404 | No such resource in this organization. |
422 | The request was understood but the values were not acceptable. |
429 | Too 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.