Organizations
An account a team shares: the two roles and their permissions, which operations need which, what API keys and app tokens are not held to, connecting agents, moving a personal account in, the x-doorman-account header, and the errors.
On this page
- An account a team shares
- What the API reports
- Roles and permissions
- Which operations need which permission
- API keys and app tokens are not members
- Connecting agents in an organization
- Moving a personal account in
- Saying which account a request is for
- When a request is refused
- Limits, and what happens when someone leaves
An account a team shares
An account is one person's or an organization's. A personal account belongs to the person who signed up. An organization's account is shared: every member of the organization works in the same account, with the same inboxes, keys, domains, webhooks, events, apps and plan.
Nothing else about the API changes. Every inbox, thread, key and event still belongs to an account, and an organization's account is an account like any other: the same routes, the same identifiers, the same limits. What an organization adds is people, and a say over what each of them may do.
- Creating one
- A signed-in person creates an organization in the console and is its first admin. The organization's account comes into being the first time one of its members opens the console in it: empty, on the Free plan, with that member's verified address as its contact address (
account.email). - Members
- An admin invites people by email address and gives each of them a role. Members, invitations and roles are kept by the identity provider the console signs people in with. The API stores none of them: it reads the organization, the member's role and what the role carries from the session the console presents.
- Several accounts
- A person keeps their personal account and may belong to several organizations. The console works in one account at a time, and every page and every action is for that account.
- The name
account.nameis the organization's name. A change of the name in the console reaches the API shortly after.- The plan
- An organization's account starts on the Free plan, whatever plans its members' own accounts are on, and has its own allowances like any account. Plans are set by the operator for now. A personal account can also be moved in with its plan, once, before anything is created in the organization.
What the API reports
GET /v1/me says whose account a credential acts for. account.kind is personal or organization. For an organization's account, organization carries the organization's id, name and slug, whoever is calling. A console session also reports the member's role, the permissions it holds and personalAccountId.
{
"account": {
"id": "acc_01jc4q3x6k9m2n8p4r7t5v1w3y",
"email": "dana@example.com",
"name": "Acme",
"plan": "free",
"kind": "organization"
},
"plan": {
"name": "free",
"label": "Free",
"priceUsd": 0,
"inboxLimit": 3,
"monthlySendLimit": 3000
},
"usage": {
"inboxes": 1,
"sendsThisMonth": 37,
"monthResetsAt": "2026-12-01T00:00:00.000Z"
},
"key": null,
"session": {
"userId": "user_2abcDEF3ghiJKL",
"role": "org:member",
"permissions": [
"mail:read",
"mail:write",
"mail:send"
],
"personalAccountId": null
},
"inbox": null,
"inboxDomain": "doorman.example",
"organization": {
"id": "org_2abcDEF3ghiJKL",
"name": "Acme",
"slug": "acme"
}
}account.kindpersonalfor one person's account,organizationfor the account a team shares.organization- The identity provider's id for the organization, its name and its slug; null for a personal account. An API key and an app token see it too. The name is empty until the identity provider has reported it.
session.role- The member's role as the identity provider names it:
org:adminororg:member. Null in a personal account. session.permissions- What this session may do: every permission in a personal account and for an admin, otherwise what the member's role carries. The console reads it to show only what will work. The API checks every call whatever the console shows.
session.personalAccountId- In an organization, the account that moving in would move, for as long as it can be moved: the person's own personal account, when their role holds
account:manage, the organization's account has never been used and no account was moved into the organization before. Null otherwise, as for the member above.
A deployment that predates organizations leaves these fields out. Read a missing kind as personal.
Roles and permissions
An organization has two roles. An admin (org:admin) holds every permission. A member (org:member) holds mail:read, mail:write and mail:send: the organization's mail, and nothing that changes the account.
| Permission | What it allows | Admin | Member |
|---|---|---|---|
mail:read | Read threads, messages, attachments and the events that carry mail, who an inbox has corresponded with and its held stubs, and the passport that mail fills: the services an address is signed up for and the codes they send. | yes | yes |
mail:write | Change a thread's read state, metadata and labels, trash threads, and record a service an address is signed up for. It works together with reading mail: a changed thread is shown to whoever changed it. | yes | yes |
mail:send | Send mail and replies from the account's inboxes. It works together with reading mail: a reply quotes the thread it answers. | yes | yes |
inboxes:manage | Create, change and delete inboxes and their inbound rules, and change or remove the services in an address's passport. | yes | no |
security:manage | Change security policies and sender rules, review, release or discard held mail, and mark messages safe or unsafe. | yes | no |
keys:manage | Mint and revoke API keys. A key is not held to these permissions, so this one reaches everything a key can do. | yes | no |
webhooks:manage | Manage webhook endpoints, the inbox webhooks and their signing secrets, and retry deliveries. | yes | no |
domains:manage | Add, verify and remove custom domains. | yes | no |
apps:manage | Register and manage the account's developer apps and their client secrets. | yes | no |
agents:connect | Allow or refuse an agent or app that asks for access to the account, and disconnect one. | yes | no |
members:manage | Invite people to the organization, take an invitation back, and change a member's role. | yes | no |
billing:manage | Start a checkout for the paid plan, open the billing portal and read billing again from the payment provider. | yes | no |
account:manage | Change the account itself, such as moving a personal account into the organization. | yes | no |
compliance:manage | Sign or end the business associate agreement, and change the healthcare guardrails and the custom guardrails. | yes | no |
phi:read | Read mail in the console as it arrived, where healthcare guardrails redact it for everyone else. Each such read of a message that carries findings is recorded. | yes | no |
The permissions apply to a console session acting in an organization, and to nothing else. In a personal account the person holds all of them. The API decides from what the session carries, on every call.
An admin holds every permission whatever the session carries. It is the one thing the API decides by the role's name, so that a mistake in how the roles are set up cannot lock an organization out of its own account.
Where a permission means what an app permission means, it has the same name: mail:read, mail:write and mail:send.
Which operations need which permission
Each operation states what a member needs, and the reference repeats it operation by operation. An operation that names several permissions needs all of them, and a refusal names the first one that is missing. Reading needs none, with two exceptions: the operations that return mail, or the passport that mail fills, need mail:read, and opening an agent's approval request needs agents:connect, because opening it claims it.
mail:readPOST /v1/inboxes/{inboxId}/rules(withinboxes:manage,mail:writeandmail:send),PATCH /v1/inboxes/{inboxId}/rules/{ruleId}(withinboxes:manage,mail:writeandmail:send),PUT /v1/inboxes/{inboxId}/webhook(withwebhooks:manage),POST /v1/inboxes/{inboxId}/send(withmail:send),GET /v1/inboxes/{inboxId}/threads,GET /v1/inboxes/{inboxId}/threads/by-seen,GET /v1/threads/{threadId},PATCH /v1/threads/{threadId}(withmail:write),DELETE /v1/threads/{threadId}(withmail:write),POST /v1/threads/{threadId}/restore(withmail:write),PUT /v1/threads/{threadId}/seen,GET /v1/threads/{threadId}/messages,GET /v1/inboxes/{inboxId}/messages,GET /v1/messages/{messageId},GET /v1/messages/{messageId}/raw,GET /v1/messages/{messageId}/html,GET /v1/attachments/{messageId}/{filename},GET /v1/attachments/{messageId}/{filename}/text,GET /v1/events,GET /v1/events/{eventId},POST /v1/webhooks(withwebhooks:manage),PATCH /v1/webhooks/{endpointId}(withwebhooks:manage),GET /v1/services,GET /v1/services/{serviceId},POST /v1/inboxes/{inboxId}/services(withmail:write),PATCH /v1/services/{serviceId}(withinboxes:manage),GET /v1/inboxes/{inboxId}/verifications,POST /v1/inboxes/{inboxId}/sign-ins(withmail:write),GET /v1/inboxes/{inboxId}/senders,GET /v1/inboxes/{inboxId}/held,POST /v1/messages/{messageId}/release(withsecurity:manage),POST /v1/messages/{messageId}/feedback(withsecurity:manage),POST /v1/security/preview,GET /v1/inboxes/{inboxId}/held-sends,GET /v1/held-sends/{heldSendId},POST /v1/held-sends/{heldSendId}/approve(withsecurity:manageandmail:send),POST /v1/push/subscriptions,DELETE /v1/push/subscriptions/{subscriptionId},GET /v1/messages/{messageId}/original(withphi:read)mail:writePOST /v1/inboxes/{inboxId}/rules(withinboxes:manage,mail:readandmail:send),PATCH /v1/inboxes/{inboxId}/rules/{ruleId}(withinboxes:manage,mail:readandmail:send),PATCH /v1/threads/{threadId}(withmail:read),DELETE /v1/threads/{threadId}(withmail:read),POST /v1/threads/{threadId}/restore(withmail:read),POST /v1/inboxes/{inboxId}/services(withmail:read),POST /v1/inboxes/{inboxId}/sign-ins(withmail:read)mail:sendPOST /v1/inboxes/{inboxId}/rules(withinboxes:manage,mail:readandmail:write),PATCH /v1/inboxes/{inboxId}/rules/{ruleId}(withinboxes:manage,mail:readandmail:write),POST /v1/inboxes/{inboxId}/send(withmail:read),POST /v1/held-sends/{heldSendId}/approve(withsecurity:manageandmail:read)inboxes:managePOST /v1/inboxes,PATCH /v1/inboxes/{inboxId},DELETE /v1/inboxes/{inboxId},POST /v1/inboxes/{inboxId}/rules(withmail:read,mail:writeandmail:send),PATCH /v1/inboxes/{inboxId}/rules/{ruleId}(withmail:read,mail:writeandmail:send),DELETE /v1/inboxes/{inboxId}/rules/{ruleId},PATCH /v1/services/{serviceId}(withmail:read),DELETE /v1/services/{serviceId},GET /v1/sign-in/requests/{requestId},POST /v1/sign-in/requests/{requestId}security:managePATCH /v1/passport,PATCH /v1/security,PATCH /v1/inboxes/{inboxId}/security,DELETE /v1/inboxes/{inboxId}/security,POST /v1/sender-rules,DELETE /v1/sender-rules/{senderRuleId},POST /v1/messages/{messageId}/release(withmail:read),POST /v1/messages/{messageId}/discard,POST /v1/messages/{messageId}/feedback(withmail:read),POST /v1/held-sends/{heldSendId}/approve(withmail:sendandmail:read),POST /v1/held-sends/{heldSendId}/discardkeys:managePOST /v1/api-keys,DELETE /v1/api-keys/{keyId},POST /v1/inboxes/{inboxId}/api-keys,DELETE /v1/inboxes/{inboxId}/api-keys/{keyId}webhooks:managePUT /v1/inboxes/{inboxId}/webhook(withmail:read),POST /v1/inboxes/{inboxId}/webhook/rotate-secret,DELETE /v1/inboxes/{inboxId}/webhook,POST /v1/webhooks(withmail:read),PATCH /v1/webhooks/{endpointId}(withmail:read),DELETE /v1/webhooks/{endpointId},POST /v1/webhooks/{endpointId}/rotate-secret,POST /v1/webhooks/{endpointId}/test,POST /v1/deliveries/{deliveryId}/retrydomains:managePOST /v1/domains,POST /v1/domains/{domainId}/verify,POST /v1/domains/{domainId}/connect-session,DELETE /v1/domains/{domainId}apps:managePOST /v1/apps,PATCH /v1/apps/{appId},DELETE /v1/apps/{appId},POST /v1/apps/{appId}/rotate-secret,POST /v1/sign-in/clients,PATCH /v1/sign-in/clients/{clientId},DELETE /v1/sign-in/clients/{clientId},POST /v1/sign-in/clients/{clientId}/rotate-secret,POST /v1/sign-in/clients/{clientId}/verifyagents:connectDELETE /v1/app-installs/{installationId},GET /v1/oauth/requests/{requestId},POST /v1/oauth/requests/{requestId}members:managePATCH /v1/members/{userId},GET /v1/invitations,POST /v1/invitations,PATCH /v1/invitations/{invitationId},DELETE /v1/invitations/{invitationId}billing:managePOST /v1/billing/checkout,POST /v1/billing/seats,POST /v1/billing/portal,POST /v1/billing/syncaccount:managePOST /v1/organization/adoptcompliance:managePOST /v1/baa/sign,POST /v1/baa/terminate,PATCH /v1/guardrails,PATCH /v1/inboxes/{inboxId}/guardrails,DELETE /v1/inboxes/{inboxId}/guardrails,POST /v1/guardrails/rules,PATCH /v1/guardrails/rules/{guardrailId},DELETE /v1/guardrails/rules/{guardrailId},POST /v1/guardrails/previewphi:readGET /v1/messages/{messageId}/original(withmail:read)
The other 37 operations a console session can call are open to every member: GET /v1/me, GET /v1/overview, GET /v1/metrics, GET /v1/api-keys, GET /v1/api-keys/{keyId}, GET /v1/inboxes/{inboxId}/api-keys, GET /v1/inboxes/{inboxId}/api-keys/{keyId}, GET /v1/inboxes, GET /v1/inboxes/{inboxId}, GET /v1/inboxes/{inboxId}/rules, GET /v1/inboxes/{inboxId}/rules/{ruleId}, GET /v1/inboxes/{inboxId}/rules/{ruleId}/runs, GET /v1/inboxes/{inboxId}/webhook, GET /v1/inboxes/{inboxId}/webhook/deliveries, GET /v1/webhooks, GET /v1/webhooks/{endpointId}, GET /v1/webhooks/{endpointId}/deliveries, POST /v1/assistant/chat, GET /v1/domains, GET /v1/domains/{domainId}, GET /v1/passport, GET /v1/security, GET /v1/inboxes/{inboxId}/security, GET /v1/sender-rules, GET /v1/security/audit, GET /v1/apps, GET /v1/apps/{appId}, GET /v1/app-installs, GET /v1/sign-in/clients, GET /v1/sign-in/clients/{clientId}, GET /v1/push, GET /v1/members, GET /v1/baa, GET /v1/baa/document, GET /v1/guardrails, GET /v1/inboxes/{inboxId}/guardrails, GET /v1/guardrails/rules.
POST /v1/inboxes can do more than issue an address in one call, and then needs more:
- with
keyin the body, alsokeys:manage. - with
webhookUrlin the body, alsowebhooks:manageandmail:read.
Nothing lets mail out without mail:read. Sending or changing mail takes it beside mail:send or mail:write: a reply quotes the thread it answers, and a changed thread is answered back to whoever changed it. Pointing a webhook at a URL takes it beside webhooks:manage, because a webhook receives mail. Writing a rule takes all three mail permissions beside inboxes:manage, because a rule can forward, answer, label and trash mail by itself. So no role, however it is set up, has a way to see mail without the permission to read it.
The passport follows the same line. It says where an address has accounts and holds the codes those services send, so reading it takes mail:read, its codes included, and adding a service takes mail:write beside it. Changing a service or removing one takes inboxes:manage: a service that is removed no longer keeps a deleted address for the account, so what is on record for an address goes with managing inboxes.
Security and sender trust keeps policies, sender rules and the audit log readable by every member, because none of them carries mail content. Listing an inbox's senders or held stubs and previewing a policy take mail:read, while held-mail subjects and full held-message inspection require security:manage beside it. Changing policies or sender rules and discarding held mail take security:manage, and releasing held mail or marking a message safe or unsafe takes security:manage with mail:read.
Ask Doorman, the console's assistant, works within the same permissions. What it reads for a member is checked like the operation it stands for, and a change it proposes is made by the member's own session once they confirm it.
API keys and app tokens are not members
The permissions hold a person's console session. They do not hold an API key or an app token: a key has its account or inbox scope and an app the permissions it was granted, exactly as in a personal account. A key minted in an organization's account does everything an account key does, whatever the role of the person who minted it.
That makes keys:manage the widest permission of all: whoever may mint a key can do through it everything the key can do. Only an admin has it.
A key says who minted it. createdBy carries the identity provider's user id and the person's name at the time, so a team can tell whose key it is. It is null for a key that was minted with another key, and for keys older than the field.
{
"id": "key_01jc5c0z9y8x7w6v5t4t3s2r1q",
"inboxId": null,
"name": "Orchestrator",
"tokenPrefix": "dm_9f3abcd",
"last4": "m2x8",
"createdAt": "2026-11-05T10:05:00.000Z",
"lastUsedAt": null,
"createdBy": {
"userId": "user_2abcDEF3ghiJKL",
"name": "Dana Ortiz"
}
}A key belongs to the account, not to the person. It keeps working when the person who minted it leaves.
Connecting agents in an organization
An agent connected to an organization's account acts across every inbox of the organization, within what it was granted. Letting one in is therefore a permission of its own, agents:connect. It covers opening an approval request, allowing or denying it, and disconnecting an agent. An admin has it; a member does not.
The approval screen names the account the agent will act for. A person with several accounts can change the account there before choosing. The request follows them within the same browser session, and what they allow is the account shown when they choose. A request opened in one browser session cannot be decided from another.
A member without the permission who opens an approval request in the organization is refused with 403 permission_denied. They can change to their own account and connect the agent there, or ask an admin.
Every member can see what is connected: GET /v1/app-installs needs no permission. Registering and changing a developer app of the organization takes apps:manage; see Apps and OAuth.
Moving a personal account in
An organization's account starts empty. A person who already built something in their personal account can make that account the organization's: POST /v1/organization/adopt. The account keeps its id, and its inboxes, keys, domains, webhooks, apps and plan stay exactly as they are. What changes is whose it is: the organization's, shared by its members.
- It is a console operation, for a session working in the organization with
account:manage. An API key gets403 session_required, and a session in a personal account403 organization_required. accountIdnames the personal account to move, so that nothing is moved by mistake. It must be the signed-in person's own. Any other account answers404 not_found.- It works once for an organization, and only while the organization's own account has never been used: no inbox, key, domain or app was ever created in it and no agent was ever connected to it, not even one since deleted, it has no webhook endpoint, no security policy or sender rule was changed in it, and the operator has not changed it. Otherwise the call answers
409 organization_not_empty. - It cannot be undone.
So move the account in first, before creating anything in the organization. The rule is there because limits are counted per account: a month's sends, a new account's daily allowance, the assistant's turns. The move retires the organization's own account, and the person starts a new personal one afterwards. If a used account could be retired, or the move repeated, emptying an organization and moving a fresh account in would start every one of those limits again.
GET /v1/me says when the move can happen. session.personalAccountId is the id of the account that would move, and it is an id only while the call would succeed. The console offers the move only then.
{
"session": {
"userId": "user_2abcDEF3ghiJKL",
"role": "org:admin",
"permissions": [
"mail:read",
"mail:write",
"mail:send",
"inboxes:manage",
"security:manage",
"keys:manage",
"webhooks:manage",
"domains:manage",
"apps:manage",
"agents:connect",
"members:manage",
"billing:manage",
"account:manage",
"compliance:manage",
"phi:read"
],
"personalAccountId": "acc_01jc4q2b5d8f1h3k6n9q2s4v7x"
}
}{
"accountId": "acc_01jc4q2b5d8f1h3k6n9q2s4v7x"
}{
"id": "acc_01jc4q2b5d8f1h3k6n9q2s4v7x",
"email": "dana@example.com",
"name": "Acme",
"plan": "pro",
"kind": "organization"
}Afterwards the person has no personal account. A new, empty one is created the next time they work outside the organization.
Saying which account a request is for
A request may name the account it means in the x-doorman-account header, as an account id. When its credential acts for another account, the API answers 409 account_mismatch and does nothing. The value has to be that account's id exactly: an empty value, one that is not an account id and a header sent twice are refused the same way. Without the header nothing is checked.
The console sends it with every action. The organization a person works in belongs to a browser tab, while their session belongs to the whole browser. Without the header, a page opened for one account could act on another after a switch in a second tab. With it, the stale page is refused and has to be reloaded.
The header is honoured on every authenticated route under /v1, for every kind of credential: an API key, an app token and a console session. A service that holds keys for several accounts can send the account it means with each call, so that a key picked by mistake does nothing.
curl -s "https://api.doorman.fyi/v1/inboxes" \
-H "authorization: Bearer $DOORMAN_API_KEY" \
-H "x-doorman-account: acc_01jc4q3x6k9m2n8p4r7t5v1w3y"import { DoormanInbox } from "@doorman/inbox-sdk";
// Every request of this client names the account, and is refused when the key is another account's.
const client = new DoormanInbox({
apiKey: process.env.DOORMAN_API_KEY ?? "",
baseUrl: "https://api.doorman.fyi",
accountId: "acc_01jc4q3x6k9m2n8p4r7t5v1w3y",
});It is not read by the stream (GET /v1/ws), by the MCP address (POST /mcp), or by the routes that take no credential.
When a request is refused
| Status | Error | Meaning |
|---|---|---|
| 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 | organization_required | The operation acts on an organization, and the session is in a personal account. Switch to the organization 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. |
| 409 | organization_not_empty | The organization's account has been used, or an account was already moved into the organization, so another account cannot be moved in. Used means that an inbox, key, domain or app was created in it, even one since deleted, that it has a webhook endpoint, or that the operator changed it. |
permission_denied adds permission: the first permission the operation needs that the session does not hold.
{
"error": "permission_denied",
"message": "Your role in this organization cannot mint or revoke API keys. Ask one of its admins.",
"permission": "keys:manage"
}permission_denied: an admin can make the call, or change the member's role. A new role counts from the member's next session token, within about a minute.organization_required: switch to the organization in the console first.account_mismatch: reload the page, or use the credential of the account you mean.organization_not_empty: the organization's account has been used, or an account was already moved in, so nothing can be moved into it any more.
None of them is worth retrying unchanged. The whole catalogue is in Plans, limits and errors.
Limits, and what happens when someone leaves
- Members
- An organization holds at most 20 members. The identity provider also limits how many organizations one person may create. Both limits are the identity provider's, not the API's, so they are not among the published limits.
- Removing a member
- Takes effect when the session token they hold runs out, within about a minute. The API keeps no list of members: the person's next token no longer names the organization.
- What stays behind
- Nothing the person minted or connected is revoked. Keys and connected agents belong to the account, and
createdBysays whose a key was. Revoke the keys and disconnect the agents that should go with them. - Changing a role
- Counts the same way, from the member's next session token.
- Deleting an organization
- Members cannot delete an organization in the console. When an organization is deleted on the operator's side, its account is suspended, not erased: its keys and sessions stop working and its inboxes stop receiving, and nothing in it is removed. What happens to it next is the operator's decision.
- Deleting a person
- Removes that person's personal account, as before, and no organization's account.

