# Nightmail API

Send, receive and reply to email on your own domains. 202 means queued, not delivered.

- [Interactive documentation](/docs)
- [OpenAPI 3.1 JSON](/openapi.json)
- [Agent index](/llms.txt)
- TypeScript package: `@nightmail/sdk`

[API index](/docs.md) · [Settings reference](/docs/tags/settings.md)

## Get overview 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.

Operation ID: `getOverviewSetup`

Permission: Needs Sent mail: read for the sender domain.



### TypeScript SDK

```ts
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

```sh
curl --request GET \
  --url 'https://nightmail.dev/v1/overview/setup' \
  --header "Authorization: Bearer $NIGHTMAIL_API_KEY"
```

### Responses

| Status | Description | Schema |
| --- | --- | --- |
| `200` | Success | object |
| `400`, `401`, `403`, `404`, `409`, `413`, `422`, `429`, `500`, `503` | Request failed; use error.code and requestId to diagnose. | object |

#### 200: Success

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `domains` | object | yes |  |
| `domains.data` | object[] | yes |  |
| `domains.nextCursor` | string or null | yes |  |
| `domains.quota` | object | no | 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. |
| `apiKeys` | object or null | yes | Null when listApiKeys would refuse the caller: it needs unrestricted manage, and agent tokens never list keys. |
| `apiKeys.active` | integer | yes | Unrevoked API keys. |
| `emails` | object | yes |  |
| `emails.any` | boolean | yes | Whether any email the caller can read exists. Same scope as listEmails: a domain-restricted key sees only direct sends from its domains. |
| `webhooks` | object or null | yes | Null when listWebhooks would refuse the caller: members and domain-restricted keys. |
| `webhooks.total` | integer | yes | Outbound webhooks, paused ones included. |
| `invitations` | object or null | yes | Null unless listWorkspaceInvitations would answer: an owner or admin dashboard session on a hosted installation. |
| `invitations.pending` | integer | yes | Pending, unexpired invitations. |
| `progress` | object or null | no | 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.inbox` | boolean | yes | An agent inbox exists. |
| `progress.received` | boolean | yes | Any email was received. |
| `progress.contacts` | boolean | yes | The audience has a contact. |
| `progress.campaign` | boolean | yes | A campaign exists, draft or not. |
| `progress.campaignSent` | boolean | yes | A campaign was launched (preparing, scheduled, sending, paused or done). |
| `progress.newsletter` | boolean | yes | A newsletter exists. |
| `progress.readers` | boolean | yes | A newsletter has a reader (a member of its list). |
| `progress.issueSent` | boolean | yes | A campaign to a newsletter was launched. |
| `progress.agent` | boolean | yes | 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, 503: Request failed; use error.code and requestId to diagnose.

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `error` | object | yes |  |
| `error.code` | string | yes |  |
| `error.message` | string | yes |  |
| `error.requestId` | string | yes |  |
| `error.field` | string | no |  |
| `error.retryable` | boolean | yes |  |
| `error.resetAt` | string | no | Next capacity change for a Hosted rolling send limit. |
| `error.details` | object[] | no | 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.required` | object | no | On a 403 permission refusal: what the request needs that this credential lacks. The Nightmail-Required-Permission header says the same. |
