NightmailDocs
Docs

Read the receiving overview

get/v1/inbound/overview

Every route mail can take, with its rules and endpoints, in one read. One page of routes (addresses, agent inboxes, address patterns, explicit routes and catch-alls) merged and ordered by host, kind and address, each resolved to the rules that run on it and where its mail goes. Also returns counts per kind, the rules, up to 100 endpoints and 100 inbound webhooks, and the domains. Members and scoped keys see only their addresses. With an MCP sign-in (approval), it requires an owner or admin, like the other receiving reads.

Needs Inboxes: read for the address or inbox.

Example

import { createClient } from '@nightmail/sdk/client';
import { getInboundOverview } from '@nightmail/sdk';

const client = createClient({
  baseUrl: 'https://nightmail.dev',
  auth: scheme => scheme.scheme === 'bearer'
    ? process.env.NIGHTMAIL_API_KEY
    : undefined,
});

const result = await getInboundOverview({
  client,
  throwOnError: true,
});

console.log(result.data);
curl --request GET \
  --url 'https://nightmail.dev/v1/inbound/overview' \
  --header "Authorization: Bearer $NIGHTMAIL_API_KEY"

Parameters

kindquery · string

Comma-separated kinds to list: address (a receiving address, including temporary ones), inbox (an agent inbox), route (an explicit route for an address that has no inbox of its own), pattern (an address wildcard rule or a pattern route), catch_all (a *@host route, or the domain default for unknown recipients). Default: every kind.

originquery · string

Filters address rows only: api (created on purpose) or auto (created by a catch-all). Other kinds are unaffected.

domainquery · string

Receiving host, e.g. reply.acme.com.

qquery · string

Matches the address, an alias or the display name.

cursorquery · string
limitquery · integer

Responses

200Success
InboundOverview
countsrequiredobject

Routes per kind, after the domain and q filters and before kind and origin.

counts.addressrequiredinteger
counts.autorequiredinteger

Addresses a catch-all created (origin auto).

counts.routerequiredinteger
counts.patternrequiredinteger
counts.catch_allrequiredinteger
counts.inboxrequiredinteger
routesrequiredobject
routes.datarequiredobject[]
routes.nextCursorrequiredstring or null
rulesrequiredobject[]

Every rule in the config, in the order it was saved.

rules[].keyrequiredstring
rules[].callsrequiredstring[]

Endpoint names it can call.

rules[].deliversrequiredstring[]

Inbox keys it can deliver to.

rules[].decisionsrequiredstring[]

The names of the AI decisions it asks for.

rules[].questionsrequiredstring[]

The question each of those decisions asks the AI, in the same order: testRules takes scores keyed by these.

rules[].attachedTorequiredstring[]

Address IDs or addresses it runs on.

rules[].addressesrequiredstring[]

attachedTo as addresses: an inbox ID reads as its primary address.

rules[].reciperequiredobject
rules[].enabledrequiredboolean

False when it is turned off: it keeps its addresses and doesn’t run.

rules[].lastMatchedAtrequiredstring or null

When it last took an action on received mail, among the workspace’s last 1,000 received emails; null if it didn’t.

ritualsrequiredobject[]

Deprecated: rules, with omens for decisions.

rituals[].keyrequiredstring
rituals[].callsrequiredstring[]

Endpoint names it can call.

rituals[].deliversrequiredstring[]

Inbox keys it can deliver to.

rituals[].omensrequiredstring[]

The names of the AI decisions it asks for.

rituals[].questionsrequiredstring[]

The question each of those decisions asks the AI, in the same order: testRules takes scores keyed by these.

rituals[].attachedTorequiredstring[]

Address IDs or addresses it runs on.

rituals[].addressesrequiredstring[]

attachedTo as addresses: an inbox ID reads as its primary address.

rituals[].reciperequiredobject
rituals[].enabledrequiredboolean

False when it is turned off: it keeps its addresses and doesn’t run.

rituals[].lastMatchedAtrequiredstring or null

When it last took an action on received mail, among the workspace’s last 1,000 received emails; null if it didn’t.

endpointsrequiredobject[]

At most 100 endpoints (by name) and 100 inbound webhooks.

endpoints[].idrequiredstring

Endpoint ID: mwh_… for a webhook, con_… for Slack, Discord or a forward.

endpoints[].sourcerequiredstring

endpoint: a named endpoint, which rules call (listEndpoints). inbound_webhook: a webhook without a name (listInboundWebhooks lists every webhook, named or not).

endpoints[].namerequiredstring
endpoints[].typerequiredstring
endpoints[].statusrequiredstring
endpoints[].targetrequiredstring

Where it delivers; URLs are write-only (last four characters).

endpoints[].callrequiredstring or null

How a rule calls an endpoint; null for an inbound webhook.

endpoints[].eventTypesrequiredstring[]

Events a webhook subscribes to; empty for a route-only webhook and for Slack, Discord and forward endpoints.

endpoints[].routesrequiredinteger

Routes that name it.

endpoints[].rulesrequiredstring[]

Rules that call it.

endpoints[].ritualsrequiredstring[]

Deprecated: rules.

endpointsTruncatedrequiredboolean

True when the workspace has more endpoints or inbound webhooks than listed. Read them all with listEndpoints and listInboundWebhooks, following nextCursor until it is null.

domainsrequiredobject[]

Every domain with its receiving status, including domains that only send.

domains[].idrequiredstring

Nightmail domain ID.

domains[].namerequiredstring

Receiving host: the domain, or the subdomain it receives at.

domains[].domainrequiredstring

The domain itself. Hosted, an address on it or any of its subdomains turns receiving on there (createInboundAddress).

domains[].hostsrequiredstring[]

Every host the domain receives at, or is being set up to (name is its first); addresses can be created at each.

domains[].statusrequiredstring
domains[].catchAllrequiredstring
managerequiredboolean

False for members and scoped keys: they see their addresses, without routes, rules, endpoints or domains.

versionrequiredinteger

The routing and rules version this overview was read at: send it as If-Match to setInboundAddressFlow.

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.