List domains
/v1/domainsMX returns persisted DNS records and background verification status without AWS calls. Self-hosted installations refresh up to ten identities unless refresh=false.
Needs Configuration: read for the sender domain. A person needs to be an owner or admin.
Example
import { createClient } from '@nightmail/sdk/client';
import { listDomains } from '@nightmail/sdk';
const client = createClient({
baseUrl: 'https://nightmail.dev',
auth: scheme => scheme.scheme === 'bearer'
? process.env.NIGHTMAIL_API_KEY
: undefined,
});
const result = await listDomains({
client,
throwOnError: true,
});
console.log(result.data);curl --request GET \
--url 'https://nightmail.dev/v1/domains' \
--header "Authorization: Bearer $NIGHTMAIL_API_KEY"Parameters
cursorquery · stringlimitquery · integerregionquery · stringrefreshquery · stringResponses
200Success
DomainPagedatarequiredobject[]data[].idrequiredstringdata[].namerequiredstringdata[].regionrequiredstringdata[].verificationStatusrequiredstringdata[].verifiedrequiredbooleandata[].dkimStatusrequiredstringdata[].dmarcrequiredobject or nullLast DNS and SES observation for this From domain. Null when unchecked, unavailable or stale. Alignment describes configured identifiers, not a delivery verdict.
data[].readyrequiredbooleandata[].sendingrequiredstringdata[].receivingrequiredstringdata[].mailFromDomainrequiredstring or nulldata[].mailFromStatusrequiredstring or nulldata[].dnsStatusrequiredstringdata[].dnsUnavailableReasonrequiredstring or nulldata[].dnsrequiredobject[]data[].dnsHostobject or nullWhere this domain’s DNS is hosted, from its zone’s NS records, alongside publicDns: null when the provider is not one Nightmail recognizes.
data[].dnsIssueobject or nullSet when adding the domain (one bounded NS lookup), by Check now and by the background check: the domain has no DNS at all. Never set when DNS couldn’t be read. Fix the name (add the right domain and delete this one) or register the domain.
data[].releasesAtstring or nullHosted only: when this domain is released if its records are still unproven (72 hours after it was added). Null once ownership has been proven.
data[].receivingIssueobject or nullHosted only: receiving needs attention. Set by the DNS checks that run when a receiving host is suggested or chosen, on Check now and in the hourly recheck. Null when the receiving record is clear.
data[].builtInbooleanHosted only: the workspace’s built-in domain, a subdomain of Nightmail’s own domain that needs no DNS. It sends until a domain of the workspace’s own verifies (limits here and connection.builtinDomain in GET /v1/me say what it sends), receives at every address, and can’t be deleted or changed (409 BUILTIN_DOMAIN).
data[].limitsobjectBuilt-in domain only: what it sends, before a send finds out. GET /v1/domains/{id} and listDomains.
nextCursorrequiredstring or nullquotaobjectHosted only, and only for credentials without domain restrictions. Absent when the workspace sends through its own AWS account, which has no domain total. Adding a domain past the limit fails with DOMAIN_LIMIT_REACHED; at most 10 of them may be unproven at once.
quota.usedrequiredintegerDomains in the workspace, across every region and page.
quota.limitrequiredintegerHow many domains the workspace may have: 100 unless Nightmail set another limit on request.
400, 401, 403, 404, 409, 413, 422, 429, 500, 503Request failed; use error.code and requestId to diagnose.
ApiErrorerrorrequiredobjecterror.coderequiredstringerror.messagerequiredstringerror.requestIdrequiredstringerror.fieldstringerror.retryablerequiredbooleanerror.resetAtstringNext capacity change for a Hosted rolling send limit.
error.detailsobject[]Every problem found, when there is more than one part, such as rule diagnostics with rule, line, column, message and hint, or a measurement, such as CONTENT_TOO_LARGE_TO_SCREEN with screenedBytes and limitBytes (and index in a batch).
error.requiredobjectOn a 403 permission refusal: what the request needs that this credential lacks. The Nightmail-Required-Permission header says the same.