---
title: "Webhooks"
description: "The inbox webhook, account endpoints, their signed deliveries and the delivery log."
url: https://doorman.fyi/docs/reference/webhooks
markdown: https://doorman.fyi/docs/reference/webhooks.md
area: "API reference"
section: "API reference"
---

# Webhooks

The inbox webhook, account endpoints, their signed deliveries and the delivery log.

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

## Read the inbox webhook

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

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

The inbox's webhook URL and its masked secret; both null when the inbox has none.

OAuth: not available to delegated app tokens.

Also available as [`client.inboxes.webhook.get`](https://doorman.fyi/docs/sdk/reference/webhooks.md#inboxes-webhook-get) in TypeScript, [`client.inboxes.webhook.get`](https://doorman.fyi/docs/python/reference/webhooks.md#inboxes-webhook-get) in Python, the [`inboxes_webhook_get`](https://doorman.fyi/docs/mcp/tools/webhooks.md#inboxes-webhook-get) tool and [`doorman inboxes webhook get`](https://doorman.fyi/docs/cli/commands/webhooks.md#inboxes-webhook-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 webhook.

**Response 200: InboxWebhook**
The inbox's single webhook: one URL that receives every event for it.
- `url` (string | null): Null when the inbox has no webhook.
- `secret` (string | null): The signing secret, masked after creation (`whsec_...` and the last four characters).

Example 200 response:
```json
{
  "url": "https://agent.example.com/hooks/doorman",
  "secret": "whsec_...ODk="
}
```

**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/webhook" \
  -H "authorization: Bearer $DOORMAN_API_KEY"
```

TypeScript:
```ts
const response = await fetch("https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z/webhook", {
  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/webhook",
    headers={"authorization": f"Bearer {os.environ['DOORMAN_API_KEY']}"},
    allow_redirects=False, timeout=30,
)
response.raise_for_status()
result = response.json()
```

## Set the inbox webhook

`PUT /v1/inboxes/{inboxId}/webhook`

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

One URL per inbox that receives every event for it. Setting it again replaces the URL and mints a new signing secret, returned once.

OAuth: not available to delegated app tokens.

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

Organizations: a member's console session 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).

**Parameters**

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

**Request body (application/json): SetInboxWebhook**
Where the inbox's events go. Setting it again replaces the URL and mints a new secret.
- `url` (string): An https URL without credentials (http is accepted in local development). Example: `https://agent.example.com/hooks/doorman`

Answers `200`: The webhook with its one-time secret.

**Response 200: InboxWebhookSecret**
The inbox webhook with its new signing secret, shown once.
- `url` (string)
- `secret` (string): A Standard Webhooks secret (whsec_ and base64), shown once. Verify signatures with its decoded bytes. Example: `whsec_dGVzdC13ZWJob29rLXNpZ25pbmctc2VjcmV0LTAxMjM0NTY3ODk=`

Example 200 response:
```json
{
  "url": "https://agent.example.com/hooks/doorman",
  "secret": "whsec_dGVzdC13ZWJob29rLXNpZ25pbmctc2VjcmV0LTAxMjM0NTY3ODk="
}
```

**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 PUT "https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z/webhook" \
  -H "authorization: Bearer $DOORMAN_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "url": "https://agent.example.com/hooks/doorman"
  }'
```

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

Python:
```python
import os
import requests

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

## Rotate the inbox webhook's secret

`POST /v1/inboxes/{inboxId}/webhook/rotate-secret`

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

Mints a new signing secret and returns it once. Deliveries signed with the old one stop verifying at once, so update the receiver first.

OAuth: not available to delegated app tokens.

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

Organizations: a member's console session needs `webhooks: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 `200`: The webhook with its new secret.

**Response 200: InboxWebhookSecret**
The inbox webhook with its new signing secret, shown once.
- `url` (string)
- `secret` (string): A Standard Webhooks secret (whsec_ and base64), shown once. Verify signatures with its decoded bytes. Example: `whsec_dGVzdC13ZWJob29rLXNpZ25pbmctc2VjcmV0LTAxMjM0NTY3ODk=`

Example 200 response:
```json
{
  "url": "https://agent.example.com/hooks/doorman",
  "secret": "whsec_dGVzdC13ZWJob29rLXNpZ25pbmctc2VjcmV0LTAxMjM0NTY3ODk="
}
```

**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 | `no_webhook` | The inbox has no webhook to rotate a secret for. |
| 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/webhook/rotate-secret" \
  -H "authorization: Bearer $DOORMAN_API_KEY"
```

TypeScript:
```ts
const response = await fetch("https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z/webhook/rotate-secret", {
  method: "POST",
  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.post(
    "https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z/webhook/rotate-secret",
    headers={"authorization": f"Bearer {os.environ['DOORMAN_API_KEY']}"},
    allow_redirects=False, timeout=30,
)
response.raise_for_status()
result = response.json()
```

## Remove the inbox webhook

`DELETE /v1/inboxes/{inboxId}/webhook`

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

The inbox stops receiving deliveries; its delivery log stays with the events.

OAuth: not available to delegated app tokens.

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

Organizations: a member's console session needs `webhooks: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`: Removed.

**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/webhook" \
  -H "authorization: Bearer $DOORMAN_API_KEY"
```

TypeScript:
```ts
const response = await fetch("https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z/webhook", {
  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/webhook",
    headers={"authorization": f"Bearer {os.environ['DOORMAN_API_KEY']}"},
    allow_redirects=False, timeout=30,
)
response.raise_for_status()
# 204: nothing to read.
```

## List the inbox webhook's deliveries

`GET /v1/inboxes/{inboxId}/webhook/deliveries`

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

The inbox webhook's delivery log, newest first, including deliveries to URLs the inbox no longer points at.

OAuth: not available to delegated app tokens.

Also available as [`client.inboxes.webhook.deliveries`](https://doorman.fyi/docs/sdk/reference/webhooks.md#inboxes-webhook-deliveries) in TypeScript, [`client.inboxes.webhook.deliveries`](https://doorman.fyi/docs/python/reference/webhooks.md#inboxes-webhook-deliveries) in Python, the [`inboxes_webhook_deliveries`](https://doorman.fyi/docs/mcp/tools/webhooks.md#inboxes-webhook-deliveries) tool and [`doorman inboxes webhook deliveries`](https://doorman.fyi/docs/cli/commands/webhooks.md#inboxes-webhook-deliveries) 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`. |
| `limit` | query | `integer` | no | Page size, 1 to 100. Defaults to 50. |
| `cursor` | query | `string` | no | The delivery id to continue from, from the previous page's `nextCursor`. Example: `whd_01jc5f1a2b3c4d5e6f7g8h9j0k`. |

Answers `200`: A page of deliveries.

**Response 200: DeliveryPage**
A target's deliveries, newest first.
- `data` (Delivery[])
- `nextCursor` (string | null): Pass as `cursor` for the next page; null on the last 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 | `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/webhook/deliveries" \
  -H "authorization: Bearer $DOORMAN_API_KEY"
```

TypeScript:
```ts
const response = await fetch("https://api.doorman.fyi/v1/inboxes/inb_01jc4q7w9k2m5n8p3r6t1v4x7z/webhook/deliveries", {
  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/webhook/deliveries",
    headers={"authorization": f"Bearer {os.environ['DOORMAN_API_KEY']}"},
    allow_redirects=False, timeout=30,
)
response.raise_for_status()
result = response.json()
```

## List endpoints

`GET /v1/webhooks`

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

The account's webhook endpoints, oldest first. Each receives the events it subscribes to, for the inboxes it is scoped to, with its own signing secret.

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

Also available as [`client.webhooks.list`](https://doorman.fyi/docs/sdk/reference/webhooks.md#webhooks-list) in TypeScript, [`client.webhooks.list`](https://doorman.fyi/docs/python/reference/webhooks.md#webhooks-list) in Python, the [`webhooks_list`](https://doorman.fyi/docs/mcp/tools/webhooks.md#webhooks-list) tool and [`doorman webhooks list`](https://doorman.fyi/docs/cli/commands/webhooks.md#webhooks-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).

Answers `200`: The endpoints.

**Response 200: EndpointList**
The account's endpoints, oldest first.
- `data` (Endpoint[])

**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. |
| 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/webhooks" \
  -H "authorization: Bearer $DOORMAN_API_KEY"
```

TypeScript:
```ts
const response = await fetch("https://api.doorman.fyi/v1/webhooks", {
  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/webhooks",
    headers={"authorization": f"Bearer {os.environ['DOORMAN_API_KEY']}"},
    allow_redirects=False, timeout=30,
)
response.raise_for_status()
result = response.json()
```

## Create an endpoint

`POST /v1/webhooks`

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

An https URL without credentials. Empty `eventTypes` or `inboxIds` mean all. The signing secret is returned once. An account holds at most 20 endpoints.

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

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

Organizations: a member's console session 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): CreateEndpoint**
A new account endpoint.
- `name` (string, optional): A label, at most 100 characters. Example: `Orchestrator`
- `url` (string): An https URL without credentials (http is accepted in local development). Example: `https://agent.example.com/hooks/doorman`
- `eventTypes` (("message.received" | "message.sent" | "thread.updated" | "inbox.created" | "inbox.deleted" | "delivery.failed" | "message.held" | "send.held" | "send.discarded" | "sign_in.requested" | "sign_in.completed")[], optional): Event types to receive; empty or absent means all.
- `inboxIds` (string[], optional): Ids of active inboxes of the account to receive for; empty or absent means all. Duplicates are dropped. Example: `["inb_01jc4q7w9k2m5n8p3r6t1v4x7z"]`
- `enabled` (boolean, optional): Whether deliveries start right away. Defaults to true.

Answers `201`: The endpoint with its one-time secret.

**Response 201: CreatedEndpoint**
A new endpoint with its signing secret, shown once.
- `id` (string): A webhook endpoint identifier. Example: `whk_01jc5d1a2b3c4d5e6f7g8h9j0k`
- `installationId` (string, optional): Present for an installation-owned endpoint. Revocation stops delivery. Example: `ins_01jc5f1a2b3c4d5e6f7g8h9j0k`
- `name` (string): A label, possibly empty. Example: `Orchestrator`
- `url` (string) Example: `https://agent.example.com/hooks/doorman`
- `eventTypes` (("message.received" | "message.sent" | "thread.updated" | "inbox.created" | "inbox.deleted" | "delivery.failed" | "message.held" | "send.held" | "send.discarded" | "sign_in.requested" | "sign_in.completed")[]): The event types it receives; empty means all.
- `inboxIds` (string[]): The inboxes it receives for; empty means all.
- `enabled` (boolean): A disabled endpoint receives nothing until it is enabled again.
- `createdAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `updatedAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `lastDelivery` (LastDelivery | null)
- `secret` (string): A Standard Webhooks secret (whsec_ and base64), shown once. Verify signatures with its decoded bytes. Example: `whsec_dGVzdC13ZWJob29rLXNpZ25pbmctc2VjcmV0LTAxMjM0NTY3ODk=`

Example 201 response:
```json
{
  "id": "whk_01jc5d1a2b3c4d5e6f7g8h9j0k",
  "name": "Orchestrator",
  "url": "https://agent.example.com/hooks/doorman",
  "eventTypes": [
    "message.received"
  ],
  "inboxIds": [],
  "enabled": true,
  "createdAt": "2026-11-05T10:05:00.000Z",
  "updatedAt": "2026-11-05T10:05:00.000Z",
  "lastDelivery": null,
  "secret": "whsec_dGVzdC13ZWJob29rLXNpZ25pbmctc2VjcmV0LTAxMjM0NTY3ODk="
}
```

**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. |
| 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/webhooks" \
  -H "authorization: Bearer $DOORMAN_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "name": "Orchestrator",
    "url": "https://agent.example.com/hooks/doorman",
    "eventTypes": [
      "message.received"
    ],
    "inboxIds": [],
    "enabled": true
  }'
```

TypeScript:
```ts
const response = await fetch("https://api.doorman.fyi/v1/webhooks", {
  method: "POST",
  headers: {
    authorization: `Bearer ${process.env.DOORMAN_API_KEY}`,
    "content-type": "application/json",
  },
  redirect: "manual", credentials: "omit",
  body: JSON.stringify({
    "name": "Orchestrator",
    "url": "https://agent.example.com/hooks/doorman",
    "eventTypes": [
      "message.received"
    ],
    "inboxIds": [],
    "enabled": true
  }),
});
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/webhooks",
    headers={"authorization": f"Bearer {os.environ['DOORMAN_API_KEY']}"},
    json={
        "name": "Orchestrator",
        "url": "https://agent.example.com/hooks/doorman",
        "eventTypes": ["message.received"],
        "inboxIds": [],
        "enabled": True,
    },
    allow_redirects=False, timeout=30,
)
response.raise_for_status()
result = response.json()
```

## Read an endpoint

`GET /v1/webhooks/{endpointId}`

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

One endpoint with its newest delivery.

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

Also available as [`client.webhooks.get`](https://doorman.fyi/docs/sdk/reference/webhooks.md#webhooks-get) in TypeScript, [`client.webhooks.get`](https://doorman.fyi/docs/python/reference/webhooks.md#webhooks-get) in Python, the [`webhooks_get`](https://doorman.fyi/docs/mcp/tools/webhooks.md#webhooks-get) tool and [`doorman webhooks get`](https://doorman.fyi/docs/cli/commands/webhooks.md#webhooks-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 |
| --- | --- | --- | --- | --- |
| `endpointId` | path | `string` | yes | The endpoint. Example: `whk_01jc5d1a2b3c4d5e6f7g8h9j0k`. |

Answers `200`: The endpoint.

**Response 200: Endpoint**
An account webhook endpoint: receives the account's events across inboxes, with its own signing secret.
- `id` (string): A webhook endpoint identifier. Example: `whk_01jc5d1a2b3c4d5e6f7g8h9j0k`
- `installationId` (string, optional): Present for an installation-owned endpoint. Revocation stops delivery. Example: `ins_01jc5f1a2b3c4d5e6f7g8h9j0k`
- `name` (string): A label, possibly empty. Example: `Orchestrator`
- `url` (string) Example: `https://agent.example.com/hooks/doorman`
- `eventTypes` (("message.received" | "message.sent" | "thread.updated" | "inbox.created" | "inbox.deleted" | "delivery.failed" | "message.held" | "send.held" | "send.discarded" | "sign_in.requested" | "sign_in.completed")[]): The event types it receives; empty means all.
- `inboxIds` (string[]): The inboxes it receives for; empty means all.
- `enabled` (boolean): A disabled endpoint receives nothing until it is enabled again.
- `createdAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `updatedAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `lastDelivery` (LastDelivery | null)

Example 200 response:
```json
{
  "id": "whk_01jc5d1a2b3c4d5e6f7g8h9j0k",
  "name": "Orchestrator",
  "url": "https://agent.example.com/hooks/doorman",
  "eventTypes": [],
  "inboxIds": [],
  "enabled": true,
  "createdAt": "2026-11-05T10:05:00.000Z",
  "updatedAt": "2026-11-05T10:05:00.000Z",
  "lastDelivery": {
    "status": "delivered",
    "statusCode": 200,
    "at": "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/webhooks/whk_01jc5d1a2b3c4d5e6f7g8h9j0k" \
  -H "authorization: Bearer $DOORMAN_API_KEY"
```

TypeScript:
```ts
const response = await fetch("https://api.doorman.fyi/v1/webhooks/whk_01jc5d1a2b3c4d5e6f7g8h9j0k", {
  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/webhooks/whk_01jc5d1a2b3c4d5e6f7g8h9j0k",
    headers={"authorization": f"Bearer {os.environ['DOORMAN_API_KEY']}"},
    allow_redirects=False, timeout=30,
)
response.raise_for_status()
result = response.json()
```

## Change an endpoint

`PATCH /v1/webhooks/{endpointId}`

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

Any of the fields; the ones left out stay as they are. A disabled endpoint receives nothing until it is enabled again.

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

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

Organizations: a member's console session 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).

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `endpointId` | path | `string` | yes | The endpoint. Example: `whk_01jc5d1a2b3c4d5e6f7g8h9j0k`. |

**Request body (application/json): UpdateEndpoint**
Changes to an endpoint; fields left out stay as they are.
- `name` (string, optional): A label, at most 100 characters. Example: `Orchestrator`
- `url` (string, optional): An https URL without credentials (http is accepted in local development). Example: `https://agent.example.com/hooks/doorman`
- `eventTypes` (("message.received" | "message.sent" | "thread.updated" | "inbox.created" | "inbox.deleted" | "delivery.failed" | "message.held" | "send.held" | "send.discarded" | "sign_in.requested" | "sign_in.completed")[], optional): Event types to receive; empty or absent means all.
- `inboxIds` (string[], optional): Ids of active inboxes of the account to receive for; empty or absent means all. Duplicates are dropped. Example: `["inb_01jc4q7w9k2m5n8p3r6t1v4x7z"]`
- `enabled` (boolean, optional): Whether deliveries start right away. Defaults to true.

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

**Response 200: Endpoint**
An account webhook endpoint: receives the account's events across inboxes, with its own signing secret.
- `id` (string): A webhook endpoint identifier. Example: `whk_01jc5d1a2b3c4d5e6f7g8h9j0k`
- `installationId` (string, optional): Present for an installation-owned endpoint. Revocation stops delivery. Example: `ins_01jc5f1a2b3c4d5e6f7g8h9j0k`
- `name` (string): A label, possibly empty. Example: `Orchestrator`
- `url` (string) Example: `https://agent.example.com/hooks/doorman`
- `eventTypes` (("message.received" | "message.sent" | "thread.updated" | "inbox.created" | "inbox.deleted" | "delivery.failed" | "message.held" | "send.held" | "send.discarded" | "sign_in.requested" | "sign_in.completed")[]): The event types it receives; empty means all.
- `inboxIds` (string[]): The inboxes it receives for; empty means all.
- `enabled` (boolean): A disabled endpoint receives nothing until it is enabled again.
- `createdAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `updatedAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `lastDelivery` (LastDelivery | null)

Example 200 response:
```json
{
  "id": "whk_01jc5d1a2b3c4d5e6f7g8h9j0k",
  "name": "Orchestrator",
  "url": "https://agent.example.com/hooks/doorman",
  "eventTypes": [],
  "inboxIds": [],
  "enabled": true,
  "createdAt": "2026-11-05T10:05:00.000Z",
  "updatedAt": "2026-11-05T10:05:00.000Z",
  "lastDelivery": {
    "status": "delivered",
    "statusCode": 200,
    "at": "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/webhooks/whk_01jc5d1a2b3c4d5e6f7g8h9j0k" \
  -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/webhooks/whk_01jc5d1a2b3c4d5e6f7g8h9j0k", {
  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/webhooks/whk_01jc5d1a2b3c4d5e6f7g8h9j0k",
    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 endpoint

`DELETE /v1/webhooks/{endpointId}`

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

Removes the endpoint. Its delivery log stays with the events, and a delivery still queued for it fails as `target_unavailable`.

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

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

Organizations: a member's console session needs `webhooks: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 |
| --- | --- | --- | --- | --- |
| `endpointId` | path | `string` | yes | The endpoint. Example: `whk_01jc5d1a2b3c4d5e6f7g8h9j0k`. |

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/webhooks/whk_01jc5d1a2b3c4d5e6f7g8h9j0k" \
  -H "authorization: Bearer $DOORMAN_API_KEY"
```

TypeScript:
```ts
const response = await fetch("https://api.doorman.fyi/v1/webhooks/whk_01jc5d1a2b3c4d5e6f7g8h9j0k", {
  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/webhooks/whk_01jc5d1a2b3c4d5e6f7g8h9j0k",
    headers={"authorization": f"Bearer {os.environ['DOORMAN_API_KEY']}"},
    allow_redirects=False, timeout=30,
)
response.raise_for_status()
# 204: nothing to read.
```

## Rotate an endpoint's secret

`POST /v1/webhooks/{endpointId}/rotate-secret`

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

Mints a new signing secret and returns it once. Deliveries signed with the old one stop verifying at once, so update the receiver first.

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

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

Organizations: a member's console session needs `webhooks: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 |
| --- | --- | --- | --- | --- |
| `endpointId` | path | `string` | yes | The endpoint. Example: `whk_01jc5d1a2b3c4d5e6f7g8h9j0k`. |

Answers `200`: The new secret.

**Response 200: EndpointSecret**
An endpoint's new signing secret, shown once.
- `id` (string): A webhook endpoint identifier. Example: `whk_01jc5d1a2b3c4d5e6f7g8h9j0k`
- `secret` (string): A Standard Webhooks secret (whsec_ and base64), shown once. Verify signatures with its decoded bytes. Example: `whsec_dGVzdC13ZWJob29rLXNpZ25pbmctc2VjcmV0LTAxMjM0NTY3ODk=`

Example 200 response:
```json
{
  "id": "whk_01jc5d1a2b3c4d5e6f7g8h9j0k",
  "secret": "whsec_dGVzdC13ZWJob29rLXNpZ25pbmctc2VjcmV0LTAxMjM0NTY3ODk="
}
```

**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 POST "https://api.doorman.fyi/v1/webhooks/whk_01jc5d1a2b3c4d5e6f7g8h9j0k/rotate-secret" \
  -H "authorization: Bearer $DOORMAN_API_KEY"
```

TypeScript:
```ts
const response = await fetch("https://api.doorman.fyi/v1/webhooks/whk_01jc5d1a2b3c4d5e6f7g8h9j0k/rotate-secret", {
  method: "POST",
  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.post(
    "https://api.doorman.fyi/v1/webhooks/whk_01jc5d1a2b3c4d5e6f7g8h9j0k/rotate-secret",
    headers={"authorization": f"Bearer {os.environ['DOORMAN_API_KEY']}"},
    allow_redirects=False, timeout=30,
)
response.raise_for_status()
result = response.json()
```

## Send a test delivery

`POST /v1/webhooks/{endpointId}/test`

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

One signed `message.received` sample with `"test": true`, fresh identifiers and one of the account's inboxes as the recipient, posted to the URL whether or not the endpoint is enabled. Nothing is stored. Answers after the usual 15 second timeout at most.

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

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

Organizations: a member's console session needs `webhooks: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 |
| --- | --- | --- | --- | --- |
| `endpointId` | path | `string` | yes | The endpoint. Example: `whk_01jc5d1a2b3c4d5e6f7g8h9j0k`. |

Answers `200`: What the URL answered.

**Response 200: EndpointTestResult**
What happened to one signed test delivery.
- `ok` (boolean): Whether the URL answered 2xx in time.
- `statusCode` (integer | null): The HTTP status, or null when the request did not complete.
- `error` (string | null): `HTTP <status>`, `timeout` or `network_error`; null on success.
- `durationMs` (integer)

Example 200 response:
```json
{
  "ok": true,
  "statusCode": 200,
  "error": null,
  "durationMs": 212
}
```

**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 POST "https://api.doorman.fyi/v1/webhooks/whk_01jc5d1a2b3c4d5e6f7g8h9j0k/test" \
  -H "authorization: Bearer $DOORMAN_API_KEY"
```

TypeScript:
```ts
const response = await fetch("https://api.doorman.fyi/v1/webhooks/whk_01jc5d1a2b3c4d5e6f7g8h9j0k/test", {
  method: "POST",
  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.post(
    "https://api.doorman.fyi/v1/webhooks/whk_01jc5d1a2b3c4d5e6f7g8h9j0k/test",
    headers={"authorization": f"Bearer {os.environ['DOORMAN_API_KEY']}"},
    allow_redirects=False, timeout=30,
)
response.raise_for_status()
result = response.json()
```

## List an endpoint's deliveries

`GET /v1/webhooks/{endpointId}/deliveries`

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

The endpoint's delivery log, newest first.

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

Also available as [`client.webhooks.deliveries`](https://doorman.fyi/docs/sdk/reference/webhooks.md#webhooks-deliveries) in TypeScript, [`client.webhooks.deliveries`](https://doorman.fyi/docs/python/reference/webhooks.md#webhooks-deliveries) in Python, the [`webhooks_deliveries`](https://doorman.fyi/docs/mcp/tools/webhooks.md#webhooks-deliveries) tool and [`doorman webhooks deliveries`](https://doorman.fyi/docs/cli/commands/webhooks.md#webhooks-deliveries) 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 |
| --- | --- | --- | --- | --- |
| `endpointId` | path | `string` | yes | The endpoint. Example: `whk_01jc5d1a2b3c4d5e6f7g8h9j0k`. |
| `limit` | query | `integer` | no | Page size, 1 to 100. Defaults to 50. |
| `cursor` | query | `string` | no | The delivery id to continue from, from the previous page's `nextCursor`. Example: `whd_01jc5f1a2b3c4d5e6f7g8h9j0k`. |

Answers `200`: A page of deliveries.

**Response 200: DeliveryPage**
A target's deliveries, newest first.
- `data` (Delivery[])
- `nextCursor` (string | null): Pass as `cursor` for the next page; null on the last 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 | `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/webhooks/whk_01jc5d1a2b3c4d5e6f7g8h9j0k/deliveries" \
  -H "authorization: Bearer $DOORMAN_API_KEY"
```

TypeScript:
```ts
const response = await fetch("https://api.doorman.fyi/v1/webhooks/whk_01jc5d1a2b3c4d5e6f7g8h9j0k/deliveries", {
  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/webhooks/whk_01jc5d1a2b3c4d5e6f7g8h9j0k/deliveries",
    headers={"authorization": f"Bearer {os.environ['DOORMAN_API_KEY']}"},
    allow_redirects=False, timeout=30,
)
response.raise_for_status()
result = response.json()
```

## Retry a delivery

`POST /v1/deliveries/{deliveryId}/retry`

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

Puts a delivered or failed delivery back in the queue. The attempt is numbered after the previous ones: a delivery that used its whole budget gets exactly one more attempt, and one that still had attempts left follows the usual retry schedule from where it was. A retry to a target that was removed or repointed since fails as `target_unavailable`.

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

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

Organizations: a member's console session needs `webhooks: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 |
| --- | --- | --- | --- | --- |
| `deliveryId` | path | `string` | yes | The delivery. Example: `whd_01jc5f1a2b3c4d5e6f7g8h9j0k`. |

Answers `202`: The delivery, now pending.

**Response 202: Delivery**
One event sent to one target, with every attempt's outcome.
- `id` (string): A webhook delivery identifier. Example: `whd_01jc5f1a2b3c4d5e6f7g8h9j0k`
- `eventId` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `target` (object)
  - `kind` ("inbox" | "endpoint"): `inbox` for the inbox webhook, `endpoint` for an account endpoint.
  - `id` (string): The inbox id or the endpoint id.
- `url` (string): The URL at the time of delivery.
- `status` ("pending" | "delivered" | "failed")
- `attempts` (integer)
- `lastStatusCode` (integer | null)
- `lastError` (string | null): `HTTP <status>`, `timeout`, `network_error` or `target_unavailable`.
- `createdAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `updatedAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`

Example 202 response:
```json
{
  "id": "whd_01jc5f1a2b3c4d5e6f7g8h9j0k",
  "eventId": "evt_01jc5e5f6g7h8j9k0m1n2p3q4r",
  "target": {
    "kind": "endpoint",
    "id": "whk_01jc5d1a2b3c4d5e6f7g8h9j0k"
  },
  "url": "https://agent.example.com/hooks/doorman",
  "status": "delivered",
  "attempts": 1,
  "lastStatusCode": 200,
  "lastError": null,
  "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 | `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 | `delivery_pending` | The delivery is already queued; wait for the attempt to finish. |
| 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/deliveries/whd_01jc5f1a2b3c4d5e6f7g8h9j0k/retry" \
  -H "authorization: Bearer $DOORMAN_API_KEY"
```

TypeScript:
```ts
const response = await fetch("https://api.doorman.fyi/v1/deliveries/whd_01jc5f1a2b3c4d5e6f7g8h9j0k/retry", {
  method: "POST",
  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.post(
    "https://api.doorman.fyi/v1/deliveries/whd_01jc5f1a2b3c4d5e6f7g8h9j0k/retry",
    headers={"authorization": f"Bearer {os.environ['DOORMAN_API_KEY']}"},
    allow_redirects=False, timeout=30,
)
response.raise_for_status()
result = response.json()
```
