NightmailDocs
Docs

List agent inboxes

get/v1/inboxes

Inboxes this credential can see, ordered by ID, with status and usage. A provisioning key sees the inboxes it created. Pages are also bounded by response size and may return fewer than limit inboxes; pass nextCursor as cursor for the next page. Filtered queries (type, status, q): Each statement stops after 5 seconds: a request that needs longer is refused with 422 READ_TOO_LARGE. Narrow the dates or filters.

Needs Inboxes: read for the address or inbox.

Example

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

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

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

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

Parameters

typequery · string

persistent: a real address kept until explicitly deleted. ephemeral: a real address on one of your active receiving domains. sandbox: an address on a .invalid host that receives nothing from the internet; fill it with POST /v1/inboxes/{id}/simulate.

statusquery · string

active: receiving. expired: in its grace period; new mail is held. deleting: erased at the next hourly sweep.

qquery · string

Search address and name.

cursorquery · string
limitquery · integer

Responses

200Success
InboxPage
datarequiredobject[]
data[].idrequiredstring

Inbox ID. It also works as addressId on /v1/inbound endpoints, such as replying in a thread.

data[].kindrequiredstring
data[].typerequiredstring

persistent: a real address kept until explicitly deleted. ephemeral: a real address on one of your active receiving domains. sandbox: an address on a .invalid host that receives nothing from the internet; fill it with POST /v1/inboxes/{id}/simulate.

data[].addressrequiredstring

The address to give the sender or sign-up form.

data[].domainrequiredstring
data[].namerequiredstring or null
data[].metadatarequiredobject
data[].clientIdrequiredstring or null
data[].statusrequiredstring

active: receiving. expired: in its grace period; new mail is held. deleting: erased at the next hourly sweep.

data[].createdAtrequiredstring
data[].expiresAtrequiredstring or null

When the inbox stops delivering mail.

data[].deleteAfterrequiredstring or null

When the inbox, its mail and its keys are erased.

data[].retentionrequiredobject
data[].limitsrequiredobject
data[].sendrequiredobject
data[].usagerequiredobject
nextCursorrequiredstring or null
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.