---
title: "Inboxes"
description: "Addresses on the inbox domain: issue, read, rename and delete them."
url: https://doorman.fyi/docs/reference/inboxes
markdown: https://doorman.fyi/docs/reference/inboxes.md
area: "API reference"
section: "API reference"
---

# Inboxes

Addresses on the inbox domain: issue, read, rename and delete them.

Source: https://doorman.fyi/docs/reference/inboxes

## List inboxes

`GET /v1/inboxes`

Access `any`: any API key, or a console session.

The account's active inboxes, oldest first, each with its unread thread count and the instant of its last message. An inbox-scoped key sees its own inbox only.

OAuth: allowed with all of `inboxes:read`. [App permissions](https://doorman.fyi/docs/oauth.md#scopes) apply in addition to account and resource checks.

Also available as [`client.inboxes.list`](https://doorman.fyi/docs/sdk/reference/inboxes.md#inboxes-list) in TypeScript, [`client.inboxes.list`](https://doorman.fyi/docs/python/reference/inboxes.md#inboxes-list) in Python, the [`inboxes_list`](https://doorman.fyi/docs/mcp/tools/inboxes.md#inboxes-list) tool and [`doorman inboxes list`](https://doorman.fyi/docs/cli/commands/inboxes.md#inboxes-list) on the command line.

Organizations: every member's console session may call it. See [Roles and permissions](https://doorman.fyi/docs/organizations.md#roles).

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `q` | query | `string` | no | Keep the inboxes whose address or display name contains this text, case-insensitively. |
| `externalId` | query | `string` | no | Keep the inbox with exactly this `externalId`: at most one, since it is unique among the account's active inboxes. Example: `customer-8841`. |
| `limit` | query | `integer` | no | Page size, 1 to 100. Defaults to 50. |
| `offset` | query | `integer` | no | Rows to skip. Defaults to 0. |

Answers `200`: A page of inboxes.

**Response 200: InboxPage**
A page of the account's inboxes, oldest first.
- `data` (InboxListItem[])
- `limit` (integer): The page size that was applied.
- `offset` (integer): The offset that was applied.
- `total` (integer): How many inboxes match, across every page.

**Errors**

| Status | Error | Meaning |
| --- | --- | --- |
| 400 | `validation_error` | A field is missing or invalid; the message names it. |
| 401 | `unauthorized` | The credential was missing, malformed, revoked or belongs to an inactive account. |
| 401 | `session_invalid` | The console session token could not be verified. |
| 401 | `session_expired` | The console session token has expired. |
| 401 | `session_claims_missing` | The session token does not carry a verified email address. |
| 403 | `insufficient_scope` | The app's token lacks a required scope, or the operation cannot be delegated. |
| 403 | `account_suspended` | The account is suspended. |
| 403 | `account_deleted` | The account was deleted. |
| 403 | `member_deactivated` | The signed-in person's access to the organization was deactivated, or they were removed from it. It holds from their next request, whatever their session token says. An admin of the organization can let a deactivated member in again. |
| 409 | `account_mismatch` | The request named another account in `x-doorman-account` than the one its credential acts for, as happens when the console's organization was switched in another tab. Reload and try again. |
| 500 | `internal_error` | Something went wrong on the server. |

curl:
```sh
curl -s "https://api.doorman.fyi/v1/inboxes" \
  -H "authorization: Bearer $DOORMAN_API_KEY"
```

TypeScript:
```ts
const response = await fetch("https://api.doorman.fyi/v1/inboxes", {
  headers: {
    authorization: `Bearer ${process.env.DOORMAN_API_KEY}`,
  },
  redirect: "manual", credentials: "omit",
});
if (!response.ok) throw new Error(`The API answered ${response.status}.`);
const result = await response.json();
```

Python:
```python
import os
import requests

response = requests.get(
    "https://api.doorman.fyi/v1/inboxes",
    headers={"authorization": f"Bearer {os.environ['DOORMAN_API_KEY']}"},
    allow_redirects=False, timeout=30,
)
response.raise_for_status()
result = response.json()
```

## Issue an inbox

`POST /v1/inboxes`

Access `account`: an account-scoped key or a console session; an inbox-scoped key gets 403 `forbidden`.

A new address on the inbox domain that receives mail as soon as the call returns. Omit `mailboxName` for a random one. Pass `webhookUrl` and `key` to issue a ready-to-use inbox in one call: the answer then carries the webhook's signing secret and the inbox-scoped key's token, once. `externalId` tags the inbox with your own identifier for later lookups. Creating past the plan's allowance answers 402 `plan_limit_reached`; deleting an inbox frees its slot. Every plan also has a ceiling of 100 active inboxes per account (409 `limit_reached`).

OAuth: allowed with all of `inboxes:write`. [App permissions](https://doorman.fyi/docs/oauth.md#scopes) apply in addition to account and resource checks.

Also available as [`client.inboxes.create`](https://doorman.fyi/docs/sdk/reference/inboxes.md#inboxes-create) in TypeScript, [`client.inboxes.create`](https://doorman.fyi/docs/python/reference/inboxes.md#inboxes-create) in Python, the [`inboxes_create`](https://doorman.fyi/docs/mcp/tools/inboxes.md#inboxes-create) tool and [`doorman inboxes create`](https://doorman.fyi/docs/cli/commands/inboxes.md#inboxes-create) on the command line.

Organizations: a member's console session needs `inboxes:manage`. With `key` in the body it also needs `keys:manage`. With `webhookUrl` in the body it also needs `webhooks:manage` and `mail:read`. API keys and app tokens are not held to member permissions. See [Roles and permissions](https://doorman.fyi/docs/organizations.md#roles).

**Request body (application/json): CreateInbox**
A new inbox. Every field is optional: an empty body issues a random address. `webhookUrl` and `key` make the inbox ready to use in one call; their secrets come back once, in the answer.
- `mailboxName` (string, optional): 3 to 30 lowercase letters, digits, dots or hyphens: the part before the @. Reserved names are refused with 400 validation_error: mail infrastructure (abuse, admin, administrator, api, bounce, bounces, ...), the company's role accounts (support, billing, sales, legal, security, ...), names holding such a role as a dot- or hyphen-separated label (acme-support) however the role is written (support1, supp0rt, no-reply, supportteam), and the doorman and theovex brand with its lookalikes. The full lists are under x-doorman-limits.inboxes. Example: `concierge`
- `displayName` (string, optional): The sender name on outbound mail, at most 100 characters, with at least one letter or digit and no @, <, >, URL, control or invisible characters, no Latin mixed with Cyrillic or Greek, never the doorman or theovex brand, and never a bare role such as Support or Billing team: it says who, not only what. Example: `Acme concierge`
- `externalId` (string, optional): Your own identifier for the inbox (a user, a job, a tenant), at most 200 characters and unique among the account's active inboxes. Look an inbox up with `GET /v1/inboxes?externalId=`. Example: `customer-8841`
- `metadata` (Metadata, optional)
- `domainId` (string, optional): One of this account's verified custom domains. Omit for the shared domain. Example: `dom_01jc5f1a2b3c4d5e6f7g8h9j0k`
- `webhookUrl` (string, optional): Set the inbox webhook at once: an https URL without credentials. The signing secret is in the answer's `webhook`. Example: `https://agent.example.com/hooks/doorman`
- `key` (object, optional): Mint an inbox-scoped key at once. Its token is in the answer's `key`.
  - `name` (string, optional): A label for the key, at most 100 characters. Example: `Acme concierge`

Answers `201`: The inbox, with the webhook secret and the key token when they were requested.

**Response 201: CreatedInbox**
A freshly issued inbox. When the request asked for them, `webhook` carries the webhook with its signing secret and `key` the inbox-scoped key with its token; both are shown once and null otherwise.
- `id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `address` (string): The full address: the mailbox name at the inbox domain. Example: `concierge@doorman.example`
- `mailboxName` (string): The part before the @. Example: `concierge`
- `domain` (string): The inbox domain of this deployment. Example: `doorman.example`
- `domainId` (string | null, optional): The custom domain identifier; null on the shared domain. Older deployments omit it.
- `displayName` (string | null): The sender name on outbound mail; null when none is set.
- `signature` (string | null, optional): Plain text appended to every message the inbox sends, under a `-- ` line; null when none is set. Older deployments omit it. Example: `Acme concierge
acme.example`
- `signatureHtml` (string | null, optional): The signature as markup, appended to the HTML part of every message the inbox sends, as it was stored: scripts, style sheets, forms, event handlers and images that are not https are removed when it is set. Null when the signature is plain text only. Older deployments omit it. Example: `<table cellpadding="0" cellspacing="0"><tr><td style="font-family:Arial,sans-serif;font-size:14px"><b>Acme concierge</b><br><a href="https://acme.example">acme.example</a></td></tr></table>`
- `externalId` (string | null): Your own identifier for the inbox; null when none was given. Example: `customer-8841`
- `metadata` (Metadata, optional)
- `webhookUrl` (string | null): The inbox webhook's URL, or null when the inbox has none.
- `status` ("active" | "suspended" | "deleted"): Only active inboxes receive and send; a deleted inbox is never returned.
- `createdAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `updatedAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `webhook` (InboxWebhookSecret | null): The inbox webhook with its one-time secret, when `webhookUrl` was given.
- `key` (CreatedApiKey | null): The inbox-scoped key with its one-time token, when `key` was given.

Example 201 response:
```json
{
  "id": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "address": "concierge@doorman.example",
  "mailboxName": "concierge",
  "domain": "doorman.example",
  "displayName": "Acme concierge",
  "externalId": "customer-8841",
  "metadata": {},
  "webhookUrl": "https://agent.example.com/hooks/doorman",
  "status": "active",
  "createdAt": "2026-11-05T10:05:00.000Z",
  "updatedAt": "2026-11-05T10:05:00.000Z",
  "webhook": {
    "url": "https://agent.example.com/hooks/doorman",
    "secret": "whsec_dGVzdC13ZWJob29rLXNpZ25pbmctc2VjcmV0LTAxMjM0NTY3ODk="
  },
  "key": {
    "id": "key_01jc5c0z9y8x7w6v5t4t3s2r1q",
    "inboxId": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
    "name": "Acme concierge",
    "tokenPrefix": "dm_9f3abcd",
    "last4": "m2x8",
    "createdAt": "2026-11-05T10:05:00.000Z",
    "lastUsedAt": null,
    "token": "dm_9f3abcdefghjkmnpqrstvwxyz0123456789abcdefghjkmnpm2x8"
  }
}
```

**Errors**

| Status | Error | Meaning |
| --- | --- | --- |
| 400 | `validation_error` | A field is missing or invalid; the message names it. |
| 401 | `unauthorized` | The credential was missing, malformed, revoked or belongs to an inactive account. |
| 401 | `session_invalid` | The console session token could not be verified. |
| 401 | `session_expired` | The console session token has expired. |
| 401 | `session_claims_missing` | The session token does not carry a verified email address. |
| 402 | `plan_limit_reached` | The plan's allowance is used up; `scope` says whether it is the inbox count, the monthly sends or the custom domains. Upgrade rather than wait. |
| 403 | `forbidden` | The key is scoped to one inbox and cannot manage inboxes, keys or webhooks, or cannot read account-wide data. |
| 403 | `insufficient_scope` | The app's token lacks a required scope, or the operation cannot be delegated. |
| 403 | `account_suspended` | The account is suspended. |
| 403 | `account_deleted` | The account was deleted. |
| 403 | `permission_denied` | The signed-in member's role in the organization lacks a permission the operation needs; `permission` names it. An admin of the organization can do it, or change the member's role. |
| 403 | `member_deactivated` | The signed-in person's access to the organization was deactivated, or they were removed from it. It holds from their next request, whatever their session token says. An admin of the organization can let a deactivated member in again. |
| 404 | `not_found` | No such resource for this caller, or no such route. |
| 409 | `limit_reached` | The abuse ceiling for inboxes, custom domains, keys, endpoints, services, relying parties, the services an address signs in to, the sends an inbox has waiting for its owner or the invitations an organization has open; delete, revoke or decide one first. |
| 409 | `already_exists` | The mailbox name or the `externalId` is already in use (`field` says which), or another account holds the custom domain, here or at the mail transport. |
| 409 | `domain_not_verified` | The custom domain has not verified its required DNS records. |
| 409 | `account_mismatch` | The request named another account in `x-doorman-account` than the one its credential acts for, as happens when the console's organization was switched in another tab. Reload and try again. |
| 500 | `internal_error` | Something went wrong on the server. |
| 503 | `custom_domains_unavailable` | The custom-domain mail transport and inbound webhook are not fully configured. |

curl:
```sh
curl -s -X POST "https://api.doorman.fyi/v1/inboxes" \
  -H "authorization: Bearer $DOORMAN_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "mailboxName": "concierge",
    "displayName": "Acme concierge"
  }'
```

TypeScript:
```ts
const response = await fetch("https://api.doorman.fyi/v1/inboxes", {
  method: "POST",
  headers: {
    authorization: `Bearer ${process.env.DOORMAN_API_KEY}`,
    "content-type": "application/json",
  },
  redirect: "manual", credentials: "omit",
  body: JSON.stringify({
    "mailboxName": "concierge",
    "displayName": "Acme concierge"
  }),
});
if (!response.ok) throw new Error(`The API answered ${response.status}.`);
const result = await response.json();
```

Python:
```python
import os
import requests

response = requests.post(
    "https://api.doorman.fyi/v1/inboxes",
    headers={"authorization": f"Bearer {os.environ['DOORMAN_API_KEY']}"},
    json={
        "mailboxName": "concierge",
        "displayName": "Acme concierge",
    },
    allow_redirects=False, timeout=30,
)
response.raise_for_status()
result = response.json()
```

## Read an inbox

`GET /v1/inboxes/{inboxId}`

Access `any`: any API key, or a console session.

One inbox. An inbox-scoped key can read its own only; anything else is 404.

OAuth: allowed with all of `inboxes:read`. [App permissions](https://doorman.fyi/docs/oauth.md#scopes) apply in addition to account and resource checks.

Also available as [`client.inboxes.get`](https://doorman.fyi/docs/sdk/reference/inboxes.md#inboxes-get) in TypeScript, [`client.inboxes.get`](https://doorman.fyi/docs/python/reference/inboxes.md#inboxes-get) in Python, the [`inboxes_get`](https://doorman.fyi/docs/mcp/tools/inboxes.md#inboxes-get) tool and [`doorman inboxes get`](https://doorman.fyi/docs/cli/commands/inboxes.md#inboxes-get) on the command line.

Organizations: every member's console session may call it. See [Roles and permissions](https://doorman.fyi/docs/organizations.md#roles).

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `inboxId` | path | `string` | yes | The inbox. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`. |

Answers `200`: The inbox.

**Response 200: Inbox**
An address on the inbox domain that receives mail as soon as it exists.
- `id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `address` (string): The full address: the mailbox name at the inbox domain. Example: `concierge@doorman.example`
- `mailboxName` (string): The part before the @. Example: `concierge`
- `domain` (string): The inbox domain of this deployment. Example: `doorman.example`
- `domainId` (string | null, optional): The custom domain identifier; null on the shared domain. Older deployments omit it.
- `displayName` (string | null): The sender name on outbound mail; null when none is set.
- `signature` (string | null, optional): Plain text appended to every message the inbox sends, under a `-- ` line; null when none is set. Older deployments omit it. Example: `Acme concierge
acme.example`
- `signatureHtml` (string | null, optional): The signature as markup, appended to the HTML part of every message the inbox sends, as it was stored: scripts, style sheets, forms, event handlers and images that are not https are removed when it is set. Null when the signature is plain text only. Older deployments omit it. Example: `<table cellpadding="0" cellspacing="0"><tr><td style="font-family:Arial,sans-serif;font-size:14px"><b>Acme concierge</b><br><a href="https://acme.example">acme.example</a></td></tr></table>`
- `externalId` (string | null): Your own identifier for the inbox; null when none was given. Example: `customer-8841`
- `metadata` (Metadata, optional)
- `webhookUrl` (string | null): The inbox webhook's URL, or null when the inbox has none.
- `status` ("active" | "suspended" | "deleted"): Only active inboxes receive and send; a deleted inbox is never returned.
- `createdAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `updatedAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`

Example 200 response:
```json
{
  "id": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "address": "concierge@doorman.example",
  "mailboxName": "concierge",
  "domain": "doorman.example",
  "displayName": "Acme concierge",
  "externalId": "customer-8841",
  "metadata": {},
  "webhookUrl": null,
  "status": "active",
  "createdAt": "2026-11-05T10:05:00.000Z",
  "updatedAt": "2026-11-05T10:05:00.000Z"
}
```

**Errors**

| Status | Error | Meaning |
| --- | --- | --- |
| 401 | `unauthorized` | The credential was missing, malformed, revoked or belongs to an inactive account. |
| 401 | `session_invalid` | The console session token could not be verified. |
| 401 | `session_expired` | The console session token has expired. |
| 401 | `session_claims_missing` | The session token does not carry a verified email address. |
| 403 | `insufficient_scope` | The app's token lacks a required scope, or the operation cannot be delegated. |
| 403 | `account_suspended` | The account is suspended. |
| 403 | `account_deleted` | The account was deleted. |
| 403 | `member_deactivated` | The signed-in person's access to the organization was deactivated, or they were removed from it. It holds from their next request, whatever their session token says. An admin of the organization can let a deactivated member in again. |
| 404 | `not_found` | No such resource for this caller, or no such route. |
| 409 | `account_mismatch` | The request named another account in `x-doorman-account` than the one its credential acts for, as happens when the console's organization was switched in another tab. Reload and try again. |
| 500 | `internal_error` | Something went wrong on the server. |

curl:
```sh
curl -s "https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z" \
  -H "authorization: Bearer $DOORMAN_API_KEY"
```

TypeScript:
```ts
const response = await fetch("https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z", {
  headers: {
    authorization: `Bearer ${process.env.DOORMAN_API_KEY}`,
  },
  redirect: "manual", credentials: "omit",
});
if (!response.ok) throw new Error(`The API answered ${response.status}.`);
const result = await response.json();
```

Python:
```python
import os
import requests

response = requests.get(
    "https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
    headers={"authorization": f"Bearer {os.environ['DOORMAN_API_KEY']}"},
    allow_redirects=False, timeout=30,
)
response.raise_for_status()
result = response.json()
```

## Update an inbox

`PATCH /v1/inboxes/{inboxId}`

Access `account`: an account-scoped key or a console session; an inbox-scoped key gets 403 `forbidden`.

Changes the display name, external identifier or metadata. Null clears either name or externalId; metadata replaces the whole map and {} clears it. Fields left out stay as they are. The address cannot change. An `externalId` already carried by another active inbox of the account answers 409 `already_exists`.

OAuth: allowed with all of `inboxes:write`. [App permissions](https://doorman.fyi/docs/oauth.md#scopes) apply in addition to account and resource checks.

Also available as [`client.inboxes.update`](https://doorman.fyi/docs/sdk/reference/inboxes.md#inboxes-update) in TypeScript, [`client.inboxes.update`](https://doorman.fyi/docs/python/reference/inboxes.md#inboxes-update) in Python, the [`inboxes_update`](https://doorman.fyi/docs/mcp/tools/inboxes.md#inboxes-update) tool and [`doorman inboxes update`](https://doorman.fyi/docs/cli/commands/inboxes.md#inboxes-update) on the command line.

Organizations: a member's console session needs `inboxes:manage`. API keys and app tokens are not held to member permissions. See [Roles and permissions](https://doorman.fyi/docs/organizations.md#roles).

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `inboxId` | path | `string` | yes | The inbox. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`. |

**Request body (application/json): UpdateInbox**
Changes to an inbox; fields left out stay as they are. The address never changes.
- `displayName` (string | null, optional): The new sender name; null or empty clears it.
- `signature` (string | null, optional): The new signature: plain text of at most 1000 characters, line breaks kept. It is appended to every message the inbox sends from then on, a rule's forward excepted. On the shared domain a signature may not present the sender as the company (the doorman or theovex brand beside a word such as team, support or security): that answers 400 validation_error, for this field and for `signatureHtml`. Null or empty clears it.
- `signatureHtml` (string | null, optional): The signature as markup, at most 10000 characters: tables, inline styles, links and https images, as a signature builder exports it. It is cleaned before it is stored (scripts, style sheets, forms, frames, event handlers, and images that are not https are removed), and the answer carries what was kept. From then on every message the inbox sends carries it in its HTML part, and a message sent as text alone gains an HTML part for it; `signature` stays the text part's. When it is set on an inbox that has no `signature`, and none is given with it, the text is read from the markup. Null or empty clears it.
- `externalId` (string | null, optional): Your new identifier for the inbox; null clears it.
- `metadata` (Metadata, optional)

Answers `200`: The inbox as it is now.

**Response 200: Inbox**
An address on the inbox domain that receives mail as soon as it exists.
- `id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `address` (string): The full address: the mailbox name at the inbox domain. Example: `concierge@doorman.example`
- `mailboxName` (string): The part before the @. Example: `concierge`
- `domain` (string): The inbox domain of this deployment. Example: `doorman.example`
- `domainId` (string | null, optional): The custom domain identifier; null on the shared domain. Older deployments omit it.
- `displayName` (string | null): The sender name on outbound mail; null when none is set.
- `signature` (string | null, optional): Plain text appended to every message the inbox sends, under a `-- ` line; null when none is set. Older deployments omit it. Example: `Acme concierge
acme.example`
- `signatureHtml` (string | null, optional): The signature as markup, appended to the HTML part of every message the inbox sends, as it was stored: scripts, style sheets, forms, event handlers and images that are not https are removed when it is set. Null when the signature is plain text only. Older deployments omit it. Example: `<table cellpadding="0" cellspacing="0"><tr><td style="font-family:Arial,sans-serif;font-size:14px"><b>Acme concierge</b><br><a href="https://acme.example">acme.example</a></td></tr></table>`
- `externalId` (string | null): Your own identifier for the inbox; null when none was given. Example: `customer-8841`
- `metadata` (Metadata, optional)
- `webhookUrl` (string | null): The inbox webhook's URL, or null when the inbox has none.
- `status` ("active" | "suspended" | "deleted"): Only active inboxes receive and send; a deleted inbox is never returned.
- `createdAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `updatedAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`

Example 200 response:
```json
{
  "id": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "address": "concierge@doorman.example",
  "mailboxName": "concierge",
  "domain": "doorman.example",
  "displayName": "Acme concierge",
  "externalId": "customer-8841",
  "metadata": {},
  "webhookUrl": null,
  "status": "active",
  "createdAt": "2026-11-05T10:05:00.000Z",
  "updatedAt": "2026-11-05T10:05:00.000Z"
}
```

**Errors**

| Status | Error | Meaning |
| --- | --- | --- |
| 400 | `validation_error` | A field is missing or invalid; the message names it. |
| 401 | `unauthorized` | The credential was missing, malformed, revoked or belongs to an inactive account. |
| 401 | `session_invalid` | The console session token could not be verified. |
| 401 | `session_expired` | The console session token has expired. |
| 401 | `session_claims_missing` | The session token does not carry a verified email address. |
| 403 | `forbidden` | The key is scoped to one inbox and cannot manage inboxes, keys or webhooks, or cannot read account-wide data. |
| 403 | `insufficient_scope` | The app's token lacks a required scope, or the operation cannot be delegated. |
| 403 | `account_suspended` | The account is suspended. |
| 403 | `account_deleted` | The account was deleted. |
| 403 | `permission_denied` | The signed-in member's role in the organization lacks a permission the operation needs; `permission` names it. An admin of the organization can do it, or change the member's role. |
| 403 | `member_deactivated` | The signed-in person's access to the organization was deactivated, or they were removed from it. It holds from their next request, whatever their session token says. An admin of the organization can let a deactivated member in again. |
| 404 | `not_found` | No such resource for this caller, or no such route. |
| 409 | `already_exists` | The mailbox name or the `externalId` is already in use (`field` says which), or another account holds the custom domain, here or at the mail transport. |
| 409 | `account_mismatch` | The request named another account in `x-doorman-account` than the one its credential acts for, as happens when the console's organization was switched in another tab. Reload and try again. |
| 500 | `internal_error` | Something went wrong on the server. |

curl:
```sh
curl -s -X PATCH "https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z" \
  -H "authorization: Bearer $DOORMAN_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "displayName": "Acme concierge"
  }'
```

TypeScript:
```ts
const response = await fetch("https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z", {
  method: "PATCH",
  headers: {
    authorization: `Bearer ${process.env.DOORMAN_API_KEY}`,
    "content-type": "application/json",
  },
  redirect: "manual", credentials: "omit",
  body: JSON.stringify({
    "displayName": "Acme concierge"
  }),
});
if (!response.ok) throw new Error(`The API answered ${response.status}.`);
const result = await response.json();
```

Python:
```python
import os
import requests

response = requests.patch(
    "https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
    headers={"authorization": f"Bearer {os.environ['DOORMAN_API_KEY']}"},
    json={
        "displayName": "Acme concierge",
    },
    allow_redirects=False, timeout=30,
)
response.raise_for_status()
result = response.json()
```

## Delete an inbox

`DELETE /v1/inboxes/{inboxId}`

Access `account`: an account-scoped key or a console session; an inbox-scoped key gets 403 `forbidden`.

Deletes the inbox, revokes its keys, removes its webhook, closes its stream connections and stops delivery. The address is held for 180 days before another account can reuse it. Where the deployment erases, what it held is erased 30 days later.

OAuth: allowed with all of `inboxes:write`. [App permissions](https://doorman.fyi/docs/oauth.md#scopes) apply in addition to account and resource checks.

Also available as [`client.inboxes.delete`](https://doorman.fyi/docs/sdk/reference/inboxes.md#inboxes-delete) in TypeScript, [`client.inboxes.delete`](https://doorman.fyi/docs/python/reference/inboxes.md#inboxes-delete) in Python, the [`inboxes_delete`](https://doorman.fyi/docs/mcp/tools/inboxes.md#inboxes-delete) tool and [`doorman inboxes delete`](https://doorman.fyi/docs/cli/commands/inboxes.md#inboxes-delete) on the command line.

Organizations: a member's console session needs `inboxes:manage`. API keys and app tokens are not held to member permissions. See [Roles and permissions](https://doorman.fyi/docs/organizations.md#roles).

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `inboxId` | path | `string` | yes | The inbox. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`. |

Answers `204`: Deleted.

**Errors**

| Status | Error | Meaning |
| --- | --- | --- |
| 401 | `unauthorized` | The credential was missing, malformed, revoked or belongs to an inactive account. |
| 401 | `session_invalid` | The console session token could not be verified. |
| 401 | `session_expired` | The console session token has expired. |
| 401 | `session_claims_missing` | The session token does not carry a verified email address. |
| 403 | `forbidden` | The key is scoped to one inbox and cannot manage inboxes, keys or webhooks, or cannot read account-wide data. |
| 403 | `insufficient_scope` | The app's token lacks a required scope, or the operation cannot be delegated. |
| 403 | `account_suspended` | The account is suspended. |
| 403 | `account_deleted` | The account was deleted. |
| 403 | `permission_denied` | The signed-in member's role in the organization lacks a permission the operation needs; `permission` names it. An admin of the organization can do it, or change the member's role. |
| 403 | `member_deactivated` | The signed-in person's access to the organization was deactivated, or they were removed from it. It holds from their next request, whatever their session token says. An admin of the organization can let a deactivated member in again. |
| 404 | `not_found` | No such resource for this caller, or no such route. |
| 409 | `account_mismatch` | The request named another account in `x-doorman-account` than the one its credential acts for, as happens when the console's organization was switched in another tab. Reload and try again. |
| 500 | `internal_error` | Something went wrong on the server. |

curl:
```sh
curl -s -X DELETE "https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z" \
  -H "authorization: Bearer $DOORMAN_API_KEY"
```

TypeScript:
```ts
const response = await fetch("https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z", {
  method: "DELETE",
  headers: {
    authorization: `Bearer ${process.env.DOORMAN_API_KEY}`,
  },
  redirect: "manual", credentials: "omit",
});
if (!response.ok) throw new Error(`The API answered ${response.status}.`);
// 204: nothing to read.
```

Python:
```python
import os
import requests

response = requests.delete(
    "https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
    headers={"authorization": f"Bearer {os.environ['DOORMAN_API_KEY']}"},
    allow_redirects=False, timeout=30,
)
response.raise_for_status()
# 204: nothing to read.
```

## List inbound rules

`GET /v1/inboxes/{inboxId}/rules`

Access `account`: an account-scoped key or a console session; an inbox-scoped key gets 403 `forbidden`.

The inbox's rules, oldest first with id as the tie-breaker. At most 25 rules per inbox.

OAuth: allowed with all of `rules:manage`, `mail:read`, `mail:write`, `mail:send`. [App permissions](https://doorman.fyi/docs/oauth.md#scopes) apply in addition to account and resource checks.

Also available as [`client.inboxes.rules.list`](https://doorman.fyi/docs/sdk/reference/inboxes.md#inboxes-rules-list) in TypeScript, [`client.inboxes.rules.list`](https://doorman.fyi/docs/python/reference/inboxes.md#inboxes-rules-list) in Python, the [`inboxes_rules_list`](https://doorman.fyi/docs/mcp/tools/inboxes.md#inboxes-rules-list) tool and [`doorman inboxes rules list`](https://doorman.fyi/docs/cli/commands/inboxes.md#inboxes-rules-list) on the command line.

Organizations: every member's console session may call it. See [Roles and permissions](https://doorman.fyi/docs/organizations.md#roles).

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `inboxId` | path | `string` | yes | The inbox. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`. |

Answers `200`: The rules.

**Response 200: RuleList**
The inbox's rules, oldest first. At most 25.
- `data` (Rule[])

**Errors**

| Status | Error | Meaning |
| --- | --- | --- |
| 401 | `unauthorized` | The credential was missing, malformed, revoked or belongs to an inactive account. |
| 401 | `session_invalid` | The console session token could not be verified. |
| 401 | `session_expired` | The console session token has expired. |
| 401 | `session_claims_missing` | The session token does not carry a verified email address. |
| 403 | `forbidden` | The key is scoped to one inbox and cannot manage inboxes, keys or webhooks, or cannot read account-wide data. |
| 403 | `insufficient_scope` | The app's token lacks a required scope, or the operation cannot be delegated. |
| 403 | `account_suspended` | The account is suspended. |
| 403 | `account_deleted` | The account was deleted. |
| 403 | `member_deactivated` | The signed-in person's access to the organization was deactivated, or they were removed from it. It holds from their next request, whatever their session token says. An admin of the organization can let a deactivated member in again. |
| 404 | `not_found` | No such resource for this caller, or no such route. |
| 409 | `account_mismatch` | The request named another account in `x-doorman-account` than the one its credential acts for, as happens when the console's organization was switched in another tab. Reload and try again. |
| 500 | `internal_error` | Something went wrong on the server. |

curl:
```sh
curl -s "https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z/rules" \
  -H "authorization: Bearer $DOORMAN_API_KEY"
```

TypeScript:
```ts
const response = await fetch("https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z/rules", {
  headers: {
    authorization: `Bearer ${process.env.DOORMAN_API_KEY}`,
  },
  redirect: "manual", credentials: "omit",
});
if (!response.ok) throw new Error(`The API answered ${response.status}.`);
const result = await response.json();
```

Python:
```python
import os
import requests

response = requests.get(
    "https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z/rules",
    headers={"authorization": f"Bearer {os.environ['DOORMAN_API_KEY']}"},
    allow_redirects=False, timeout=30,
)
response.raise_for_status()
result = response.json()
```

## Create an inbound rule

`POST /v1/inboxes/{inboxId}/rules`

Access `account`: an account-scoped key or a console session; an inbox-scoped key gets 403 `forbidden`.

All when conditions must match after classification. Actions run in array order; one outbound action is selected per inbound message across matching rules. Auto-replies and forwards require loop-safe personal mail, use plain text and respect send limits. At most 25 rules per inbox and 5 actions per rule. Enabled by default.

OAuth: allowed with all of `rules:manage`, `mail:read`, `mail:write`, `mail:send`. [App permissions](https://doorman.fyi/docs/oauth.md#scopes) apply in addition to account and resource checks.

Also available as [`client.inboxes.rules.create`](https://doorman.fyi/docs/sdk/reference/inboxes.md#inboxes-rules-create) in TypeScript, [`client.inboxes.rules.create`](https://doorman.fyi/docs/python/reference/inboxes.md#inboxes-rules-create) in Python, the [`inboxes_rules_create`](https://doorman.fyi/docs/mcp/tools/inboxes.md#inboxes-rules-create) tool and [`doorman inboxes rules create`](https://doorman.fyi/docs/cli/commands/inboxes.md#inboxes-rules-create) on the command line.

Organizations: a member's console session needs `inboxes:manage`, `mail:read`, `mail:write` and `mail:send`. API keys and app tokens are not held to member permissions. See [Roles and permissions](https://doorman.fyi/docs/organizations.md#roles).

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `inboxId` | path | `string` | yes | The inbox. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`. |

**Request body (application/json): CreateRule**
An inbound rule, enabled by default. Only account credentials may manage rules.
- `name` (string)
- `enabled` (boolean, optional)
- `when` (RuleWhen)
- `then` (RuleAction[]): Executed in array order. At most one auto_reply or forward action per rule.

Answers `201`: The rule.

**Response 201: Rule**
An inbound rule. Rules run oldest first, with id as the tie-breaker; actions run in array order.
- `id` (string): An inbox rule identifier. Example: `rul_01jc5f1a2b3c4d5e6f7g8h9j0k`
- `installationId` (string, optional): Present for an installation-owned rule. Revocation stops execution. Example: `ins_01jc5f1a2b3c4d5e6f7g8h9j0k`
- `inboxId` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `name` (string)
- `enabled` (boolean)
- `when` (RuleWhen)
- `then` (RuleAction[]): Executed in array order. At most one auto_reply or forward action per rule.
- `createdAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `updatedAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`

Example 201 response:
```json
{
  "id": "rul_01jc5f1a2b3c4d5e6f7g8h9j0k",
  "inboxId": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "name": "Invoice triage",
  "enabled": true,
  "when": {
    "category": "personal",
    "subjectContains": "invoice"
  },
  "then": [
    {
      "type": "label",
      "label": "billing"
    }
  ],
  "createdAt": "2026-11-05T10:05:00.000Z",
  "updatedAt": "2026-11-05T10:05:00.000Z"
}
```

**Errors**

| Status | Error | Meaning |
| --- | --- | --- |
| 400 | `validation_error` | A field is missing or invalid; the message names it. |
| 401 | `unauthorized` | The credential was missing, malformed, revoked or belongs to an inactive account. |
| 401 | `session_invalid` | The console session token could not be verified. |
| 401 | `session_expired` | The console session token has expired. |
| 401 | `session_claims_missing` | The session token does not carry a verified email address. |
| 403 | `forbidden` | The key is scoped to one inbox and cannot manage inboxes, keys or webhooks, or cannot read account-wide data. |
| 403 | `insufficient_scope` | The app's token lacks a required scope, or the operation cannot be delegated. |
| 403 | `account_suspended` | The account is suspended. |
| 403 | `account_deleted` | The account was deleted. |
| 403 | `permission_denied` | The signed-in member's role in the organization lacks a permission the operation needs; `permission` names it. An admin of the organization can do it, or change the member's role. |
| 403 | `member_deactivated` | The signed-in person's access to the organization was deactivated, or they were removed from it. It holds from their next request, whatever their session token says. An admin of the organization can let a deactivated member in again. |
| 404 | `not_found` | No such resource for this caller, or no such route. |
| 409 | `limit_reached` | The abuse ceiling for inboxes, custom domains, keys, endpoints, services, relying parties, the services an address signs in to, the sends an inbox has waiting for its owner or the invitations an organization has open; delete, revoke or decide one first. |
| 409 | `account_mismatch` | The request named another account in `x-doorman-account` than the one its credential acts for, as happens when the console's organization was switched in another tab. Reload and try again. |
| 500 | `internal_error` | Something went wrong on the server. |

curl:
```sh
curl -s -X POST "https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z/rules" \
  -H "authorization: Bearer $DOORMAN_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "name": "Invoice triage",
    "when": {
      "category": "personal",
      "subjectContains": "invoice"
    },
    "then": [
      {
        "type": "label",
        "label": "billing"
      }
    ]
  }'
```

TypeScript:
```ts
const response = await fetch("https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z/rules", {
  method: "POST",
  headers: {
    authorization: `Bearer ${process.env.DOORMAN_API_KEY}`,
    "content-type": "application/json",
  },
  redirect: "manual", credentials: "omit",
  body: JSON.stringify({
    "name": "Invoice triage",
    "when": {
      "category": "personal",
      "subjectContains": "invoice"
    },
    "then": [
      {
        "type": "label",
        "label": "billing"
      }
    ]
  }),
});
if (!response.ok) throw new Error(`The API answered ${response.status}.`);
const result = await response.json();
```

Python:
```python
import os
import requests

response = requests.post(
    "https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z/rules",
    headers={"authorization": f"Bearer {os.environ['DOORMAN_API_KEY']}"},
    json={
        "name": "Invoice triage",
        "when": {
            "category": "personal",
            "subjectContains": "invoice",
        },
        "then": [{
            "type": "label",
            "label": "billing",
        }],
    },
    allow_redirects=False, timeout=30,
)
response.raise_for_status()
result = response.json()
```

## Read an inbound rule

`GET /v1/inboxes/{inboxId}/rules/{ruleId}`

Access `account`: an account-scoped key or a console session; an inbox-scoped key gets 403 `forbidden`.

One rule belonging to this inbox.

OAuth: allowed with all of `rules:manage`, `mail:read`, `mail:write`, `mail:send`. [App permissions](https://doorman.fyi/docs/oauth.md#scopes) apply in addition to account and resource checks.

Also available as [`client.inboxes.rules.get`](https://doorman.fyi/docs/sdk/reference/inboxes.md#inboxes-rules-get) in TypeScript, [`client.inboxes.rules.get`](https://doorman.fyi/docs/python/reference/inboxes.md#inboxes-rules-get) in Python, the [`inboxes_rules_get`](https://doorman.fyi/docs/mcp/tools/inboxes.md#inboxes-rules-get) tool and [`doorman inboxes rules get`](https://doorman.fyi/docs/cli/commands/inboxes.md#inboxes-rules-get) on the command line.

Organizations: every member's console session may call it. See [Roles and permissions](https://doorman.fyi/docs/organizations.md#roles).

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `inboxId` | path | `string` | yes | The inbox. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`. |
| `ruleId` | path | `string` | yes | The rule. Example: `rul_01jc5f1a2b3c4d5e6f7g8h9j0k`. |

Answers `200`: The rule.

**Response 200: Rule**
An inbound rule. Rules run oldest first, with id as the tie-breaker; actions run in array order.
- `id` (string): An inbox rule identifier. Example: `rul_01jc5f1a2b3c4d5e6f7g8h9j0k`
- `installationId` (string, optional): Present for an installation-owned rule. Revocation stops execution. Example: `ins_01jc5f1a2b3c4d5e6f7g8h9j0k`
- `inboxId` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `name` (string)
- `enabled` (boolean)
- `when` (RuleWhen)
- `then` (RuleAction[]): Executed in array order. At most one auto_reply or forward action per rule.
- `createdAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `updatedAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`

Example 200 response:
```json
{
  "id": "rul_01jc5f1a2b3c4d5e6f7g8h9j0k",
  "inboxId": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "name": "Invoice triage",
  "enabled": true,
  "when": {
    "category": "personal",
    "subjectContains": "invoice"
  },
  "then": [
    {
      "type": "label",
      "label": "billing"
    }
  ],
  "createdAt": "2026-11-05T10:05:00.000Z",
  "updatedAt": "2026-11-05T10:05:00.000Z"
}
```

**Errors**

| Status | Error | Meaning |
| --- | --- | --- |
| 401 | `unauthorized` | The credential was missing, malformed, revoked or belongs to an inactive account. |
| 401 | `session_invalid` | The console session token could not be verified. |
| 401 | `session_expired` | The console session token has expired. |
| 401 | `session_claims_missing` | The session token does not carry a verified email address. |
| 403 | `forbidden` | The key is scoped to one inbox and cannot manage inboxes, keys or webhooks, or cannot read account-wide data. |
| 403 | `insufficient_scope` | The app's token lacks a required scope, or the operation cannot be delegated. |
| 403 | `account_suspended` | The account is suspended. |
| 403 | `account_deleted` | The account was deleted. |
| 403 | `member_deactivated` | The signed-in person's access to the organization was deactivated, or they were removed from it. It holds from their next request, whatever their session token says. An admin of the organization can let a deactivated member in again. |
| 404 | `not_found` | No such resource for this caller, or no such route. |
| 409 | `account_mismatch` | The request named another account in `x-doorman-account` than the one its credential acts for, as happens when the console's organization was switched in another tab. Reload and try again. |
| 500 | `internal_error` | Something went wrong on the server. |

curl:
```sh
curl -s "https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z/rules/rul_01jc5f1a2b3c4d5e6f7g8h9j0k" \
  -H "authorization: Bearer $DOORMAN_API_KEY"
```

TypeScript:
```ts
const response = await fetch("https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z/rules/rul_01jc5f1a2b3c4d5e6f7g8h9j0k", {
  headers: {
    authorization: `Bearer ${process.env.DOORMAN_API_KEY}`,
  },
  redirect: "manual", credentials: "omit",
});
if (!response.ok) throw new Error(`The API answered ${response.status}.`);
const result = await response.json();
```

Python:
```python
import os
import requests

response = requests.get(
    "https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z/rules/rul_01jc5f1a2b3c4d5e6f7g8h9j0k",
    headers={"authorization": f"Bearer {os.environ['DOORMAN_API_KEY']}"},
    allow_redirects=False, timeout=30,
)
response.raise_for_status()
result = response.json()
```

## Update an inbound rule

`PATCH /v1/inboxes/{inboxId}/rules/{ruleId}`

Access `account`: an account-scoped key or a console session; an inbox-scoped key gets 403 `forbidden`.

Replace the supplied fields. Updates cancel pending executions of the old revision; disabling a rule prevents new matches.

OAuth: allowed with all of `rules:manage`, `mail:read`, `mail:write`, `mail:send`. [App permissions](https://doorman.fyi/docs/oauth.md#scopes) apply in addition to account and resource checks.

Also available as [`client.inboxes.rules.update`](https://doorman.fyi/docs/sdk/reference/inboxes.md#inboxes-rules-update) in TypeScript, [`client.inboxes.rules.update`](https://doorman.fyi/docs/python/reference/inboxes.md#inboxes-rules-update) in Python, the [`inboxes_rules_update`](https://doorman.fyi/docs/mcp/tools/inboxes.md#inboxes-rules-update) tool and [`doorman inboxes rules update`](https://doorman.fyi/docs/cli/commands/inboxes.md#inboxes-rules-update) on the command line.

Organizations: a member's console session needs `inboxes:manage`, `mail:read`, `mail:write` and `mail:send`. API keys and app tokens are not held to member permissions. See [Roles and permissions](https://doorman.fyi/docs/organizations.md#roles).

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `inboxId` | path | `string` | yes | The inbox. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`. |
| `ruleId` | path | `string` | yes | The rule. Example: `rul_01jc5f1a2b3c4d5e6f7g8h9j0k`. |

**Request body (application/json): UpdateRule**
Replace the supplied fields; omitted fields stay as they are. Changes cancel pending executions of the old revision.
- `name` (string, optional)
- `enabled` (boolean, optional)
- `when` (RuleWhen, optional)
- `then` (RuleAction[], optional): Executed in array order. At most one auto_reply or forward action per rule.

Answers `200`: The rule as it is now.

**Response 200: Rule**
An inbound rule. Rules run oldest first, with id as the tie-breaker; actions run in array order.
- `id` (string): An inbox rule identifier. Example: `rul_01jc5f1a2b3c4d5e6f7g8h9j0k`
- `installationId` (string, optional): Present for an installation-owned rule. Revocation stops execution. Example: `ins_01jc5f1a2b3c4d5e6f7g8h9j0k`
- `inboxId` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `name` (string)
- `enabled` (boolean)
- `when` (RuleWhen)
- `then` (RuleAction[]): Executed in array order. At most one auto_reply or forward action per rule.
- `createdAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `updatedAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`

Example 200 response:
```json
{
  "id": "rul_01jc5f1a2b3c4d5e6f7g8h9j0k",
  "inboxId": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "name": "Invoice triage",
  "enabled": true,
  "when": {
    "category": "personal",
    "subjectContains": "invoice"
  },
  "then": [
    {
      "type": "label",
      "label": "billing"
    }
  ],
  "createdAt": "2026-11-05T10:05:00.000Z",
  "updatedAt": "2026-11-05T10:05:00.000Z"
}
```

**Errors**

| Status | Error | Meaning |
| --- | --- | --- |
| 400 | `validation_error` | A field is missing or invalid; the message names it. |
| 401 | `unauthorized` | The credential was missing, malformed, revoked or belongs to an inactive account. |
| 401 | `session_invalid` | The console session token could not be verified. |
| 401 | `session_expired` | The console session token has expired. |
| 401 | `session_claims_missing` | The session token does not carry a verified email address. |
| 403 | `forbidden` | The key is scoped to one inbox and cannot manage inboxes, keys or webhooks, or cannot read account-wide data. |
| 403 | `insufficient_scope` | The app's token lacks a required scope, or the operation cannot be delegated. |
| 403 | `account_suspended` | The account is suspended. |
| 403 | `account_deleted` | The account was deleted. |
| 403 | `permission_denied` | The signed-in member's role in the organization lacks a permission the operation needs; `permission` names it. An admin of the organization can do it, or change the member's role. |
| 403 | `member_deactivated` | The signed-in person's access to the organization was deactivated, or they were removed from it. It holds from their next request, whatever their session token says. An admin of the organization can let a deactivated member in again. |
| 404 | `not_found` | No such resource for this caller, or no such route. |
| 409 | `account_mismatch` | The request named another account in `x-doorman-account` than the one its credential acts for, as happens when the console's organization was switched in another tab. Reload and try again. |
| 500 | `internal_error` | Something went wrong on the server. |

curl:
```sh
curl -s -X PATCH "https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z/rules/rul_01jc5f1a2b3c4d5e6f7g8h9j0k" \
  -H "authorization: Bearer $DOORMAN_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "enabled": false
  }'
```

TypeScript:
```ts
const response = await fetch("https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z/rules/rul_01jc5f1a2b3c4d5e6f7g8h9j0k", {
  method: "PATCH",
  headers: {
    authorization: `Bearer ${process.env.DOORMAN_API_KEY}`,
    "content-type": "application/json",
  },
  redirect: "manual", credentials: "omit",
  body: JSON.stringify({
    "enabled": false
  }),
});
if (!response.ok) throw new Error(`The API answered ${response.status}.`);
const result = await response.json();
```

Python:
```python
import os
import requests

response = requests.patch(
    "https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z/rules/rul_01jc5f1a2b3c4d5e6f7g8h9j0k",
    headers={"authorization": f"Bearer {os.environ['DOORMAN_API_KEY']}"},
    json={
        "enabled": False,
    },
    allow_redirects=False, timeout=30,
)
response.raise_for_status()
result = response.json()
```

## Delete an inbound rule

`DELETE /v1/inboxes/{inboxId}/rules/{ruleId}`

Access `account`: an account-scoped key or a console session; an inbox-scoped key gets 403 `forbidden`.

Stops new matches and cancels pending executions. Already-running mail cannot be recalled. Execution history remains readable.

OAuth: allowed with all of `rules:manage`, `mail:read`, `mail:write`, `mail:send`. [App permissions](https://doorman.fyi/docs/oauth.md#scopes) apply in addition to account and resource checks.

Also available as [`client.inboxes.rules.delete`](https://doorman.fyi/docs/sdk/reference/inboxes.md#inboxes-rules-delete) in TypeScript, [`client.inboxes.rules.delete`](https://doorman.fyi/docs/python/reference/inboxes.md#inboxes-rules-delete) in Python, the [`inboxes_rules_delete`](https://doorman.fyi/docs/mcp/tools/inboxes.md#inboxes-rules-delete) tool and [`doorman inboxes rules delete`](https://doorman.fyi/docs/cli/commands/inboxes.md#inboxes-rules-delete) on the command line.

Organizations: a member's console session needs `inboxes:manage`. API keys and app tokens are not held to member permissions. See [Roles and permissions](https://doorman.fyi/docs/organizations.md#roles).

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `inboxId` | path | `string` | yes | The inbox. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`. |
| `ruleId` | path | `string` | yes | The rule. Example: `rul_01jc5f1a2b3c4d5e6f7g8h9j0k`. |

Answers `204`: Deleted.

**Errors**

| Status | Error | Meaning |
| --- | --- | --- |
| 401 | `unauthorized` | The credential was missing, malformed, revoked or belongs to an inactive account. |
| 401 | `session_invalid` | The console session token could not be verified. |
| 401 | `session_expired` | The console session token has expired. |
| 401 | `session_claims_missing` | The session token does not carry a verified email address. |
| 403 | `forbidden` | The key is scoped to one inbox and cannot manage inboxes, keys or webhooks, or cannot read account-wide data. |
| 403 | `insufficient_scope` | The app's token lacks a required scope, or the operation cannot be delegated. |
| 403 | `account_suspended` | The account is suspended. |
| 403 | `account_deleted` | The account was deleted. |
| 403 | `permission_denied` | The signed-in member's role in the organization lacks a permission the operation needs; `permission` names it. An admin of the organization can do it, or change the member's role. |
| 403 | `member_deactivated` | The signed-in person's access to the organization was deactivated, or they were removed from it. It holds from their next request, whatever their session token says. An admin of the organization can let a deactivated member in again. |
| 404 | `not_found` | No such resource for this caller, or no such route. |
| 409 | `account_mismatch` | The request named another account in `x-doorman-account` than the one its credential acts for, as happens when the console's organization was switched in another tab. Reload and try again. |
| 500 | `internal_error` | Something went wrong on the server. |

curl:
```sh
curl -s -X DELETE "https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z/rules/rul_01jc5f1a2b3c4d5e6f7g8h9j0k" \
  -H "authorization: Bearer $DOORMAN_API_KEY"
```

TypeScript:
```ts
const response = await fetch("https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z/rules/rul_01jc5f1a2b3c4d5e6f7g8h9j0k", {
  method: "DELETE",
  headers: {
    authorization: `Bearer ${process.env.DOORMAN_API_KEY}`,
  },
  redirect: "manual", credentials: "omit",
});
if (!response.ok) throw new Error(`The API answered ${response.status}.`);
// 204: nothing to read.
```

Python:
```python
import os
import requests

response = requests.delete(
    "https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z/rules/rul_01jc5f1a2b3c4d5e6f7g8h9j0k",
    headers={"authorization": f"Bearer {os.environ['DOORMAN_API_KEY']}"},
    allow_redirects=False, timeout=30,
)
response.raise_for_status()
# 204: nothing to read.
```

## List rule executions

`GET /v1/inboxes/{inboxId}/rules/{ruleId}/runs`

Access `account`: an account-scoped key or a console session; an inbox-scoped key gets 403 `forbidden`.

The immutable rule snapshots' execution outcomes, newest first. Interrupted or ambiguous sends are uncertain and never automatically re-sent. History remains after the rule is deleted.

OAuth: allowed with all of `rules:manage`, `mail:read`, `mail:write`, `mail:send`. [App permissions](https://doorman.fyi/docs/oauth.md#scopes) apply in addition to account and resource checks.

Also available as [`client.inboxes.rules.runs`](https://doorman.fyi/docs/sdk/reference/inboxes.md#inboxes-rules-runs) in TypeScript, [`client.inboxes.rules.runs`](https://doorman.fyi/docs/python/reference/inboxes.md#inboxes-rules-runs) in Python, the [`inboxes_rules_runs`](https://doorman.fyi/docs/mcp/tools/inboxes.md#inboxes-rules-runs) tool and [`doorman inboxes rules runs`](https://doorman.fyi/docs/cli/commands/inboxes.md#inboxes-rules-runs) on the command line.

Organizations: every member's console session may call it. See [Roles and permissions](https://doorman.fyi/docs/organizations.md#roles).

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `inboxId` | path | `string` | yes | The inbox. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`. |
| `ruleId` | path | `string` | yes | The rule. Example: `rul_01jc5f1a2b3c4d5e6f7g8h9j0k`. |
| `limit` | query | `integer` | no | Page size, 1 to 100. Defaults to 50. |
| `offset` | query | `integer` | no | Rows to skip. Defaults to 0. |

Answers `200`: A page of executions.

**Response 200: RuleRunPage**
Execution history, newest first.
- `data` (RuleRun[])
- `limit` (integer): The page size that was applied.
- `offset` (integer): The offset that was applied.
- `total` (integer)

**Errors**

| Status | Error | Meaning |
| --- | --- | --- |
| 400 | `validation_error` | A field is missing or invalid; the message names it. |
| 401 | `unauthorized` | The credential was missing, malformed, revoked or belongs to an inactive account. |
| 401 | `session_invalid` | The console session token could not be verified. |
| 401 | `session_expired` | The console session token has expired. |
| 401 | `session_claims_missing` | The session token does not carry a verified email address. |
| 403 | `forbidden` | The key is scoped to one inbox and cannot manage inboxes, keys or webhooks, or cannot read account-wide data. |
| 403 | `insufficient_scope` | The app's token lacks a required scope, or the operation cannot be delegated. |
| 403 | `account_suspended` | The account is suspended. |
| 403 | `account_deleted` | The account was deleted. |
| 403 | `member_deactivated` | The signed-in person's access to the organization was deactivated, or they were removed from it. It holds from their next request, whatever their session token says. An admin of the organization can let a deactivated member in again. |
| 404 | `not_found` | No such resource for this caller, or no such route. |
| 409 | `account_mismatch` | The request named another account in `x-doorman-account` than the one its credential acts for, as happens when the console's organization was switched in another tab. Reload and try again. |
| 500 | `internal_error` | Something went wrong on the server. |

curl:
```sh
curl -s "https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z/rules/rul_01jc5f1a2b3c4d5e6f7g8h9j0k/runs" \
  -H "authorization: Bearer $DOORMAN_API_KEY"
```

TypeScript:
```ts
const response = await fetch("https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z/rules/rul_01jc5f1a2b3c4d5e6f7g8h9j0k/runs", {
  headers: {
    authorization: `Bearer ${process.env.DOORMAN_API_KEY}`,
  },
  redirect: "manual", credentials: "omit",
});
if (!response.ok) throw new Error(`The API answered ${response.status}.`);
const result = await response.json();
```

Python:
```python
import os
import requests

response = requests.get(
    "https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z/rules/rul_01jc5f1a2b3c4d5e6f7g8h9j0k/runs",
    headers={"authorization": f"Bearer {os.environ['DOORMAN_API_KEY']}"},
    allow_redirects=False, timeout=30,
)
response.raise_for_status()
result = response.json()
```
