---
title: "API keys"
description: "Credentials for agents: account-wide keys from the console, inbox-scoped keys from the API."
url: https://doorman.fyi/docs/reference/api-keys
markdown: https://doorman.fyi/docs/reference/api-keys.md
area: "API reference"
section: "API reference"
---

# API keys

Credentials for agents: account-wide keys from the console, inbox-scoped keys from the API.

Source: https://doorman.fyi/docs/reference/api-keys

## List account keys

`GET /v1/api-keys`

Access `session`: a console session only; an API key gets 403 `session_required`.

The account's active account-wide keys, oldest first. `scope=all` adds the inbox-scoped keys; every item then carries `inboxAddress`.

OAuth: not available to delegated app tokens.

Also available as [`client.apiKeys.list`](https://doorman.fyi/docs/sdk/reference/api-keys.md#apiKeys-list) in TypeScript and [`client.api_keys.list`](https://doorman.fyi/docs/python/reference/api-keys.md#apiKeys-list) in Python.

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 |
| --- | --- | --- | --- | --- |
| `scope` | query | `"all"` | no | Include inbox-scoped keys. |

Answers `200`: The keys.

**Response 200: ApiKeyList**
Active keys, oldest first.
- `data` (ApiKeyListItem[])

**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 | `session_required` | Account keys, developer apps, relying parties, installations, consent, approving a sign-in and the assistant require a console session. So does loosening the security policy, trusting a sender, releasing held mail, allowing a sign-in, letting agents sign in to new services alone or telling a service who owns an agent, unless the account allows its account keys to. |
| 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/api-keys" \
  -H "authorization: Bearer $DOORMAN_API_KEY"
```

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

## Create an account key

`POST /v1/api-keys`

Access `session`: a console session only; an API key gets 403 `session_required`.

An account-wide key: it reaches every inbox, creates and deletes inboxes, and manages keys and webhooks. Minted from the console only, so a leaked key cannot mint another. The token is returned once; 20 may be active per account.

OAuth: not available to delegated app tokens.

Also available as [`client.apiKeys.create`](https://doorman.fyi/docs/sdk/reference/api-keys.md#apiKeys-create) in TypeScript and [`client.api_keys.create`](https://doorman.fyi/docs/python/reference/api-keys.md#apiKeys-create) in Python.

Organizations: a member's console session needs `keys:manage`. See [Roles and permissions](https://doorman.fyi/docs/organizations.md#roles).

**Request body (application/json): CreateApiKey**
A new key. The name is a label for people.
- `name` (string, optional): A label, at most 100 characters. Example: `Orchestrator`

Answers `201`: The key with its one-time token.

**Response 201: CreatedApiKey**
A freshly minted key with its token, which is shown once and stored only as a hash.
- `id` (string): An API key identifier. Example: `key_01jc5c0z9y8x7w6v5t4t3s2r1q`
- `inboxId` (string | null): The inbox an inbox-scoped key reaches; null for an account key.
- `name` (string): A label, possibly empty. Example: `Orchestrator`
- `tokenPrefix` (string): The first ten characters of the token, starting with dm_. Example: `dm_9f3abcd`
- `last4` (string): The last four characters of the token. Example: `m2x8`
- `createdAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `lastUsedAt` (string (date-time) | null): When the key last authenticated a request, to the minute; null until then.
- `createdBy` (object | null, optional): The signed-in person who minted the key, so a team can tell whose it is. Null for a key minted with another key, or before this was recorded. Older deployments omit it.
  - `userId` (string): The identity provider's user id. Example: `user_2abcDEF3ghiJKL`
  - `name` (string): The person's name when the key was minted, or their address when they had no name. Example: `Dana Ortiz`
- `token` (string): The bearer token. Store it now; it cannot be read again. Example: `dm_9f3abcdefghjkmnpqrstvwxyz0123456789abcdefghjkmnpm2x8`

Example 201 response:
```json
{
  "id": "key_01jc5c0z9y8x7w6v5t4t3s2r1q",
  "inboxId": null,
  "name": "Orchestrator",
  "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. |
| 403 | `session_required` | Account keys, developer apps, relying parties, installations, consent, approving a sign-in and the assistant require a console session. So does loosening the security policy, trusting a sender, releasing held mail, allowing a sign-in, letting agents sign in to new services alone or telling a service who owns an agent, unless the account allows its account keys to. |
| 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/api-keys" \
  -H "authorization: Bearer $DOORMAN_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "name": "Orchestrator"
  }'
```

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

## Read an account key

`GET /v1/api-keys/{keyId}`

Access `session`: a console session only; an API key gets 403 `session_required`.

One active account-wide key, without its token.

OAuth: not available to delegated app tokens.

Also available as [`client.apiKeys.get`](https://doorman.fyi/docs/sdk/reference/api-keys.md#apiKeys-get) in TypeScript and [`client.api_keys.get`](https://doorman.fyi/docs/python/reference/api-keys.md#apiKeys-get) in Python.

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 |
| --- | --- | --- | --- | --- |
| `keyId` | path | `string` | yes | The key. Example: `key_01jc5c0z9y8x7w6v5t4t3s2r1q`. |

Answers `200`: The key.

**Response 200: ApiKey**
An API key as the API lists it. The token itself appears once, when the key is created.
- `id` (string): An API key identifier. Example: `key_01jc5c0z9y8x7w6v5t4t3s2r1q`
- `inboxId` (string | null): The inbox an inbox-scoped key reaches; null for an account key.
- `name` (string): A label, possibly empty. Example: `Orchestrator`
- `tokenPrefix` (string): The first ten characters of the token, starting with dm_. Example: `dm_9f3abcd`
- `last4` (string): The last four characters of the token. Example: `m2x8`
- `createdAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `lastUsedAt` (string (date-time) | null): When the key last authenticated a request, to the minute; null until then.
- `createdBy` (object | null, optional): The signed-in person who minted the key, so a team can tell whose it is. Null for a key minted with another key, or before this was recorded. Older deployments omit it.
  - `userId` (string): The identity provider's user id. Example: `user_2abcDEF3ghiJKL`
  - `name` (string): The person's name when the key was minted, or their address when they had no name. Example: `Dana Ortiz`

Example 200 response:
```json
{
  "id": "key_01jc5c0z9y8x7w6v5t4t3s2r1q",
  "inboxId": null,
  "name": "Orchestrator",
  "tokenPrefix": "dm_9f3abcd",
  "last4": "m2x8",
  "createdAt": "2026-11-05T10:05:00.000Z",
  "lastUsedAt": null
}
```

**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 | `session_required` | Account keys, developer apps, relying parties, installations, consent, approving a sign-in and the assistant require a console session. So does loosening the security policy, trusting a sender, releasing held mail, allowing a sign-in, letting agents sign in to new services alone or telling a service who owns an agent, unless the account allows its account keys to. |
| 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/api-keys/key_01jc5c0z9y8x7w6v5t4t3s2r1q" \
  -H "authorization: Bearer $DOORMAN_API_KEY"
```

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

## Revoke an account key

`DELETE /v1/api-keys/{keyId}`

Access `session`: a console session only; an API key gets 403 `session_required`.

The key stops authenticating on its next request and the stream connections it opened are closed with 4001.

OAuth: not available to delegated app tokens.

Also available as [`client.apiKeys.revoke`](https://doorman.fyi/docs/sdk/reference/api-keys.md#apiKeys-revoke) in TypeScript and [`client.api_keys.revoke`](https://doorman.fyi/docs/python/reference/api-keys.md#apiKeys-revoke) in Python.

Organizations: a member's console session needs `keys:manage`. See [Roles and permissions](https://doorman.fyi/docs/organizations.md#roles).

**Parameters**

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `keyId` | path | `string` | yes | The key. Example: `key_01jc5c0z9y8x7w6v5t4t3s2r1q`. |

Answers `204`: Revoked.

**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 | `session_required` | Account keys, developer apps, relying parties, installations, consent, approving a sign-in and the assistant require a console session. So does loosening the security policy, trusting a sender, releasing held mail, allowing a sign-in, letting agents sign in to new services alone or telling a service who owns an agent, unless the account allows its account keys to. |
| 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/api-keys/key_01jc5c0z9y8x7w6v5t4t3s2r1q" \
  -H "authorization: Bearer $DOORMAN_API_KEY"
```

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

## Create an inbox key

`POST /v1/inboxes/{inboxId}/api-keys`

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

A key that reads and operates exactly one inbox, including its stream and sending, and gets 403 on inbox, key and webhook management. The token is returned once; 20 may be active per inbox.

OAuth: not available to delegated app tokens.

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

Organizations: a member's console session needs `keys: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): CreateApiKey**
A new key. The name is a label for people.
- `name` (string, optional): A label, at most 100 characters. Example: `Orchestrator`

Answers `201`: The key with its one-time token.

**Response 201: CreatedApiKey**
A freshly minted key with its token, which is shown once and stored only as a hash.
- `id` (string): An API key identifier. Example: `key_01jc5c0z9y8x7w6v5t4t3s2r1q`
- `inboxId` (string | null): The inbox an inbox-scoped key reaches; null for an account key.
- `name` (string): A label, possibly empty. Example: `Orchestrator`
- `tokenPrefix` (string): The first ten characters of the token, starting with dm_. Example: `dm_9f3abcd`
- `last4` (string): The last four characters of the token. Example: `m2x8`
- `createdAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `lastUsedAt` (string (date-time) | null): When the key last authenticated a request, to the minute; null until then.
- `createdBy` (object | null, optional): The signed-in person who minted the key, so a team can tell whose it is. Null for a key minted with another key, or before this was recorded. Older deployments omit it.
  - `userId` (string): The identity provider's user id. Example: `user_2abcDEF3ghiJKL`
  - `name` (string): The person's name when the key was minted, or their address when they had no name. Example: `Dana Ortiz`
- `token` (string): The bearer token. Store it now; it cannot be read again. Example: `dm_9f3abcdefghjkmnpqrstvwxyz0123456789abcdefghjkmnpm2x8`

Example 201 response:
```json
{
  "id": "key_01jc5c0z9y8x7w6v5t4t3s2r1q",
  "inboxId": null,
  "name": "Orchestrator",
  "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. |
| 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/api-keys" \
  -H "authorization: Bearer $DOORMAN_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "name": "Orchestrator"
  }'
```

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

## List an inbox's keys

`GET /v1/inboxes/{inboxId}/api-keys`

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

The inbox's active keys, oldest first.

OAuth: not available to delegated app tokens.

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

**Response 200: ApiKeyList**
Active keys, oldest first.
- `data` (ApiKeyListItem[])

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

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

## Read an inbox key

`GET /v1/inboxes/{inboxId}/api-keys/{keyId}`

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

One active key of the inbox, without its token.

OAuth: not available to delegated app tokens.

Also available as [`client.inboxes.keys.get`](https://doorman.fyi/docs/sdk/reference/api-keys.md#inboxes-keys-get) in TypeScript, [`client.inboxes.keys.get`](https://doorman.fyi/docs/python/reference/api-keys.md#inboxes-keys-get) in Python, the [`inboxes_keys_get`](https://doorman.fyi/docs/mcp/tools/api-keys.md#inboxes-keys-get) tool and [`doorman inboxes keys get`](https://doorman.fyi/docs/cli/commands/api-keys.md#inboxes-keys-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`. |
| `keyId` | path | `string` | yes | The key. Example: `key_01jc5c0z9y8x7w6v5t4t3s2r1q`. |

Answers `200`: The key.

**Response 200: ApiKey**
An API key as the API lists it. The token itself appears once, when the key is created.
- `id` (string): An API key identifier. Example: `key_01jc5c0z9y8x7w6v5t4t3s2r1q`
- `inboxId` (string | null): The inbox an inbox-scoped key reaches; null for an account key.
- `name` (string): A label, possibly empty. Example: `Orchestrator`
- `tokenPrefix` (string): The first ten characters of the token, starting with dm_. Example: `dm_9f3abcd`
- `last4` (string): The last four characters of the token. Example: `m2x8`
- `createdAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `lastUsedAt` (string (date-time) | null): When the key last authenticated a request, to the minute; null until then.
- `createdBy` (object | null, optional): The signed-in person who minted the key, so a team can tell whose it is. Null for a key minted with another key, or before this was recorded. Older deployments omit it.
  - `userId` (string): The identity provider's user id. Example: `user_2abcDEF3ghiJKL`
  - `name` (string): The person's name when the key was minted, or their address when they had no name. Example: `Dana Ortiz`

Example 200 response:
```json
{
  "id": "key_01jc5c0z9y8x7w6v5t4t3s2r1q",
  "inboxId": null,
  "name": "Orchestrator",
  "tokenPrefix": "dm_9f3abcd",
  "last4": "m2x8",
  "createdAt": "2026-11-05T10:05:00.000Z",
  "lastUsedAt": null
}
```

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

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

## Revoke an inbox key

`DELETE /v1/inboxes/{inboxId}/api-keys/{keyId}`

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

The key stops authenticating on its next request and the stream connections it opened are closed with 4001.

OAuth: not available to delegated app tokens.

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

Organizations: a member's console session needs `keys: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`. |
| `keyId` | path | `string` | yes | The key. Example: `key_01jc5c0z9y8x7w6v5t4t3s2r1q`. |

Answers `204`: Revoked.

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

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