---
title: "Authentication and keys"
description: "The bearer credential every call carries, account and inbox scope, minting and revoking keys, and GET /v1/me."
url: https://doorman.fyi/docs/authentication
markdown: https://doorman.fyi/docs/authentication.md
area: "Guides"
section: "Access"
---

# Authentication and keys

The bearer credential every call carries, account and inbox scope, minting and revoking keys, and GET /v1/me.

Source: https://doorman.fyi/docs/authentication

## The credential

The authenticated routes under `/v1` need an `Authorization: Bearer <credential>` header. Three kinds of credential exist.

- An API key, a token that starts with `dm_` followed by 52 lowercase characters. Code you write and agents you build use keys. Only a SHA-256 hash of the token is stored, so a key cannot be read back; a list shows its first ten characters (`tokenPrefix`) and its last four (`last4`).
- A console session token, which the console sends on the person's behalf after they sign in. It is short-lived, it is not accepted on the stream, and an agent never holds one. It acts for one account at a time: the person's own, or the account of the organization they are working in, where it is held to [the permissions of their role](https://doorman.fyi/docs/organizations.md#roles).
- An OAuth app access token, issued only after [explicit consent](https://doorman.fyi/docs/oauth.md). Its scopes limit operations in the consenting account, and its resource binds it to REST or MCP. An app token cannot mint keys or perform session-only actions. It is what an agent holds that a person connected through the browser, where no key is involved at all: [Connect your agent](https://doorman.fyi/docs/connect.md).

A missing, malformed or revoked credential answers `401 unauthorized`: The credential was missing, malformed, revoked or belongs to an inactive account.

Every request:
```http
GET /v1/inboxes HTTP/1.1
Host: api.doorman.fyi
Authorization: Bearer dm_...
```

## Account scope and inbox scope

A key reaches either the whole account or exactly one inbox. Give an orchestrator an account key; give each worker a key locked to the inbox it works in, so that a leaked or misbehaving worker stays inside its own door.

| What the key may do | Account key | Inbox key |
| --- | --- | --- |
| Read threads, messages and attachments | every inbox | its inbox only |
| Send and reply | from every inbox | from its inbox only |
| Open the stream and poll events | the whole account | its inbox only |
| Issue, rename and delete inboxes | yes | 403 `forbidden` |
| Mint and revoke inbox keys | yes | 403 `forbidden` |
| Set the inbox webhook and manage endpoints | yes | 403 `forbidden` |
| Read the overview | yes | 403 `forbidden` |
| Read metrics | the whole account, or one inbox | its inbox only |
| Create or revoke account keys | 403 `session_required` | 403 `session_required` |

An inbox key asked for something outside its inbox gets `403 forbidden`, or `404 not_found` when the resource belongs to another inbox: No such resource for this caller, or no such route.

OAuth permission scopes are separate from an API key's account/inbox boundary. App grants apply across the consenting account, subject to each operation's required scopes; they are not inbox-specific keys. Missing permissions answer `403 insufficient_scope`. See [App permissions](https://doorman.fyi/docs/oauth.md#scopes).

The account may be an organization's, shared by its members. A key is not a member: it reaches what the table says whatever the role of the person who minted it, and so does an app token within its permissions. Only a console session is held to a member's role. See [API keys and app tokens are not members](https://doorman.fyi/docs/organizations.md#keys).

## Where keys come from

Account keys are minted in the console only, on [the keys page](https://doorman.fyi/console/keys). The matching route, [`POST /v1/api-keys`](https://doorman.fyi/docs/reference/api-keys.md#apiKeys-create), accepts a console session and refuses API keys with `403 session_required`, so a leaked key can never mint another.

Inbox keys are minted with an account credential at [`POST /v1/inboxes/{inboxId}/api-keys`](https://doorman.fyi/docs/reference/api-keys.md#inboxes-keys-create), or in the same call that [issues the inbox](https://doorman.fyi/docs/inboxes.md#one-call). The answer carries the token once:

201 Created:
```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"
}
```

At most 20 keys may be active per account and 20 per inbox; one more answers `409 limit_reached`. Rotate by minting the new key first, moving the agent over, then revoking the old one.

A key says who minted it: `createdBy` carries the user id and the name of the signed-in person, and is null for a key that was minted with another key. In an organization, minting or revoking a key from the console takes the member's `keys:manage`, which only an admin has; every member can see the keys. A key belongs to the account, so it keeps working when the person who minted it leaves the organization.

> Note: The console's [`GET /v1/api-keys?scope=all`](https://doorman.fyi/docs/reference/api-keys.md#apiKeys-list) lists account and inbox keys together, each with the address of its inbox.

## Revoking a key

[`DELETE /v1/api-keys/{keyId}`](https://doorman.fyi/docs/reference/api-keys.md#apiKeys-revoke) (from the console) and [`DELETE /v1/inboxes/{inboxId}/api-keys/{keyId}`](https://doorman.fyi/docs/reference/api-keys.md#inboxes-keys-revoke) revoke a key. It stops authenticating on its next request, and any stream connection it opened is closed with code `4001`.

Deleting an inbox revokes every key scoped to it. Suspending or deleting an account stops every key and session in it.

> Warning: Revoking is immediate and cannot be undone. There is no grace period for a revoked key, so move the agent to its new key before revoking the old one.

## Who am I

[`GET /v1/me`](https://doorman.fyi/docs/reference/account.md#me) tells the caller what it is holding: the account and plan, usage, the key or session, or the OAuth installation and scopes. App tokens need `account:read`. An inbox key also sees the inbox it reaches. It is the right first call for an agent handed a key.

200 OK:
```json
{
  "account": {
    "id": "acc_01jc4q3x6k9m2n8p4r7t5v1w3y",
    "email": "dana@example.com",
    "name": "Dana Ortiz",
    "plan": "free"
  },
  "plan": {
    "name": "free",
    "label": "Free",
    "priceUsd": 0,
    "inboxLimit": 3,
    "monthlySendLimit": 3000
  },
  "usage": {
    "inboxes": 1,
    "sendsThisMonth": 37,
    "monthResetsAt": "2026-12-01T00:00:00.000Z"
  },
  "key": {
    "id": "key_01jc5c0z9y8x7w6v5t4t3s2r1q",
    "scope": "account",
    "inboxId": null
  },
  "session": null,
  "inbox": null,
  "inboxDomain": "doorman.example"
}
```

It also says whose account that is. `account.kind` is `personal` or `organization`, and `organization` names the organization an account belongs to, or is null for a personal one. A console session adds the member's `role` and the `permissions` it holds. A deployment that predates organizations leaves these out. [What the API reports](https://doorman.fyi/docs/organizations.md#me) shows a member's answer.
