Read the workspace setup
/v1/overview/setupWhat this workspace has set up, in one read. The newest domains, the number of active API keys, outbound webhooks and pending invitations, whether any email exists, each focus's first steps and whether an agent is connected. Each part follows the permission rules of its own list operation and is null where that operation would refuse the caller. Counts only: no webhook URL, key, address or subject.
Needs Sent mail: read for the sender domain.
Example
import { createClient } from '@nightmail/sdk/client';
import { getOverviewSetup } from '@nightmail/sdk';
const client = createClient({
baseUrl: 'https://nightmail.dev',
auth: scheme => scheme.scheme === 'bearer'
? process.env.NIGHTMAIL_API_KEY
: undefined,
});
const result = await getOverviewSetup({
client,
throwOnError: true,
});
console.log(result.data);curl --request GET \
--url 'https://nightmail.dev/v1/overview/setup' \
--header "Authorization: Bearer $NIGHTMAIL_API_KEY"Responses
200Success
OverviewSetupdomainsrequiredobjectdomains.datarequiredobject[]domains.nextCursorrequiredstring or nulldomains.quotaobjectHosted 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.
apiKeysrequiredobject or nullNull when listApiKeys would refuse the caller: it needs unrestricted manage, and agent tokens never list keys.
apiKeys.activerequiredintegerUnrevoked API keys.
emailsrequiredobjectemails.anyrequiredbooleanWhether any email the caller can read exists. Same scope as listEmails: a domain-restricted key sees only direct sends from its domains.
webhooksrequiredobject or nullNull when listWebhooks would refuse the caller: members and domain-restricted keys.
webhooks.totalrequiredintegerOutbound webhooks, paused ones included.
invitationsrequiredobject or nullNull unless listWorkspaceInvitations would answer: an owner or admin dashboard session on a hosted installation.
invitations.pendingrequiredintegerPending, unexpired invitations.
progressobject or nullThe first steps of each focus (focus in getWorkspaceSettings) and whether an agent is connected, as yes or no. Null unless the caller manages the whole workspace.
progress.inboxrequiredbooleanAn agent inbox exists.
progress.receivedrequiredbooleanAny email was received.
progress.contactsrequiredbooleanThe audience has a contact.
progress.campaignrequiredbooleanA campaign exists, draft or not.
progress.campaignSentrequiredbooleanA campaign was launched (preparing, scheduled, sending, paused or done).
progress.newsletterrequiredbooleanA newsletter exists.
progress.readersrequiredbooleanA newsletter has a reader (a member of its list).
progress.issueSentrequiredbooleanA campaign to a newsletter was launched.
progress.agentrequiredbooleanAn agent is connected: an unrevoked API key an agent setup made (the agent prompt's setup token or a device code), or a member's active MCP sign-in that defaults to this workspace or made agent tokens here.
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.