List agent inboxes
/v1/inboxesInboxes 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 · stringpersistent: 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 · stringactive: receiving. expired: in its grace period; new mail is held. deleting: erased at the next hourly sweep.
qquery · stringSearch address and name.
cursorquery · stringlimitquery · integerResponses
200Success
InboxPagedatarequiredobject[]data[].idrequiredstringInbox ID. It also works as addressId on /v1/inbound endpoints, such as replying in a thread.
data[].kindrequiredstringdata[].typerequiredstringpersistent: 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[].addressrequiredstringThe address to give the sender or sign-up form.
data[].domainrequiredstringdata[].namerequiredstring or nulldata[].metadatarequiredobjectdata[].clientIdrequiredstring or nulldata[].statusrequiredstringactive: receiving. expired: in its grace period; new mail is held. deleting: erased at the next hourly sweep.
data[].createdAtrequiredstringdata[].expiresAtrequiredstring or nullWhen the inbox stops delivering mail.
data[].deleteAfterrequiredstring or nullWhen the inbox, its mail and its keys are erased.
data[].retentionrequiredobjectdata[].limitsrequiredobjectdata[].sendrequiredobjectdata[].usagerequiredobjectnextCursorrequiredstring or null400, 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.