NightmailDocs
Docs

List domains

get/v1/domains

MX 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 · string
limitquery · integer
regionquery · string
refreshquery · string

Responses

200Success
DomainPage
datarequiredobject[]
data[].idrequiredstring
data[].namerequiredstring
data[].regionrequiredstring
data[].verificationStatusrequiredstring
data[].verifiedrequiredboolean
data[].dkimStatusrequiredstring
data[].dmarcrequiredobject or null

Last DNS and SES observation for this From domain. Null when unchecked, unavailable or stale. Alignment describes configured identifiers, not a delivery verdict.

data[].readyrequiredboolean
data[].sendingrequiredstring
data[].receivingrequiredstring
data[].mailFromDomainrequiredstring or null
data[].mailFromStatusrequiredstring or null
data[].dnsStatusrequiredstring
data[].dnsUnavailableReasonrequiredstring or null
data[].dnsrequiredobject[]
data[].dnsHostobject or null

Where 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 null

Set 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 null

Hosted 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 null

Hosted 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[].builtInboolean

Hosted 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[].limitsobject

Built-in domain only: what it sends, before a send finds out. GET /v1/domains/{id} and listDomains.

nextCursorrequiredstring or null
quotaobject

Hosted 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.usedrequiredinteger

Domains in the workspace, across every region and page.

quota.limitrequiredinteger

How 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.
ApiError
errorrequiredobject
error.coderequiredstring
error.messagerequiredstring
error.requestIdrequiredstring
error.fieldstring
error.retryablerequiredboolean
error.resetAtstring

Next 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.requiredobject

On a 403 permission refusal: what the request needs that this credential lacks. The Nightmail-Required-Permission header says the same.