NightmailDocs
Docs

Read the workspace setup

get/v1/overview/setup

What 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
OverviewSetup
domainsrequiredobject
domains.datarequiredobject[]
domains.nextCursorrequiredstring or null
domains.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.

apiKeysrequiredobject or null

Null when listApiKeys would refuse the caller: it needs unrestricted manage, and agent tokens never list keys.

apiKeys.activerequiredinteger

Unrevoked API keys.

emailsrequiredobject
emails.anyrequiredboolean

Whether any email the caller can read exists. Same scope as listEmails: a domain-restricted key sees only direct sends from its domains.

webhooksrequiredobject or null

Null when listWebhooks would refuse the caller: members and domain-restricted keys.

webhooks.totalrequiredinteger

Outbound webhooks, paused ones included.

invitationsrequiredobject or null

Null unless listWorkspaceInvitations would answer: an owner or admin dashboard session on a hosted installation.

invitations.pendingrequiredinteger

Pending, unexpired invitations.

progressobject or null

The 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.inboxrequiredboolean

An agent inbox exists.

progress.receivedrequiredboolean

Any email was received.

progress.contactsrequiredboolean

The audience has a contact.

progress.campaignrequiredboolean

A campaign exists, draft or not.

progress.campaignSentrequiredboolean

A campaign was launched (preparing, scheduled, sending, paused or done).

progress.newsletterrequiredboolean

A newsletter exists.

progress.readersrequiredboolean

A newsletter has a reader (a member of its list).

progress.issueSentrequiredboolean

A campaign to a newsletter was launched.

progress.agentrequiredboolean

An 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.
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.