---
title: "Schemas"
description: "Every object the operations of the reference send or receive, with its fields, types and an example."
url: https://doorman.fyi/docs/reference/schemas
markdown: https://doorman.fyi/docs/reference/schemas.md
area: "API reference"
section: "API reference"
---

# Schemas

Every object the operations of the reference send or receive, with its fields, types and an example.

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

## About these schemas

The names below are the `components.schemas` of the OpenAPI document. A field marked optional may be absent; a type ending in `| null` may be null. Identifiers are a prefix, an underscore and 26 lowercase characters, and timestamps are ISO 8601 instants in UTC with milliseconds.

- [Error](https://doorman.fyi/docs/reference/schemas.md#Error)
- [CreateApp](https://doorman.fyi/docs/reference/schemas.md#CreateApp)
- [UpdateApp](https://doorman.fyi/docs/reference/schemas.md#UpdateApp)
- [App](https://doorman.fyi/docs/reference/schemas.md#App)
- [CreatedApp](https://doorman.fyi/docs/reference/schemas.md#CreatedApp)
- [AppList](https://doorman.fyi/docs/reference/schemas.md#AppList)
- [AppSecret](https://doorman.fyi/docs/reference/schemas.md#AppSecret)
- [AppInstall](https://doorman.fyi/docs/reference/schemas.md#AppInstall)
- [AppInstallList](https://doorman.fyi/docs/reference/schemas.md#AppInstallList)
- [OAuthConsent](https://doorman.fyi/docs/reference/schemas.md#OAuthConsent)
- [DecideOAuth](https://doorman.fyi/docs/reference/schemas.md#DecideOAuth)
- [OAuthDecision](https://doorman.fyi/docs/reference/schemas.md#OAuthDecision)
- [OAuthTokenRequest](https://doorman.fyi/docs/reference/schemas.md#OAuthTokenRequest)
- [OAuthTokens](https://doorman.fyi/docs/reference/schemas.md#OAuthTokens)
- [OAuthError](https://doorman.fyi/docs/reference/schemas.md#OAuthError)
- [RegisterOAuthClient](https://doorman.fyi/docs/reference/schemas.md#RegisterOAuthClient)
- [RegisteredOAuthClient](https://doorman.fyi/docs/reference/schemas.md#RegisteredOAuthClient)
- [OAuthServerMetadata](https://doorman.fyi/docs/reference/schemas.md#OAuthServerMetadata)
- [OAuthResourceMetadata](https://doorman.fyi/docs/reference/schemas.md#OAuthResourceMetadata)
- [Metadata](https://doorman.fyi/docs/reference/schemas.md#Metadata)
- [ThreadLabel](https://doorman.fyi/docs/reference/schemas.md#ThreadLabel)
- [ThreadLabels](https://doorman.fyi/docs/reference/schemas.md#ThreadLabels)
- [Inbox](https://doorman.fyi/docs/reference/schemas.md#Inbox)
- [InboxListItem](https://doorman.fyi/docs/reference/schemas.md#InboxListItem)
- [InboxPage](https://doorman.fyi/docs/reference/schemas.md#InboxPage)
- [CreateInbox](https://doorman.fyi/docs/reference/schemas.md#CreateInbox)
- [UpdateInbox](https://doorman.fyi/docs/reference/schemas.md#UpdateInbox)
- [ApiKey](https://doorman.fyi/docs/reference/schemas.md#ApiKey)
- [ApiKeyListItem](https://doorman.fyi/docs/reference/schemas.md#ApiKeyListItem)
- [ApiKeyList](https://doorman.fyi/docs/reference/schemas.md#ApiKeyList)
- [CreatedApiKey](https://doorman.fyi/docs/reference/schemas.md#CreatedApiKey)
- [CreateApiKey](https://doorman.fyi/docs/reference/schemas.md#CreateApiKey)
- [Health](https://doorman.fyi/docs/reference/schemas.md#Health)
- [Account](https://doorman.fyi/docs/reference/schemas.md#Account)
- [Organization](https://doorman.fyi/docs/reference/schemas.md#Organization)
- [AdoptAccount](https://doorman.fyi/docs/reference/schemas.md#AdoptAccount)
- [PlanSummary](https://doorman.fyi/docs/reference/schemas.md#PlanSummary)
- [Usage](https://doorman.fyi/docs/reference/schemas.md#Usage)
- [Subscription](https://doorman.fyi/docs/reference/schemas.md#Subscription)
- [Seats](https://doorman.fyi/docs/reference/schemas.md#Seats)
- [BillingSummary](https://doorman.fyi/docs/reference/schemas.md#BillingSummary)
- [SetSeats](https://doorman.fyi/docs/reference/schemas.md#SetSeats)
- [BillingRedirect](https://doorman.fyi/docs/reference/schemas.md#BillingRedirect)
- [BillingSynced](https://doorman.fyi/docs/reference/schemas.md#BillingSynced)
- [Me](https://doorman.fyi/docs/reference/schemas.md#Me)
- [Overview](https://doorman.fyi/docs/reference/schemas.md#Overview)
- [MetricsCounters](https://doorman.fyi/docs/reference/schemas.md#MetricsCounters)
- [MetricsBucket](https://doorman.fyi/docs/reference/schemas.md#MetricsBucket)
- [Metrics](https://doorman.fyi/docs/reference/schemas.md#Metrics)
- [DomainRecord](https://doorman.fyi/docs/reference/schemas.md#DomainRecord)
- [Domain](https://doorman.fyi/docs/reference/schemas.md#Domain)
- [DomainList](https://doorman.fyi/docs/reference/schemas.md#DomainList)
- [CreateDomain](https://doorman.fyi/docs/reference/schemas.md#CreateDomain)
- [DomainConnectSession](https://doorman.fyi/docs/reference/schemas.md#DomainConnectSession)
- [Redaction](https://doorman.fyi/docs/reference/schemas.md#Redaction)
- [BaaAgreement](https://doorman.fyi/docs/reference/schemas.md#BaaAgreement)
- [Baa](https://doorman.fyi/docs/reference/schemas.md#Baa)
- [BaaDocument](https://doorman.fyi/docs/reference/schemas.md#BaaDocument)
- [SignBaa](https://doorman.fyi/docs/reference/schemas.md#SignBaa)
- [TerminateBaa](https://doorman.fyi/docs/reference/schemas.md#TerminateBaa)
- [GuardrailPolicy](https://doorman.fyi/docs/reference/schemas.md#GuardrailPolicy)
- [UpdateGuardrailPolicy](https://doorman.fyi/docs/reference/schemas.md#UpdateGuardrailPolicy)
- [GuardrailSettings](https://doorman.fyi/docs/reference/schemas.md#GuardrailSettings)
- [CreateGuardrailRule](https://doorman.fyi/docs/reference/schemas.md#CreateGuardrailRule)
- [UpdateGuardrailRule](https://doorman.fyi/docs/reference/schemas.md#UpdateGuardrailRule)
- [GuardrailRule](https://doorman.fyi/docs/reference/schemas.md#GuardrailRule)
- [GuardrailRuleList](https://doorman.fyi/docs/reference/schemas.md#GuardrailRuleList)
- [GuardrailPreviewRequest](https://doorman.fyi/docs/reference/schemas.md#GuardrailPreviewRequest)
- [GuardrailPreview](https://doorman.fyi/docs/reference/schemas.md#GuardrailPreview)
- [RiskAssessment](https://doorman.fyi/docs/reference/schemas.md#RiskAssessment)
- [AttachmentScan](https://doorman.fyi/docs/reference/schemas.md#AttachmentScan)
- [Attachment](https://doorman.fyi/docs/reference/schemas.md#Attachment)
- [AttachmentText](https://doorman.fyi/docs/reference/schemas.md#AttachmentText)
- [NamedAddress](https://doorman.fyi/docs/reference/schemas.md#NamedAddress)
- [AuthenticationResults](https://doorman.fyi/docs/reference/schemas.md#AuthenticationResults)
- [MessageService](https://doorman.fyi/docs/reference/schemas.md#MessageService)
- [Message](https://doorman.fyi/docs/reference/schemas.md#Message)
- [SentMessage](https://doorman.fyi/docs/reference/schemas.md#SentMessage)
- [MessageList](https://doorman.fyi/docs/reference/schemas.md#MessageList)
- [Thread](https://doorman.fyi/docs/reference/schemas.md#Thread)
- [ThreadPage](https://doorman.fyi/docs/reference/schemas.md#ThreadPage)
- [ThreadMessages](https://doorman.fyi/docs/reference/schemas.md#ThreadMessages)
- [UpdateThread](https://doorman.fyi/docs/reference/schemas.md#UpdateThread)
- [SetThreadSeen](https://doorman.fyi/docs/reference/schemas.md#SetThreadSeen)
- [SendAttachment](https://doorman.fyi/docs/reference/schemas.md#SendAttachment)
- [SendMessage](https://doorman.fyi/docs/reference/schemas.md#SendMessage)
- [SendMessageForm](https://doorman.fyi/docs/reference/schemas.md#SendMessageForm)
- [PushSubscription](https://doorman.fyi/docs/reference/schemas.md#PushSubscription)
- [PushSettings](https://doorman.fyi/docs/reference/schemas.md#PushSettings)
- [CreatePushSubscription](https://doorman.fyi/docs/reference/schemas.md#CreatePushSubscription)
- [SecurityPolicy](https://doorman.fyi/docs/reference/schemas.md#SecurityPolicy)
- [UpdateSecurityPolicy](https://doorman.fyi/docs/reference/schemas.md#UpdateSecurityPolicy)
- [SecuritySettings](https://doorman.fyi/docs/reference/schemas.md#SecuritySettings)
- [Sender](https://doorman.fyi/docs/reference/schemas.md#Sender)
- [SenderPage](https://doorman.fyi/docs/reference/schemas.md#SenderPage)
- [CreateSenderRule](https://doorman.fyi/docs/reference/schemas.md#CreateSenderRule)
- [SenderRule](https://doorman.fyi/docs/reference/schemas.md#SenderRule)
- [SenderRulePage](https://doorman.fyi/docs/reference/schemas.md#SenderRulePage)
- [HeldMessage](https://doorman.fyi/docs/reference/schemas.md#HeldMessage)
- [HeldMessagePage](https://doorman.fyi/docs/reference/schemas.md#HeldMessagePage)
- [RiskFeedback](https://doorman.fyi/docs/reference/schemas.md#RiskFeedback)
- [SecurityAuditEntry](https://doorman.fyi/docs/reference/schemas.md#SecurityAuditEntry)
- [SecurityAuditPage](https://doorman.fyi/docs/reference/schemas.md#SecurityAuditPage)
- [SecurityPreviewRequest](https://doorman.fyi/docs/reference/schemas.md#SecurityPreviewRequest)
- [SecurityPreview](https://doorman.fyi/docs/reference/schemas.md#SecurityPreview)
- [HeldSend](https://doorman.fyi/docs/reference/schemas.md#HeldSend)
- [HeldSendPage](https://doorman.fyi/docs/reference/schemas.md#HeldSendPage)
- [SendOutcome](https://doorman.fyi/docs/reference/schemas.md#SendOutcome)
- [ServicePlan](https://doorman.fyi/docs/reference/schemas.md#ServicePlan)
- [ServicePlanInput](https://doorman.fyi/docs/reference/schemas.md#ServicePlanInput)
- [ServiceActorRef](https://doorman.fyi/docs/reference/schemas.md#ServiceActorRef)
- [ServiceAttention](https://doorman.fyi/docs/reference/schemas.md#ServiceAttention)
- [SignInClientSummary](https://doorman.fyi/docs/reference/schemas.md#SignInClientSummary)
- [ServiceSignIn](https://doorman.fyi/docs/reference/schemas.md#ServiceSignIn)
- [Service](https://doorman.fyi/docs/reference/schemas.md#Service)
- [ServicePage](https://doorman.fyi/docs/reference/schemas.md#ServicePage)
- [ServiceEvidence](https://doorman.fyi/docs/reference/schemas.md#ServiceEvidence)
- [ServiceDetail](https://doorman.fyi/docs/reference/schemas.md#ServiceDetail)
- [CreateService](https://doorman.fyi/docs/reference/schemas.md#CreateService)
- [UpdateService](https://doorman.fyi/docs/reference/schemas.md#UpdateService)
- [PassportSettings](https://doorman.fyi/docs/reference/schemas.md#PassportSettings)
- [UpdatePassportSettings](https://doorman.fyi/docs/reference/schemas.md#UpdatePassportSettings)
- [VerificationLink](https://doorman.fyi/docs/reference/schemas.md#VerificationLink)
- [Verification](https://doorman.fyi/docs/reference/schemas.md#Verification)
- [VerificationList](https://doorman.fyi/docs/reference/schemas.md#VerificationList)
- [StartSignIn](https://doorman.fyi/docs/reference/schemas.md#StartSignIn)
- [SignInStart](https://doorman.fyi/docs/reference/schemas.md#SignInStart)
- [SignInApproval](https://doorman.fyi/docs/reference/schemas.md#SignInApproval)
- [DecideSignIn](https://doorman.fyi/docs/reference/schemas.md#DecideSignIn)
- [SignInDecision](https://doorman.fyi/docs/reference/schemas.md#SignInDecision)
- [SignInLinkRequest](https://doorman.fyi/docs/reference/schemas.md#SignInLinkRequest)
- [SignInLinkPreview](https://doorman.fyi/docs/reference/schemas.md#SignInLinkPreview)
- [SignInLinkOpened](https://doorman.fyi/docs/reference/schemas.md#SignInLinkOpened)
- [ResumeSignIn](https://doorman.fyi/docs/reference/schemas.md#ResumeSignIn)
- [SignInResumed](https://doorman.fyi/docs/reference/schemas.md#SignInResumed)
- [CreateSignInClient](https://doorman.fyi/docs/reference/schemas.md#CreateSignInClient)
- [UpdateSignInClient](https://doorman.fyi/docs/reference/schemas.md#UpdateSignInClient)
- [SignInClient](https://doorman.fyi/docs/reference/schemas.md#SignInClient)
- [CreatedSignInClient](https://doorman.fyi/docs/reference/schemas.md#CreatedSignInClient)
- [SignInClientList](https://doorman.fyi/docs/reference/schemas.md#SignInClientList)
- [SignInClientSecret](https://doorman.fyi/docs/reference/schemas.md#SignInClientSecret)
- [SignInTokenRequest](https://doorman.fyi/docs/reference/schemas.md#SignInTokenRequest)
- [SignInTokens](https://doorman.fyi/docs/reference/schemas.md#SignInTokens)
- [SignInUserInfo](https://doorman.fyi/docs/reference/schemas.md#SignInUserInfo)
- [SignInDiscovery](https://doorman.fyi/docs/reference/schemas.md#SignInDiscovery)
- [SignInJwk](https://doorman.fyi/docs/reference/schemas.md#SignInJwk)
- [SignInJwks](https://doorman.fyi/docs/reference/schemas.md#SignInJwks)
- [SignInProtocolError](https://doorman.fyi/docs/reference/schemas.md#SignInProtocolError)
- [Member](https://doorman.fyi/docs/reference/schemas.md#Member)
- [MemberList](https://doorman.fyi/docs/reference/schemas.md#MemberList)
- [UpdateMember](https://doorman.fyi/docs/reference/schemas.md#UpdateMember)
- [Invitation](https://doorman.fyi/docs/reference/schemas.md#Invitation)
- [InvitationList](https://doorman.fyi/docs/reference/schemas.md#InvitationList)
- [CreateInvitation](https://doorman.fyi/docs/reference/schemas.md#CreateInvitation)
- [UpdateInvitation](https://doorman.fyi/docs/reference/schemas.md#UpdateInvitation)
- [AssistantMessage](https://doorman.fyi/docs/reference/schemas.md#AssistantMessage)
- [AssistantStage](https://doorman.fyi/docs/reference/schemas.md#AssistantStage)
- [AssistantStageCue](https://doorman.fyi/docs/reference/schemas.md#AssistantStageCue)
- [AssistantChatRequest](https://doorman.fyi/docs/reference/schemas.md#AssistantChatRequest)
- [AssistantProposal](https://doorman.fyi/docs/reference/schemas.md#AssistantProposal)
- [AssistantEvent](https://doorman.fyi/docs/reference/schemas.md#AssistantEvent)
- [InboxWebhook](https://doorman.fyi/docs/reference/schemas.md#InboxWebhook)
- [InboxWebhookSecret](https://doorman.fyi/docs/reference/schemas.md#InboxWebhookSecret)
- [SetInboxWebhook](https://doorman.fyi/docs/reference/schemas.md#SetInboxWebhook)
- [LastDelivery](https://doorman.fyi/docs/reference/schemas.md#LastDelivery)
- [Endpoint](https://doorman.fyi/docs/reference/schemas.md#Endpoint)
- [EndpointList](https://doorman.fyi/docs/reference/schemas.md#EndpointList)
- [CreatedEndpoint](https://doorman.fyi/docs/reference/schemas.md#CreatedEndpoint)
- [EndpointSecret](https://doorman.fyi/docs/reference/schemas.md#EndpointSecret)
- [EndpointTestResult](https://doorman.fyi/docs/reference/schemas.md#EndpointTestResult)
- [CreateEndpoint](https://doorman.fyi/docs/reference/schemas.md#CreateEndpoint)
- [UpdateEndpoint](https://doorman.fyi/docs/reference/schemas.md#UpdateEndpoint)
- [Delivery](https://doorman.fyi/docs/reference/schemas.md#Delivery)
- [DeliveryPage](https://doorman.fyi/docs/reference/schemas.md#DeliveryPage)
- [MessageReceivedEvent](https://doorman.fyi/docs/reference/schemas.md#MessageReceivedEvent)
- [CreatedInbox](https://doorman.fyi/docs/reference/schemas.md#CreatedInbox)
- [MessageSentEvent](https://doorman.fyi/docs/reference/schemas.md#MessageSentEvent)
- [ThreadUpdatedEvent](https://doorman.fyi/docs/reference/schemas.md#ThreadUpdatedEvent)
- [InboxCreatedEvent](https://doorman.fyi/docs/reference/schemas.md#InboxCreatedEvent)
- [InboxDeletedEvent](https://doorman.fyi/docs/reference/schemas.md#InboxDeletedEvent)
- [DeliveryFailedEvent](https://doorman.fyi/docs/reference/schemas.md#DeliveryFailedEvent)
- [MessageHeldEvent](https://doorman.fyi/docs/reference/schemas.md#MessageHeldEvent)
- [SendHeldEvent](https://doorman.fyi/docs/reference/schemas.md#SendHeldEvent)
- [SendDiscardedEvent](https://doorman.fyi/docs/reference/schemas.md#SendDiscardedEvent)
- [SignInRequestedEvent](https://doorman.fyi/docs/reference/schemas.md#SignInRequestedEvent)
- [SignInCompletedEvent](https://doorman.fyi/docs/reference/schemas.md#SignInCompletedEvent)
- [WebhookEvent](https://doorman.fyi/docs/reference/schemas.md#WebhookEvent)
- [EventSummary](https://doorman.fyi/docs/reference/schemas.md#EventSummary)
- [Event](https://doorman.fyi/docs/reference/schemas.md#Event)
- [EventPage](https://doorman.fyi/docs/reference/schemas.md#EventPage)
- [EventPoll](https://doorman.fyi/docs/reference/schemas.md#EventPoll)
- [EventList](https://doorman.fyi/docs/reference/schemas.md#EventList)
- [EventDetail](https://doorman.fyi/docs/reference/schemas.md#EventDetail)
- [RuleWhen](https://doorman.fyi/docs/reference/schemas.md#RuleWhen)
- [RuleAction](https://doorman.fyi/docs/reference/schemas.md#RuleAction)
- [CreateRule](https://doorman.fyi/docs/reference/schemas.md#CreateRule)
- [UpdateRule](https://doorman.fyi/docs/reference/schemas.md#UpdateRule)
- [Rule](https://doorman.fyi/docs/reference/schemas.md#Rule)
- [RuleList](https://doorman.fyi/docs/reference/schemas.md#RuleList)
- [RuleRun](https://doorman.fyi/docs/reference/schemas.md#RuleRun)
- [RuleRunPage](https://doorman.fyi/docs/reference/schemas.md#RuleRunPage)
- [StreamSubscribe](https://doorman.fyi/docs/reference/schemas.md#StreamSubscribe)
- [StreamUnsubscribe](https://doorman.fyi/docs/reference/schemas.md#StreamUnsubscribe)
- [StreamPing](https://doorman.fyi/docs/reference/schemas.md#StreamPing)
- [StreamClientFrame](https://doorman.fyi/docs/reference/schemas.md#StreamClientFrame)
- [StreamSubscribed](https://doorman.fyi/docs/reference/schemas.md#StreamSubscribed)
- [StreamUnsubscribed](https://doorman.fyi/docs/reference/schemas.md#StreamUnsubscribed)
- [StreamPong](https://doorman.fyi/docs/reference/schemas.md#StreamPong)
- [StreamError](https://doorman.fyi/docs/reference/schemas.md#StreamError)
- [StreamEvent](https://doorman.fyi/docs/reference/schemas.md#StreamEvent)
- [StreamServerFrame](https://doorman.fyi/docs/reference/schemas.md#StreamServerFrame)

## Error

Every error answer: a stable code and a sentence, plus details some codes add.

**Fields: Error**
- `error` ("unauthorized" | "session_invalid" | "session_expired" | "session_claims_missing" | "plan_limit_reached" | "seat_required" | "payment_failed" | "forbidden" | "permission_denied" | "member_deactivated" | "organization_required" | "owner_required" | "insufficient_scope" | "session_required" | "account_suspended" | "account_deleted" | "inbox_suspended" | "recipient_not_permitted" | "risk_blocked" | "baa_required" | "guardrail_blocked" | "not_found" | "thread_not_found" | "validation_error" | "invalid_json" | "invalid_form" | "recipient_suppressed" | "send_rejected" | "webhook_rejected" | "method_not_allowed" | "already_exists" | "limit_reached" | "no_webhook" | "delivery_pending" | "idempotency_in_progress" | "not_suspended" | "already_subscribed" | "no_subscription" | "seat_change_pending" | "seats_in_use" | "account_mismatch" | "last_owner" | "already_member" | "already_invited" | "organization_not_empty" | "message_too_large" | "idempotency_key_reused" | "upgrade_required" | "rate_limit_exceeded" | "provider_rate_limited" | "internal_error" | "send_failed" | "sending_paused" | "sending_unavailable" | "scan_unavailable" | "assistant_unavailable" | "custom_domains_unavailable" | "connect_unavailable" | "push_unavailable" | "domain_not_verified" | "host_proof_failed" | "provider_unavailable" | "queue_unavailable"): A stable code; see the error catalogue.
- `message` (string): One sentence for a person or a log.
- `permission` ("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", optional): `permission_denied`: the permission the member's role in the organization lacks.
- `scope` ("inboxes" | "account" | "inbox" | "domains", optional): The inbox, account, or domain allowance or rate limit that applied.
- `plan` (string, optional): `plan_limit_reached`: the account's plan.
- `limit` (integer | null, optional): `plan_limit_reached` and `rate_limit_exceeded`: the limit that applied.
- `used` (integer, optional): `plan_limit_reached`: how much of the allowance is used. `seat_required` and `seats_in_use`: the seats held by members and open invitations.
- `seats` (integer | null, optional): `seat_required`: the seats the organization's subscription pays for; null when it has no Teams subscription.
- `seatPriceUsd` (number, optional): `seat_required`: what one seat costs a month.
- `resetsAt` (string (date-time), optional): `plan_limit_reached` (sends) and `rate_limit_exceeded`: when the count starts again.
- `providerCode` (string, optional): `send_rejected` and `send_failed`: the sending provider's own code.
- `guard` ("reply" | "recipient" | "content" | "guardrail", optional): `risk_blocked`: which guard refused: `reply` or `recipient` from the security policy, `content` when an attachment did not pass the check of its bytes, or `guardrail` when a healthcare guardrail found what may not be sent.
- `reasons` (string[], optional): `risk_blocked` with the `content` guard: the reason codes from `RISK_REASONS` for what was found.
- `entities` (("ssn" | "medical_record_number" | "insurance_id" | "date_of_birth" | "phone" | "email" | "street_address" | "payment_card" | "bank_account" | "ip_address" | "national_id" | "drivers_license" | "passport" | "patient_name" | "custom")[], optional): `guardrail_blocked`, and `risk_blocked` with the `guardrail` guard: the kinds of protected information that were found. Never the text.
- `baa` ("plan_required" | "not_signed" | "reacceptance_required", optional): `baa_required`: what is missing before guardrails can be changed.
- `field` ("mailboxName" | "externalId", optional): `already_exists` on an inbox: which of the request's values is already in use.

Example:
```json
{
  "error": "not_found",
  "message": "Inbox not found."
}
```

## CreateApp

Register a client. Confidential clients receive a one-time secret; every client uses S256 PKCE.

**Fields: CreateApp**
- `name` (string)
- `redirectUris` (string[])
- `scopes` (("account:read" | "inboxes:read" | "inboxes:write" | "mail:read" | "mail:write" | "mail:send" | "mail:draft" | "events:read" | "webhooks:manage" | "rules:manage")[])
- `tokenEndpointAuthMethod` ("none" | "client_secret_post", optional)

Example:
```json
{
  "name": "Mail triage",
  "redirectUris": [
    "https://agent.example.com/callback"
  ],
  "scopes": [
    "mail:read"
  ]
}
```

## UpdateApp

Replace supplied fields. Every edit invalidates pending consent and existing installations.

**Fields: UpdateApp**
- `name` (string, optional)
- `redirectUris` (string[], optional)
- `scopes` (("account:read" | "inboxes:read" | "inboxes:write" | "mail:read" | "mail:write" | "mail:send" | "mail:draft" | "events:read" | "webhooks:manage" | "rules:manage")[], optional)

Example:
```json
{
  "name": "Mail review"
}
```

## App

A registered client without its secret. A display name is not evidence of a verified developer.

**Fields: App**
- `id` (string): An OAuth client identifier. Example: `app_01jc5f1a2b3c4d5e6f7g8h9j0k`
- `name` (string)
- `redirectUris` (string[])
- `scopes` (("account:read" | "inboxes:read" | "inboxes:write" | "mail:read" | "mail:write" | "mail:send" | "mail:draft" | "events:read" | "webhooks:manage" | "rules:manage")[])
- `tokenEndpointAuthMethod` ("none" | "client_secret_post")
- `status` ("active" | "deleted")
- `createdAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `updatedAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`

Example:
```json
{
  "id": "app_01jc5f1a2b3c4d5e6f7g8h9j0k",
  "name": "Mail triage",
  "redirectUris": [
    "https://agent.example.com/callback"
  ],
  "scopes": [
    "mail:read"
  ],
  "tokenEndpointAuthMethod": "none",
  "status": "active",
  "createdAt": "2026-11-05T10:05:00.000Z",
  "updatedAt": "2026-11-05T10:05:00.000Z"
}
```

## CreatedApp

The client and, for confidential clients only, its secret shown once.

**Fields: CreatedApp**
- `id` (string): An OAuth client identifier. Example: `app_01jc5f1a2b3c4d5e6f7g8h9j0k`
- `name` (string)
- `redirectUris` (string[])
- `scopes` (("account:read" | "inboxes:read" | "inboxes:write" | "mail:read" | "mail:write" | "mail:send" | "mail:draft" | "events:read" | "webhooks:manage" | "rules:manage")[])
- `tokenEndpointAuthMethod` ("none" | "client_secret_post")
- `status` ("active" | "deleted")
- `createdAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `updatedAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `clientSecret` (string | null)

## AppList

The developer's registered apps.

**Fields: AppList**
- `data` (App[])

## AppSecret

A new client secret, shown once. Existing installations are revoked.

**Fields: AppSecret**
- `id` (string): An OAuth client identifier. Example: `app_01jc5f1a2b3c4d5e6f7g8h9j0k`
- `clientSecret` (string)

## AppInstall

An account's explicit grant to a client. Revocation stops future API and background access.

**Fields: AppInstall**
- `id` (string): An app installation identifier. Example: `ins_01jc5f1a2b3c4d5e6f7g8h9j0k`
- `appId` (string): An OAuth client identifier. Example: `app_01jc5f1a2b3c4d5e6f7g8h9j0k`
- `name` (string)
- `dynamic` (boolean): The client registered itself. Nothing about it was checked, its name included.
- `metadataUrl` (string | null): The identity document the client published, when it named itself by one. The host that serves the document was checked; the name is what that host says about itself. Null for a client registered in the console or by itself.
- `scopes` (("account:read" | "inboxes:read" | "inboxes:write" | "mail:read" | "mail:write" | "mail:send" | "mail:draft" | "events:read" | "webhooks:manage" | "rules:manage")[])
- `status` ("active" | "revoked")
- `createdAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `lastUsedAt` (string (date-time) | null): When the client last used this grant, to the minute. Null until it does.
- `expiresAt` (string (date-time) | null): When the grant's connections end unless the client stays in use. Null when no connection is alive: the client never finished connecting, was revoked, or went unused past the limit.
- `revokedAt` (string (date-time) | null)

Example:
```json
{
  "id": "ins_01jc5f1a2b3c4d5e6f7g8h9j0k",
  "appId": "app_01jc5f1a2b3c4d5e6f7g8h9j0k",
  "name": "Mail triage",
  "dynamic": false,
  "metadataUrl": null,
  "scopes": [
    "mail:read"
  ],
  "status": "active",
  "createdAt": "2026-11-05T10:05:00.000Z",
  "lastUsedAt": "2026-11-05T10:05:00.000Z",
  "expiresAt": "2026-12-05T10:05:00.000Z",
  "revokedAt": null
}
```

## AppInstallList

The account's active and revoked installations.

**Fields: AppInstallList**
- `data` (AppInstall[])

## OAuthConsent

A one-time request bound to the current console session. Approval is never automatic.

**Fields: OAuthConsent**
- `requestId` (string)
- `client` (object)
  - `id` (string): An OAuth client identifier. Example: `app_01jc5f1a2b3c4d5e6f7g8h9j0k`
  - `name` (string)
  - `dynamic` (boolean): The client registered itself. Nothing about it was checked, its name included.
  - `metadataUrl` (string | null): The identity document the client published, when it named itself by one. The host that serves the document was checked; the name is what that host says about itself. Null for a client registered in the console or by itself.
- `redirectUri` (string)
- `resource` (string)
- `scopes` (("account:read" | "inboxes:read" | "inboxes:write" | "mail:read" | "mail:write" | "mail:send" | "mail:draft" | "events:read" | "webhooks:manage" | "rules:manage")[])
- `expiresAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `csrf` (string)

## DecideOAuth

An explicit decision for this session-bound request.

**Fields: DecideOAuth**
- `decision` ("approve" | "deny")
- `csrf` (string)

## OAuthDecision

The validated redirect carrying state, issuer and a code or access_denied.

**Fields: OAuthDecision**
- `redirectUrl` (string)

## OAuthTokenRequest

A form-encoded code exchange or refresh. Resource and client are bound to the original grant. Other fields are ignored.

**Fields: OAuthTokenRequest**
- `grant_type` ("authorization_code" | "refresh_token")
- `client_id` (string | string): A client id this API issued, or the URL of the client's Client ID Metadata Document. Example: `app_01jc5f1a2b3c4d5e6f7g8h9j0k`
- `client_secret` (string, optional)
- `resource` (string)
- `code` (string, optional)
- `redirect_uri` (string, optional)
- `code_verifier` (string, optional)
- `refresh_token` (string, optional)
- `scope` (string, optional)

Example:
```json
{
  "grant_type": "authorization_code",
  "client_id": "app_01jc5f1a2b3c4d5e6f7g8h9j0k",
  "resource": "https://api.doorman.example",
  "code": "replace-with-the-validated-callback-code",
  "redirect_uri": "https://agent.example.com/callback",
  "code_verifier": "replace-with-the-verifier-saved-before-the-redirect"
}
```

## OAuthTokens

Short-lived bearer access and a rotating refresh token. Store them as secrets.

**Fields: OAuthTokens**
- `access_token` (string)
- `token_type` ("Bearer")
- `expires_in` (integer)
- `refresh_token` (string)
- `scope` (string)

## OAuthError

An OAuth protocol error, distinct from the Inbox API error envelope.

**Fields: OAuthError**
- `error` ("invalid_request" | "invalid_client" | "invalid_grant" | "invalid_scope" | "unsupported_grant_type" | "temporarily_unavailable" | "invalid_redirect_uri" | "invalid_client_metadata")
- `error_description` (string, optional)

## RegisterOAuthClient

Dynamic registration of a public client, not a verified developer identity. Other client metadata is ignored and redirects the API cannot use are dropped. The answer states what was registered: always a public client with both grants.

**Fields: RegisterOAuthClient**
- `client_name` (string, optional)
- `redirect_uris` (string[])
- `token_endpoint_auth_method` (string, optional)
- `grant_types` (string[], optional)
- `response_types` (string[], optional)
- `scope` (string, optional)

Example:
```json
{
  "client_name": "Mail triage",
  "redirect_uris": [
    "https://agent.example.com/callback"
  ],
  "scope": "mail:read"
}
```

## RegisteredOAuthClient

A bounded public client registration. No client secret or registration management token is issued.

**Fields: RegisteredOAuthClient**
- `client_id` (string): An OAuth client identifier. Example: `app_01jc5f1a2b3c4d5e6f7g8h9j0k`
- `client_name` (string)
- `redirect_uris` (string[])
- `token_endpoint_auth_method` ("none")
- `grant_types` (("authorization_code" | "refresh_token")[])
- `response_types` ("code"[])
- `scope` (string)
- `client_id_issued_at` (integer)
- `client_id_expires_at` (integer)

## OAuthServerMetadata

OAuth authorization-server discovery.

**Fields: OAuthServerMetadata**
- `issuer` (string)
- `authorization_endpoint` (string)
- `token_endpoint` (string)
- `registration_endpoint` (string)
- `response_types_supported` ("code"[])
- `grant_types_supported` (("authorization_code" | "refresh_token")[])
- `code_challenge_methods_supported` ("S256"[])
- `token_endpoint_auth_methods_supported` (("none" | "client_secret_post")[])
- `scopes_supported` (("account:read" | "inboxes:read" | "inboxes:write" | "mail:read" | "mail:write" | "mail:send" | "mail:draft" | "events:read" | "webhooks:manage" | "rules:manage" | "keys:manage" | "offline_access")[])
- `authorization_response_iss_parameter_supported` (true)
- `client_id_metadata_document_supported` (true)

## OAuthResourceMetadata

Protected-resource discovery for the Inbox API or its MCP endpoint.

**Fields: OAuthResourceMetadata**
- `resource` (string)
- `authorization_servers` (string[])
- `scopes_supported` (("account:read" | "inboxes:read" | "inboxes:write" | "mail:read" | "mail:write" | "mail:send" | "mail:draft" | "events:read" | "webhooks:manage" | "rules:manage")[])
- `bearer_methods_supported` ("header"[])

## Metadata

Extension state: at most 20 keys and 2048 bytes of UTF-8 JSON. Keys are 1 to 64 ASCII letters, digits, underscores, dots, colons or hyphens, starting with a letter or digit. Values are strings, finite numbers, booleans or null. Replaced as a whole; {} clears it. Do not store secrets.

**Fields: Metadata**
No fields.

Example:
```json
{
  "customer": "customer-8841",
  "reviewed": false
}
```

## ThreadLabel

A case-sensitive label: 1 to 64 ASCII letters, digits, underscores, dots, colons or hyphens, starting with a letter or digit.

**Fields: ThreadLabel**
No fields.

Example:
```json
"needs-review"
```

## ThreadLabels

At most 20 unique labels. Replaced as a whole; [] clears the labels.

**Fields: ThreadLabels**
No fields.

Example:
```json
[
  "needs-review"
]
```

## Inbox

An address on the inbox domain that receives mail as soon as it exists.

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

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

## InboxListItem

An inbox as a list shows it, with what the console displays next to it.

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

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

## InboxPage

A page of the account's inboxes, oldest first.

**Fields: InboxPage**
- `data` (InboxListItem[])
- `limit` (integer): The page size that was applied.
- `offset` (integer): The offset that was applied.
- `total` (integer): How many inboxes match, across every page.

## CreateInbox

A new inbox. Every field is optional: an empty body issues a random address. `webhookUrl` and `key` make the inbox ready to use in one call; their secrets come back once, in the answer.

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

Example:
```json
{
  "mailboxName": "concierge",
  "displayName": "Acme concierge"
}
```

## UpdateInbox

Changes to an inbox; fields left out stay as they are. The address never changes.

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

Example:
```json
{
  "displayName": "Acme concierge"
}
```

## ApiKey

An API key as the API lists it. The token itself appears once, when the key is created.

**Fields: ApiKey**
- `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:
```json
{
  "id": "key_01jc5c0z9y8x7w6v5t4t3s2r1q",
  "inboxId": null,
  "name": "Orchestrator",
  "tokenPrefix": "dm_9f3abcd",
  "last4": "m2x8",
  "createdAt": "2026-11-05T10:05:00.000Z",
  "lastUsedAt": null
}
```

## ApiKeyListItem

A key in the account-wide list; `inboxAddress` is present when inbox-scoped keys were included.

**Fields: ApiKeyListItem**
- `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`
- `inboxAddress` (string | null, optional): The address of an inbox-scoped key's inbox; null for an account key. Only with `scope=all`.

Example:
```json
{
  "id": "key_01jc5c0z9y8x7w6v5t4t3s2r1q",
  "inboxId": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "name": "Support agent on the laptop",
  "tokenPrefix": "dm_7c1xyza",
  "last4": "k9q2",
  "createdAt": "2026-11-05T10:05:00.000Z",
  "lastUsedAt": "2026-11-05T10:05:00.000Z",
  "inboxAddress": "concierge@doorman.example"
}
```

## ApiKeyList

Active keys, oldest first.

**Fields: ApiKeyList**
- `data` (ApiKeyListItem[])

## CreatedApiKey

A freshly minted key with its token, which is shown once and stored only as a hash.

**Fields: CreatedApiKey**
- `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:
```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"
}
```

## CreateApiKey

A new key. The name is a label for people.

**Fields: CreateApiKey**
- `name` (string, optional): A label, at most 100 characters. Example: `Orchestrator`

Example:
```json
{
  "name": "Orchestrator"
}
```

## Health

The service is up.

**Fields: Health**
- `ok` (true)
- `service` ("doorman-inbox")

Example:
```json
{
  "ok": true,
  "service": "doorman-inbox"
}
```

## Account

The account as its owner sees it: one person's, or the one an organization's members share.

**Fields: Account**
- `id` (string): An account identifier. Example: `acc_01jc4q3x6k9m2n8p4r7t5v1w3y`
- `email` (string (email)): The person's verified address, or an organization's contact address. Example: `sam@example.com`
- `name` (string): The person's name, or the organization's. Example: `Dana Ortiz`
- `plan` ("free" | "pro" | "enterprise")
- `kind` ("personal" | "organization", optional): `personal` for one person's account, `organization` for the account a team shares. Older deployments omit it.

Example:
```json
{
  "id": "acc_01jc4q3x6k9m2n8p4r7t5v1w3y",
  "email": "dana@example.com",
  "name": "Dana Ortiz",
  "plan": "free"
}
```

## Organization

The organization an account belongs to, as the identity provider knows it. Its members, their invitations and their roles are managed there.

**Fields: Organization**
- `id` (string): The identity provider's organization id. Example: `org_2abcDEF3ghiJKL`
- `name` (string): The organization's name; empty until the identity provider has reported it. Example: `Acme`
- `slug` (string | null): The organization's slug at the identity provider, or null when it has none. Example: `acme`

Example:
```json
{
  "id": "org_2abcDEF3ghiJKL",
  "name": "Acme",
  "slug": "acme"
}
```

## AdoptAccount

The personal account to move into the organization the session is working in. It must be the signed-in person's own.

**Fields: AdoptAccount**
- `accountId` (string): An account identifier. Example: `acc_01jc4q3x6k9m2n8p4r7t5v1w3y`

Example:
```json
{
  "accountId": "acc_01jc4q3x6k9m2n8p4r7t5v1w3y"
}
```

## PlanSummary

The account's plan and its limits; null limits mean unlimited.

**Fields: PlanSummary**
- `name` ("free" | "pro" | "enterprise")
- `label` (string) Example: `Free`
- `priceUsd` (number | null): Per month per account; null means by arrangement.
- `inboxLimit` (integer | null)
- `monthlySendLimit` (integer | null)
- `domainLimit` (integer | null, optional): Custom domains allowed; zero on free. Older deployments omit it.

Example:
```json
{
  "name": "free",
  "label": "Free",
  "priceUsd": 0,
  "inboxLimit": 3,
  "monthlySendLimit": 3000
}
```

## Usage

This month's usage against the plan.

**Fields: Usage**
- `inboxes` (integer): Active inboxes.
- `domains` (integer, optional): Active custom domains. Older deployments omit it.
- `sendsThisMonth` (integer): Successful sends this UTC calendar month, replies included.
- `monthResetsAt` (string (date-time)): The first instant of the next UTC month. Example: `2026-11-05T10:05:00.000Z`

Example:
```json
{
  "inboxes": 1,
  "sendsThisMonth": 37,
  "monthResetsAt": "2026-12-01T00:00:00.000Z"
}
```

## Subscription

The account's subscription to the paid plan, as the payment provider last reported it.

**Fields: Subscription**
- `status` ("active" | "past_due" | "canceled")
- `cancelAtPeriodEnd` (boolean): True when the subscription was canceled and the plan lasts until `currentPeriodEnd`.
- `currentPeriodEnd` (string (date-time) | null): When the paid period ends: the next charge, or the last day of the plan when `cancelAtPeriodEnd` is true.

Example:
```json
{
  "status": "active",
  "cancelAtPeriodEnd": false,
  "currentPeriodEnd": "2026-12-05T10:05:00.000Z"
}
```

## Seats

An organization's seats. A seat is held by every active member and by every invitation that is still open.

**Fields: Seats**
- `purchased` (integer | null): The seats the organization's subscription pays for; null while it has no Teams subscription.
- `used` (integer): The seats held: active members and open invitations.
- `limit` (integer | null): How many people the organization may hold now: `purchased` for a team that pays, one for an organization that pays nothing, null when nothing limits it.
- `seatPriceUsd` (number): What one seat costs a month.
- `minSeats` (integer): The fewest seats a Teams subscription holds.
- `maxSeats` (integer): The most seats a Teams subscription holds.

Example:
```json
{
  "purchased": 3,
  "used": 2,
  "limit": 3,
  "seatPriceUsd": 7,
  "minSeats": 3,
  "maxSeats": 20
}
```

## BillingSummary

How the account pays. `subscription` is null for an account that has none, whatever its plan: an operator can set a plan by hand.

**Fields: BillingSummary**
- `subscription` (Subscription | null)
- `seats` (Seats, optional): Present for an organization's account where the deployment sells the Teams plan, which is paid per seat.

Example:
```json
{
  "subscription": null
}
```

## SetSeats

The number of seats the organization's Teams subscription should hold: the whole count, not a difference.

**Fields: SetSeats**
- `seats` (integer)

Example:
```json
{
  "seats": 4
}
```

## BillingRedirect

A page at the payment provider to send the person's browser to. It is for this account only and expires.

**Fields: BillingRedirect**
- `url` (string)

Example:
```json
{
  "url": "https://payments.example/checkout/c_123"
}
```

## BillingSynced

The account's plan and billing after they were read again from the payment provider.

**Fields: BillingSynced**
- `plan` ("free" | "pro" | "enterprise")
- `billing` (BillingSummary)

Example:
```json
{
  "plan": "pro",
  "billing": {
    "subscription": {
      "status": "active",
      "cancelAtPeriodEnd": false,
      "currentPeriodEnd": "2026-12-05T10:05:00.000Z"
    }
  }
}
```

## Me

The account, its plan and usage, the caller, the organization the account belongs to, and the inbox domain of this deployment.

**Fields: Me**
- `account` (Account)
- `plan` (PlanSummary)
- `usage` (Usage)
- `key` (object | null): The API key that made the call; null for a console session.
  - `id` (string): An API key identifier. Example: `key_01jc5c0z9y8x7w6v5t4t3s2r1q`
  - `scope` ("account" | "inbox")
  - `inboxId` (string | null)
- `session` (object | null): The console session that made the call; null for an API key.
  - `userId` (string): The identity provider's user id.
  - `role` (string | null, optional): The person's role in the organization as the identity provider names it (`org:admin` or `org:member`); null in a personal account. What the session may do follows `memberRole`, not this. Older deployments omit it. Example: `org:admin`
  - `memberRole` ("owner" | "admin" | "member" | "viewer" | null, optional): The role the API keeps for the person in the organization, which decides what the session may do: `owner`, `admin`, `member` or `viewer`. Null in a personal account. Older deployments omit it. Example: `owner`
  - `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")[], optional): What this session may do: every permission in a personal account, otherwise what the member's role holds. A person the identity provider names an admin holds at least what an admin holds. Older deployments omit it.
  - `personalAccountId` (string | null, optional): In an organization, the account `POST /v1/organization/adopt` would move, for as long as it can be moved: the person's own personal account, when the session holds `account:manage`, the organization's account has never been used and no account was moved into the organization before. Null otherwise. Older deployments omit it.
- `organization` (Organization | null, optional): The organization the account belongs to, whoever is calling; null for a personal account. Older deployments omit it.
- `oauth` (object, optional): Present only when a scoped app access token made the call.
  - `appId` (string): An OAuth client identifier. Example: `app_01jc5f1a2b3c4d5e6f7g8h9j0k`
  - `installationId` (string): An app installation identifier. Example: `ins_01jc5f1a2b3c4d5e6f7g8h9j0k`
  - `scopes` (("account:read" | "inboxes:read" | "inboxes:write" | "mail:read" | "mail:write" | "mail:send" | "mail:draft" | "events:read" | "webhooks:manage" | "rules:manage")[])
- `inbox` (Inbox | null): The inbox an inbox-scoped key reaches; null otherwise.
- `inboxDomain` (string): Every inbox address is a mailbox name at this domain. Example: `doorman.example`
- `features` (object, optional): Configured capabilities, independent of the plan. Missing flags mean unavailable.
  - `customDomains` (boolean)
  - `domainConnect` (boolean)
  - `signIn` (boolean, optional): Whether Sign in with Doorman is switched on for this deployment.
  - `billing` (boolean, optional): Whether an account can pay for a plan here. Where it cannot, plans are set by the operator.
  - `healthcare` (boolean, optional): Whether healthcare guardrails and the business associate agreement are switched on for this deployment (ADR-027).
  - `drafts` (boolean, optional): Whether an app or a key can write drafts for the owner to send here (ADR-028).
- `billing` (BillingSummary, optional): Present where billing is switched on and the caller is an account key or a console session.
- `healthcare` (object, optional): Present where healthcare guardrails are switched on and the caller is an account key or a console session.
  - `baa` ("not_signed" | "active" | "reacceptance_required" | "terminated"): Where the account stands with the business associate agreement.
  - `eligible` (boolean): Whether the account may sign and change guardrails now.
  - `guardrails` (boolean): Whether guardrails apply to the account's mail now.

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

## Overview

The console's first page: counts, recent activity and the getting-started checklist.

**Fields: Overview**
- `inboxes` (object)
  - `active` (integer)
  - `limit` (integer | null): The plan's allowance; null means unlimited.
- `keys` (object)
  - `account` (integer): Active account keys.
  - `inbox` (integer): Active inbox-scoped keys.
- `mail` (object)
  - `receivedLast7Days` (integer)
  - `sentLast7Days` (integer)
  - `unreadThreads` (integer): Across live inboxes, untrashed threads.
  - `lastReceivedAt` (string (date-time) | null)
  - `lastSentAt` (string (date-time) | null)
- `webhooks` (object)
  - `inboxWebhooks` (integer)
  - `endpoints` (integer)
  - `deliveredLast24Hours` (integer)
  - `failedLast24Hours` (integer)
- `checklist` (object): What has happened at least once.
  - `createdInbox` (boolean)
  - `createdKey` (boolean)
  - `receivedMessage` (boolean)
  - `connectedWebhook` (boolean): True while an inbox webhook or an endpoint exists.
  - `sentMessage` (boolean)
- `services` (object, optional): The account's passport: the outside services its addresses are signed up for. Older deployments omit it.
  - `total` (integer): Services the live inboxes are signed up for, archived ones left out.
  - `pending` (integer): Sign-ups not confirmed yet.
  - `paid` (integer): Services that have sent a receipt or an invoice.
  - `attention` (integer, optional): Services with an active warning (an unexplained code, a password reset, or a security notice). Older deployments omit it.
  - `signInsPending` (integer, optional): Sign-ins an agent asked for that wait for the owner to allow them. Omitted by older deployments and where Sign in with Doorman is not switched on.
- `security` (object, optional): Risk assessment counts (ADR-019). Older deployments omit it.
  - `held` (integer): Messages held for review across live inboxes.
  - `flaggedLast7Days` (integer): Inbound messages of the last 7 days assessed high or critical.
  - `heldSends` (integer, optional): Sends that wait for the owner's word across live inboxes. Older deployments omit it.
  - `scanning` (integer, optional): Messages that arrived and wait out of sight for the check of their files and links to finish, across live inboxes. They are in no list until it does. Older deployments omit it.

Example:
```json
{
  "inboxes": {
    "active": 1,
    "limit": 1
  },
  "keys": {
    "account": 2,
    "inbox": 1
  },
  "mail": {
    "receivedLast7Days": 1204,
    "sentLast7Days": 312,
    "unreadThreads": 3,
    "lastReceivedAt": "2026-11-05T10:05:00.000Z",
    "lastSentAt": "2026-11-05T10:05:00.000Z"
  },
  "webhooks": {
    "inboxWebhooks": 1,
    "endpoints": 2,
    "deliveredLast24Hours": 118,
    "failedLast24Hours": 2
  },
  "checklist": {
    "createdInbox": true,
    "createdKey": true,
    "receivedMessage": true,
    "connectedWebhook": true,
    "sentMessage": false
  },
  "services": {
    "total": 7,
    "pending": 1,
    "paid": 2
  }
}
```

## MetricsCounters

Mail and webhook counts.

**Fields: MetricsCounters**
- `received` (integer)
- `sent` (integer)
- `webhookDelivered` (integer)
- `webhookFailed` (integer)

Example:
```json
{
  "received": 140,
  "sent": 38,
  "webhookDelivered": 139,
  "webhookFailed": 1
}
```

## MetricsBucket

One UTC bucket of the series.

**Fields: MetricsBucket**
- `received` (integer)
- `sent` (integer)
- `webhookDelivered` (integer)
- `webhookFailed` (integer)
- `at` (string (date-time)): The bucket's start. Example: `2026-11-05T10:05:00.000Z`

Example:
```json
{
  "at": "2026-10-30T00:00:00.000Z",
  "received": 140,
  "sent": 38,
  "webhookDelivered": 139,
  "webhookFailed": 1
}
```

## Metrics

Counts per UTC hour or day over a range, with message categories and verdicts over inbound mail.

**Fields: Metrics**
- `from` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `to` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `interval` ("hour" | "day")
- `inboxId` (string | null): The inbox the counts are limited to; null for the whole account.
- `series` (MetricsBucket[]): One entry per bucket covering [from, to), zeros included.
- `totals` (MetricsCounters)
- `categories` (object): Inbound messages by category over the range.
  - `personal` (integer)
  - `automated` (integer)
  - `marketing` (integer)
  - `bounce` (integer)
  - `spam` (integer)
  - `malicious` (integer)
- `verdicts` (object): Inbound messages by verdict over the range.
  - `clean` (integer)
  - `unverified` (integer)
  - `suspicious` (integer)
- `risk` (object, optional): Assessed inbound messages by risk level over the range, held ones included. Older deployments omit it.
  - `low` (integer)
  - `medium` (integer)
  - `high` (integer)
  - `critical` (integer)
- `held` (integer, optional): Messages that were held over the range, whatever became of them. Older deployments omit it.

Example:
```json
{
  "from": "2026-10-30T00:00:00.000Z",
  "to": "2026-11-06T04:00:00.000Z",
  "interval": "day",
  "inboxId": null,
  "series": [
    {
      "at": "2026-10-30T00:00:00.000Z",
      "received": 140,
      "sent": 38,
      "webhookDelivered": 139,
      "webhookFailed": 1
    }
  ],
  "totals": {
    "received": 1204,
    "sent": 312,
    "webhookDelivered": 1192,
    "webhookFailed": 12
  },
  "categories": {
    "personal": 612,
    "automated": 341,
    "marketing": 188,
    "bounce": 19,
    "spam": 38,
    "malicious": 6
  },
  "verdicts": {
    "clean": 1071,
    "unverified": 112,
    "suspicious": 21
  }
}
```

## DomainRecord

A DNS record to publish, with the transport's verification state.

**Fields: DomainRecord**
- `record` ("MX" | "SPF" | "DKIM" | "DMARC")
- `host` (string)
- `type` (string)
- `value` (string)
- `priority` (integer | null)
- `ttl` (integer)
- `required` (boolean)
- `status` ("not_started" | "pending" | "verified" | "failed")

## Domain

An account's custom mail domain. Only verified domains can issue inboxes; one that never verifies is removed at `expiresAt`.

**Fields: Domain**
- `id` (string): A custom domain identifier. Example: `dom_01jc5f1a2b3c4d5e6f7g8h9j0k`
- `name` (string)
- `status` ("pending" | "verified" | "failed")
- `transport` ("resend")
- `records` (DomainRecord[])
- `connect` (object)
  - `available` (boolean)
  - `setupType` ("automatic" | "manual" | null)
  - `propagationStatus` ("pending" | "success" | "failed" | null)
  - `provider` (string | null)
- `inboxes` (integer)
- `verifiedAt` (string (date-time) | null)
- `expiresAt` (string (date-time) | null): When the domain is removed and its name freed, unless it verifies first. Null for a domain that has verified, which is never removed this way.
- `lastCheckedAt` (string (date-time) | null)
- `createdAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `updatedAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`

Example:
```json
{
  "id": "dom_01jc5f1a2b3c4d5e6f7g8h9j0k",
  "name": "agents.example.com",
  "status": "pending",
  "transport": "resend",
  "records": [],
  "connect": {
    "available": false,
    "setupType": null,
    "propagationStatus": null,
    "provider": null
  },
  "inboxes": 0,
  "verifiedAt": null,
  "expiresAt": "2026-11-12T10:05:00.000Z",
  "lastCheckedAt": null,
  "createdAt": "2026-11-05T10:05:00.000Z",
  "updatedAt": "2026-11-05T10:05:00.000Z"
}
```

## DomainList

The account's active custom domains.

**Fields: DomainList**
- `data` (Domain[])

## CreateDomain

A domain to connect. A subdomain avoids replacing an existing apex mailbox service.

**Fields: CreateDomain**
- `name` (string): Trimmed, lowercased and validated as a domain by the Worker. Example: `agents.example.com`

Example:
```json
{
  "name": "agents.example.com"
}
```

## DomainConnectSession

A short-lived DNS setup token and records, returned to the console only.

**Fields: DomainConnectSession**
- `applicationId` (string)
- `token` (string)
- `prefilledDomain` (string)
- `userId` (string)
- `dnsRecords` (object)
  - `domain` (object[], optional)
    - `type` (string)
    - `host` (string)
    - `value` (string)
    - `ttl` (integer)
    - `priority` (integer, optional)
    - `optional` (boolean, optional)
  - `subDomain` (object[], optional)
    - `type` (string)
    - `host` (string)
    - `value` (string)
    - `ttl` (integer)
    - `priority` (integer, optional)
    - `optional` (boolean, optional)

## Redaction

What the account's healthcare guardrails found in a message (ADR-027): the kinds of protected health information and personal data, and how many of each. Never the text itself. Detection is deterministic and is no guarantee that nothing else is there.

**Fields: Redaction**
- `applied` (boolean): True when the findings are replaced in this answer with placeholders such as `[REDACTED:SSN]`, as they are for every key, app, webhook and stream. False when the caller is a signed-in person who may read the original.
- `entities` (object[]): The kinds found, in the catalogue's order; empty when nothing was.
  - `type` ("ssn" | "medical_record_number" | "insurance_id" | "date_of_birth" | "phone" | "email" | "street_address" | "payment_card" | "bank_account" | "ip_address" | "national_id" | "drivers_license" | "passport" | "patient_name" | "custom"): A built-in kind, or `custom` for what a custom guardrail matched.
  - `count` (integer)

Example:
```json
{
  "applied": true,
  "entities": [
    {
      "type": "ssn",
      "count": 1
    },
    {
      "type": "date_of_birth",
      "count": 1
    }
  ]
}
```

## BaaAgreement

The record of a signed business associate agreement: which text, who signed for whom, and when. Records are kept after an agreement ends.

**Fields: BaaAgreement**
- `id` (string): The identifier of a signed business associate agreement. Example: `baa_01jc5f1a2b3c4d5e6f7g8h9j0k`
- `version` (string): The version of the text that was signed. Example: `2026-11-draft`
- `documentSha256` (string): The SHA-256 of the exact text the signer was shown, in hexadecimal.
- `signer` (object)
  - `userId` (string): The identity provider's user id of the person who signed.
  - `name` (string)
  - `title` (string)
  - `entity` (string): The legal entity the person signed for.
- `signedAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `terminatedAt` (string (date-time) | null): When a person ended the agreement; null while it stands.

Example:
```json
{
  "id": "baa_01jc5f1a2b3c4d5e6f7g8h9j0k",
  "version": "2026-11-draft",
  "documentSha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
  "signer": {
    "userId": "user_2abc",
    "name": "Dana Ortiz",
    "title": "Privacy Officer",
    "entity": "Acme Health, Inc."
  },
  "signedAt": "2026-11-05T10:05:00.000Z",
  "terminatedAt": null
}
```

## Baa

Where the account stands with the business associate agreement, and whether it may sign.

**Fields: Baa**
- `status` ("not_signed" | "active" | "reacceptance_required" | "terminated"): `not_signed`: nobody signed. `active`: the current text is signed. `reacceptance_required`: an earlier text is signed and the current one is not; guardrails keep applying. `terminated`: a person ended it, and guardrails no longer apply.
- `eligible` (boolean): Whether the account may sign and change guardrails now: an organization whose Teams subscription pays for it, or an account on the enterprise plan.
- `requirement` ("plan_required" | "not_signed" | "reacceptance_required" | null): What stands between the account and changing guardrails; null when nothing does.
- `inForce` (boolean): Whether guardrails apply to the account's mail now. They go on applying when the plan lapses, and stop only when a person ends the agreement.
- `version` (string): The version of the current text.
- `documentSha256` (string): The SHA-256 of the current text.
- `agreement` (BaaAgreement | null): The most recent record; null when nobody ever signed.

Example:
```json
{
  "status": "not_signed",
  "eligible": true,
  "requirement": "not_signed",
  "inForce": false,
  "version": "2026-11-draft",
  "documentSha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
  "agreement": null
}
```

## BaaDocument

The current text of the business associate agreement, exactly as a signer is shown it.

**Fields: BaaDocument**
- `version` (string)
- `sha256` (string): The SHA-256 of `text` as UTF-8. Signing names it, so what is signed is what was read.
- `title` (string)
- `text` (string): The agreement, as plain text.
- `placeholder` (boolean): True while the text is a draft that counsel has not approved. A deployment that serves a placeholder is not offering a binding agreement.

## SignBaa

A signature on the current text. `version` and `documentSha256` name what was read; `signature` is the signer's name typed again.

**Fields: SignBaa**
- `version` (string)
- `documentSha256` (string)
- `name` (string): The signer's full name.
- `title` (string): The signer's title at the entity.
- `entity` (string): The legal entity the signer signs for and has authority to bind.
- `signature` (string): The signer's name, typed as their signature. It must equal `name`.
- `accept` (true): The signer's statement that they read the text and may bind the entity.

Example:
```json
{
  "version": "2026-11-draft",
  "documentSha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
  "name": "Dana Ortiz",
  "title": "Privacy Officer",
  "entity": "Acme Health, Inc.",
  "signature": "Dana Ortiz",
  "accept": true
}
```

## TerminateBaa

Ends the agreement. From then on guardrails no longer apply and agents read mail as it arrived.

**Fields: TerminateBaa**
- `confirm` ("terminate"): The word `terminate`, so that nothing ends an agreement by accident.

Example:
```json
{
  "confirm": "terminate"
}
```

## GuardrailPolicy

The built-in healthcare guardrails: whether they apply, which kinds they look for, and what they do in each direction.

**Fields: GuardrailPolicy**
- `enabled` (boolean): Whether the guardrails apply at all. Off: nothing is detected, redacted, held or refused.
- `inbound` ("off" | "redact" | "hold"): What the built-in detectors do to mail that arrives. `redact`: each finding is replaced in everything a key, an app, a webhook, the stream or a model is given, and the original, its HTML and affected attachments are refused to them. `hold`: the message waits for the owner as held mail does. `off`: nothing.
- `outbound` ("off" | "hold" | "block"): What the built-in detectors do to a send by a key or an app. `block`: refused with 403 `risk_blocked` and the guard `guardrail`. `hold`: it waits for the owner as a held send. `off`: nothing. A person sending from the console is never refused.
- `entities` (object of boolean): Which kinds the detectors look for. Every kind is listed.

Example:
```json
{
  "enabled": true,
  "inbound": "redact",
  "outbound": "hold",
  "entities": {
    "ssn": true,
    "medical_record_number": true,
    "insurance_id": true,
    "date_of_birth": true,
    "phone": true,
    "email": true,
    "street_address": true,
    "payment_card": true,
    "bank_account": true,
    "ip_address": true,
    "national_id": true,
    "drivers_license": true,
    "passport": true,
    "patient_name": true
  }
}
```

## UpdateGuardrailPolicy

Changes to the guardrails. Fields left out stay as they are; `entities` changes the kinds it names and leaves the others. A change that takes protection away needs a console session unless the account allows its account keys to.

**Fields: UpdateGuardrailPolicy**
- `enabled` (boolean, optional): Whether the guardrails apply at all. Off: nothing is detected, redacted, held or refused.
- `inbound` ("off" | "redact" | "hold", optional): What the built-in detectors do to mail that arrives. `redact`: each finding is replaced in everything a key, an app, a webhook, the stream or a model is given, and the original, its HTML and affected attachments are refused to them. `hold`: the message waits for the owner as held mail does. `off`: nothing.
- `outbound` ("off" | "hold" | "block", optional): What the built-in detectors do to a send by a key or an app. `block`: refused with 403 `risk_blocked` and the guard `guardrail`. `hold`: it waits for the owner as a held send. `off`: nothing. A person sending from the console is never refused.
- `entities` (object of boolean, optional): The kinds to switch on or off.

Example:
```json
{
  "outbound": "block"
}
```

## GuardrailSettings

The guardrails as they apply to the account or to one inbox, and whether they are in force.

**Fields: GuardrailSettings**
- `scope` ("account" | "inbox")
- `inboxId` (string | null): The inbox the settings are for; null for the account's.
- `inherited` (boolean): Inbox scope: true while the inbox has no guardrails of its own and follows the account's. Always false for the account.
- `policy` (GuardrailPolicy)
- `inForce` (boolean): Whether these guardrails apply to mail now: the account has an agreement that stands, and `policy.enabled` is true.
- `baa` ("not_signed" | "active" | "reacceptance_required" | "terminated")
- `updatedAt` (string (date-time) | null): When the guardrails were last changed; null while they are the defaults.

## CreateGuardrailRule

A custom guardrail: a term or a pattern of your own, with what a match does in each direction, for the whole account or one inbox.

**Fields: CreateGuardrailRule**
- `name` (string): A label, at most 80 characters. It appears in the console and the audit log, so it should not itself be sensitive. Example: `Study participant ids`
- `kind` ("term" | "pattern"): `term`: a word or phrase, matched whole and without regard to case. `pattern`: a mask, where `#` is a digit, `@` a letter, `*` either, any other character itself, and `{n}` or `{n,m}` a count, as in `MRN-#{6,10}`. A pattern is not a regular expression.
- `value` (string): The term or the pattern. Example: `PT-#{6}`
- `inbound` ("off" | "redact" | "hold", optional): What a match does to mail that arrives. Defaults to `redact`.
- `outbound` ("off" | "hold" | "block", optional): What a match does to a send by a key or an app. Defaults to `off`.
- `enabled` (boolean, optional): Whether the guardrail applies. Defaults to true.
- `inboxId` (string, optional): Apply to this inbox only. Omit for every inbox of the account. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`

Example:
```json
{
  "name": "Study participant ids",
  "kind": "pattern",
  "value": "PT-#{6}",
  "inbound": "redact",
  "outbound": "block"
}
```

## UpdateGuardrailRule

Changes to a custom guardrail. What it matches cannot be changed: remove it and write another. Switching it off or lowering an action takes protection away and needs a console session unless the account allows its account keys to.

**Fields: UpdateGuardrailRule**
- `name` (string, optional): A label, at most 80 characters. It appears in the console and the audit log, so it should not itself be sensitive. Example: `Study participant ids`
- `inbound` ("off" | "redact" | "hold", optional): What a match does to mail that arrives. Defaults to `redact`.
- `outbound` ("off" | "hold" | "block", optional): What a match does to a send by a key or an app. Defaults to `off`.
- `enabled` (boolean, optional): Whether the guardrail applies. Defaults to true.

Example:
```json
{
  "outbound": "hold"
}
```

## GuardrailRule

A custom guardrail: what it matches, what a match does, and where it applies.

**Fields: GuardrailRule**
- `id` (string): A custom guardrail's identifier. Example: `grd_01jc5f1a2b3c4d5e6f7g8h9j0k`
- `name` (string)
- `kind` ("term" | "pattern")
- `value` (string | null): The term or the pattern, for a caller that may change guardrails: a signed-in person who holds `compliance:manage`, or an account key where the account lets its keys manage security. Null for every other caller: what a guardrail matches is what it keeps from agents, so a key an agent holds is not told it.
- `inbound` ("off" | "redact" | "hold")
- `outbound` ("off" | "hold" | "block")
- `enabled` (boolean)
- `inboxId` (string | null): The inbox the guardrail applies to; null for the whole account.
- `createdAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `updatedAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`

Example:
```json
{
  "id": "grd_01jc5f1a2b3c4d5e6f7g8h9j0k",
  "name": "Study participant ids",
  "kind": "pattern",
  "value": "PT-#{6}",
  "inbound": "redact",
  "outbound": "block",
  "enabled": true,
  "inboxId": null,
  "createdAt": "2026-11-05T10:05:00.000Z",
  "updatedAt": "2026-11-05T10:05:00.000Z"
}
```

## GuardrailRuleList

The account's custom guardrails, oldest first.

**Fields: GuardrailRuleList**
- `data` (GuardrailRule[])

## GuardrailPreviewRequest

Text to run the guardrails over. Nothing is stored or sent. Give `policy` or `rule` to try a change before making it.

**Fields: GuardrailPreviewRequest**
- `text` (string)
- `subject` (string, optional)
- `direction` ("inbound" | "outbound", optional): Whether the text is mail that arrives or a send by an agent. Defaults to `inbound`.
- `inboxId` (string, optional): Evaluate as this inbox: its guardrails and its custom guardrails. Defaults to the account's. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `policy` (UpdateGuardrailPolicy, optional): A draft, applied over the guardrails in force.
- `rule` (object, optional): A custom guardrail to try beside the ones that exist.
  - `kind` ("term" | "pattern"): `term`: a word or phrase, matched whole and without regard to case. `pattern`: a mask, where `#` is a digit, `@` a letter, `*` either, any other character itself, and `{n}` or `{n,m}` a count, as in `MRN-#{6,10}`. A pattern is not a regular expression.
  - `value` (string): The term or the pattern. Example: `PT-#{6}`
  - `inbound` ("off" | "redact" | "hold", optional): What a match does to mail that arrives. Defaults to `redact`.
  - `outbound` ("off" | "hold" | "block", optional): What a match does to a send by a key or an app. Defaults to `off`.

Example:
```json
{
  "text": "Patient: Sam Rivera, DOB 04/12/1984, SSN 536-22-8726."
}
```

## GuardrailPreview

What the guardrails do with the text: what an agent would be given, what was found, and what would happen to the message. The preview applies the guardrails as if an agreement were in force, whatever the account's standing.

**Fields: GuardrailPreview**
- `text` (string): The text with every finding replaced.
- `subject` (string | null): The subject with every finding replaced; null when none was given.
- `redaction` (Redaction)
- `action` ("none" | "redact" | "hold" | "block"): The strictest thing a match asks for in this direction: `none` when nothing matched or everything that matched is off.

Example:
```json
{
  "text": "Patient: [REDACTED:PATIENT_NAME], DOB [REDACTED:DATE_OF_BIRTH], SSN [REDACTED:SSN].",
  "subject": null,
  "redaction": {
    "applied": true,
    "entities": [
      {
        "type": "ssn",
        "count": 1
      },
      {
        "type": "date_of_birth",
        "count": 1
      },
      {
        "type": "patient_name",
        "count": 1
      }
    ]
  },
  "action": "redact"
}
```

## RiskAssessment

What Doorman concluded about an inbound message before any agent saw it (ADR-018). It is Doorman's own judgment, never text from the message: an agent can rely on it where it cannot rely on the mail.

**Fields: RiskAssessment**
- `score` (integer): 0 is no sign of danger, 100 is as certain as it gets.
- `level` ("low" | "medium" | "high" | "critical"): The score as a level: low from 0, medium from 30, high from 60, critical from 85. The floors are the same for every account.
- `labels` (("prompt_injection" | "phishing" | "scam" | "impersonation" | "spam" | "malware")[]): What kind of danger was found; empty when none was.
- `reasons` (string[]): Stable reason codes, strongest first. The catalogue, with a sentence for each, is `RISK_REASONS` in the contract package and `x-doorman-risk-reasons` in the OpenAPI document. New codes are additive. Example: `["hidden_text","instruction_override"]`
- `sender` (object)
  - `standing` ("trusted" | "known" | "new" | "blocked"): How well the inbox knew the sender when the message arrived: `trusted` or `blocked` by the owner's rule, `known` when earned, `new` otherwise.
  - `authenticated` (boolean): Whether the message passed DMARC for the domain in its From address. Standing only counts for a message that did.
- `action` ("delivered" | "warned" | "held" | "released"): What was done with the message: `delivered`; `warned` (delivered with this record as a warning, never answered automatically); `held` (kept from agents until the owner releases or discards it); `released` (held, then released by the owner).
- `analysis` ("full" | "signals"): `full` when a model read the content as well; `signals` when only the deterministic signals ran.
- `review` ("safe" | "unsafe" | null): What the owner said about the message afterwards, or null. A message marked `safe` no longer blocks replies.

Example:
```json
{
  "score": 6,
  "level": "low",
  "labels": [],
  "reasons": [],
  "sender": {
    "standing": "known",
    "authenticated": true
  },
  "action": "delivered",
  "analysis": "full",
  "review": null
}
```

## AttachmentScan

What Doorman read from an attachment's bytes, whatever the file is called (ADR-021). It is a check of structure, not a guarantee: a file marked `clean` showed nothing known to be dangerous.

**Fields: AttachmentScan**
- `status` ("clean" | "suspicious" | "malicious" | "unscanned"): `clean`: nothing was found. `suspicious`: the file carries something that can act, such as macros or script. `malicious`: it is a program dressed as another kind of file, or an archive built to exhaust whoever unpacks it; keys and app tokens cannot download it. `unscanned`: it is locked or damaged and could not be read.
- `sha256` (string): The SHA-256 of the bytes, in hexadecimal.
- `detectedType` (string | null): The kind of file the bytes are, for example `pdf`, `zip` or `executable`; null when they match no known format. Example: `pdf`
- `findings` (string[]): Reason codes from `RISK_REASONS` for what was found; empty for a clean file. Example: `["macro_document"]`

Example:
```json
{
  "status": "clean",
  "sha256": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
  "detectedType": "pdf",
  "findings": []
}
```

## Attachment

A file that arrived with a message, stored durably and read into text when possible.

**Fields: Attachment**
- `filename` (string): Unique within the message; the download route uses it. Example: `invoice.pdf`
- `contentType` (string) Example: `application/pdf`
- `sizeBytes` (integer) Example: `45000`
- `url` (string): Where to download the bytes, with the same credential as the API. Example: `https://api.doorman.example/v1/attachments/msg_01jc5a6g7h8j9k0m1n2p3q4r5s/invoice.pdf`
- `parsedText` (string, optional): The extracted text, present when extraction produced any.
- `extractionMethod` ("text" | "csv" | "pdf" | "ocr" | "office" | "unsupported" | "skipped" | "skipped_too_large" | "unavailable" | "timeout" | "pdf_error" | "ocr_error" | "office_error" | "html_error"): How the text was obtained (text, csv, pdf, ocr, office), or why it was not.
- `scan` (AttachmentScan, optional): The check of the file's bytes. Absent for mail stored before the check existed and where the deployment does not assess mail. The text of a `malicious` file is never included.

Example:
```json
{
  "filename": "invoice.pdf",
  "contentType": "application/pdf",
  "sizeBytes": 45000,
  "url": "https://api.doorman.example/v1/attachments/msg_01jc5a6g7h8j9k0m1n2p3q4r5s/invoice.pdf",
  "parsedText": "Invoice 2847. Line 3: Setup fee, billed twice. Total 1,480.",
  "extractionMethod": "pdf"
}
```

## AttachmentText

The extracted text of an attachment and how it was obtained.

**Fields: AttachmentText**
- `filename` (string)
- `contentType` (string)
- `extractionMethod` ("text" | "csv" | "pdf" | "ocr" | "office" | "unsupported" | "skipped" | "skipped_too_large" | "unavailable" | "timeout" | "pdf_error" | "ocr_error" | "office_error" | "html_error")
- `text` (string | null): The text, or null when nothing was extracted; `extractionMethod` says why.

Example:
```json
{
  "filename": "invoice.pdf",
  "contentType": "application/pdf",
  "extractionMethod": "pdf",
  "text": "Invoice 2847. Total 1,480."
}
```

## NamedAddress

An address with the display name its header carried.

**Fields: NamedAddress**
- `address` (string) Example: `sam@example.com`
- `name` (string | null) Example: `Sam Rivera`

Example:
```json
{
  "address": "sam@example.com",
  "name": "Sam Rivera"
}
```

## AuthenticationResults

The first Authentication-Results header, read only when the mail platform wrote it.

**Fields: AuthenticationResults**
- `spf` (string | null)
- `dkim` (string | null)
- `dmarc` (string | null)

Example:
```json
{
  "spf": "pass",
  "dkim": "pass",
  "dmarc": "pass"
}
```

## MessageService

The outside service a message came from: set when its sender was authenticated (DMARC passed) and the message concerns an account there, or comes from a service the inbox already has.

**Fields: MessageService**
- `id` (string | null): The service in the inbox's passport; null when none was recorded, because the inbox holds as many as it may.
- `domain` (string): The sender's registrable domain, which identifies the service. Example: `example.net`
- `signal` ("verification" | "welcome" | "receipt" | "password_reset" | "security" | "trial" | "cancellation" | "other"): What the message says about the account: a verification code or link, a welcome, a receipt, a password reset, a security notice, a trial, a cancellation, or other mail.

Example:
```json
{
  "id": "svc_01jc5g2b3c4d5e6f7g8h9j0k1m",
  "domain": "example.net",
  "signal": "verification"
}
```

## Message

One message, inbound or outbound, with its text, headers, classification and attachments.

**Fields: Message**
- `id` (string): A message identifier. Example: `msg_01jc5a6g7h8j9k0m1n2p3q4r5s`
- `inboxId` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `threadId` (string): A thread identifier. Example: `thr_01jc5a1b2c3d4e5f6g7h8j9k0m`
- `direction` ("inbound" | "outbound")
- `rfcMessageId` (string | null): The Message-ID header of inbound mail; null for mail this API sent. Example: `<a1b2c3@example.com>`
- `inReplyTo` (string | null): The In-Reply-To header, when the message is a reply.
- `references` (string[]): The References chain, oldest first.
- `from` (NamedAddress)
- `to` (NamedAddress[])
- `cc` (NamedAddress[])
- `bcc` (NamedAddress[]): Only outbound mail carries blind copies.
- `replyTo` (string | null): The Reply-To address, when one was given.
- `deliveryRole` ("to" | "cc" | "bcc" | null): How the inbox received the message: as a to, cc or bcc recipient. Null for outbound mail.
- `subject` (string) Example: `Invoice 2847`
- `text` (string | null): The plain-text body, or text derived from the HTML when there was none.
- `hasHtml` (boolean): Whether an HTML body is stored; read it at /v1/messages/{messageId}/html.
- `rawUrl` (string | null): Where to download the original message/rfc822; null for outbound mail.
- `sizeBytes` (integer)
- `category` ("personal" | "automated" | "marketing" | "bounce" | "spam" | "malicious"): What kind of mail this is; ordinary outbound mail is personal and rule-generated mail is automated.
- `autoReplyable` (boolean): False for anything an agent should not answer on its own.
- `verdict` ("clean" | "unverified" | "suspicious" | null): From the authentication results; null for outbound mail.
- `spamScore` (number | null): How likely the message is junk, from 0 to 1, when it was assessed; null otherwise.
- `authentication` (AuthenticationResults | null)
- `service` (MessageService | null, optional): The outside service the message came from, for the inbox's passport; null for any other mail and for outbound mail. Older deployments omit it.
- `risk` (RiskAssessment | null, optional): Doorman's assessment of an inbound message (ADR-019). Null for outbound mail and for mail that was not assessed. Older deployments omit it.
- `redaction` (Redaction, optional): What the account's healthcare guardrails found in the message (ADR-027), and whether `subject`, `text` and the attachments' `parsedText` carry placeholders in place of it. Absent where no guardrail applies.
- `occurredAt` (string (date-time)): When the message arrived or was sent. Example: `2026-11-05T10:05:00.000Z`
- `attachments` (Attachment[])

Example:
```json
{
  "id": "msg_01jc5a6g7h8j9k0m1n2p3q4r5s",
  "inboxId": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "threadId": "thr_01jc5a1b2c3d4e5f6g7h8j9k0m",
  "direction": "inbound",
  "rfcMessageId": "<a1b2c3@example.com>",
  "inReplyTo": null,
  "references": [],
  "from": {
    "address": "sam@example.com",
    "name": "Sam Rivera"
  },
  "to": [
    {
      "address": "concierge@doorman.example",
      "name": null
    }
  ],
  "cc": [],
  "bcc": [],
  "replyTo": null,
  "deliveryRole": "to",
  "subject": "Invoice 2847",
  "text": "Hi, invoice 2847 is attached.",
  "hasHtml": true,
  "rawUrl": "https://api.doorman.example/v1/messages/msg_01jc5a6g7h8j9k0m1n2p3q4r5s/raw",
  "sizeBytes": 48120,
  "category": "personal",
  "autoReplyable": true,
  "verdict": "clean",
  "spamScore": 0.02,
  "authentication": {
    "spf": "pass",
    "dkim": "pass",
    "dmarc": "pass"
  },
  "risk": {
    "score": 6,
    "level": "low",
    "labels": [],
    "reasons": [],
    "sender": {
      "standing": "known",
      "authenticated": true
    },
    "action": "delivered",
    "analysis": "full",
    "review": null
  },
  "occurredAt": "2026-11-05T10:05:00.000Z",
  "attachments": [
    {
      "filename": "invoice.pdf",
      "contentType": "application/pdf",
      "sizeBytes": 45000,
      "url": "https://api.doorman.example/v1/attachments/msg_01jc5a6g7h8j9k0m1n2p3q4r5s/invoice.pdf",
      "parsedText": "Invoice 2847. Line 3: Setup fee, billed twice. Total 1,480.",
      "extractionMethod": "pdf"
    }
  ]
}
```

## SentMessage

The stored outbound message, with the identifier the sending provider assigned.

**Fields: SentMessage**
- `id` (string): A message identifier. Example: `msg_01jc5a6g7h8j9k0m1n2p3q4r5s`
- `inboxId` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `threadId` (string): A thread identifier. Example: `thr_01jc5a1b2c3d4e5f6g7h8j9k0m`
- `direction` ("inbound" | "outbound")
- `rfcMessageId` (string | null): The Message-ID header of inbound mail; null for mail this API sent. Example: `<a1b2c3@example.com>`
- `inReplyTo` (string | null): The In-Reply-To header, when the message is a reply.
- `references` (string[]): The References chain, oldest first.
- `from` (NamedAddress)
- `to` (NamedAddress[])
- `cc` (NamedAddress[])
- `bcc` (NamedAddress[]): Only outbound mail carries blind copies.
- `replyTo` (string | null): The Reply-To address, when one was given.
- `deliveryRole` ("to" | "cc" | "bcc" | null): How the inbox received the message: as a to, cc or bcc recipient. Null for outbound mail.
- `subject` (string) Example: `Invoice 2847`
- `text` (string | null): The plain-text body, or text derived from the HTML when there was none.
- `hasHtml` (boolean): Whether an HTML body is stored; read it at /v1/messages/{messageId}/html.
- `rawUrl` (string | null): Where to download the original message/rfc822; null for outbound mail.
- `sizeBytes` (integer)
- `category` ("personal" | "automated" | "marketing" | "bounce" | "spam" | "malicious"): What kind of mail this is; ordinary outbound mail is personal and rule-generated mail is automated.
- `autoReplyable` (boolean): False for anything an agent should not answer on its own.
- `verdict` ("clean" | "unverified" | "suspicious" | null): From the authentication results; null for outbound mail.
- `spamScore` (number | null): How likely the message is junk, from 0 to 1, when it was assessed; null otherwise.
- `authentication` (AuthenticationResults | null)
- `service` (MessageService | null, optional): The outside service the message came from, for the inbox's passport; null for any other mail and for outbound mail. Older deployments omit it.
- `risk` (RiskAssessment | null, optional): Doorman's assessment of an inbound message (ADR-019). Null for outbound mail and for mail that was not assessed. Older deployments omit it.
- `redaction` (Redaction, optional): What the account's healthcare guardrails found in the message (ADR-027), and whether `subject`, `text` and the attachments' `parsedText` carry placeholders in place of it. Absent where no guardrail applies.
- `occurredAt` (string (date-time)): When the message arrived or was sent. Example: `2026-11-05T10:05:00.000Z`
- `attachments` (Attachment[])
- `providerMessageId` (string | null): The provider's message identifier, used to thread replies to this message. Example: `<b2c3d4@doorman.example>`

Example:
```json
{
  "id": "msg_01jc5b7h8j9k0m1n2p3q4r5s6t",
  "inboxId": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "threadId": "thr_01jc5a1b2c3d4e5f6g7h8j9k0m",
  "direction": "outbound",
  "rfcMessageId": null,
  "inReplyTo": "<a1b2c3@example.com>",
  "references": [
    "<a1b2c3@example.com>"
  ],
  "from": {
    "address": "concierge@doorman.example",
    "name": "Acme concierge"
  },
  "to": [
    {
      "address": "sam@example.com",
      "name": null
    }
  ],
  "cc": [],
  "bcc": [],
  "replyTo": null,
  "deliveryRole": null,
  "subject": "Re: Invoice 2847",
  "text": "Thanks, confirming for Thursday.",
  "hasHtml": false,
  "rawUrl": null,
  "sizeBytes": 31,
  "category": "personal",
  "autoReplyable": false,
  "verdict": null,
  "spamScore": null,
  "authentication": null,
  "occurredAt": "2026-11-05T10:05:00.000Z",
  "attachments": [],
  "providerMessageId": "<b2c3d4@doorman.example>"
}
```

## MessageList

A page of an inbox's messages, newest first.

**Fields: MessageList**
- `data` (Message[])
- `limit` (integer): The page size that was applied.
- `offset` (integer): The offset that was applied.

## Thread

A conversation: the messages that reply to each other, or share a subject and a participant.

**Fields: Thread**
- `id` (string): A thread identifier. Example: `thr_01jc5a1b2c3d4e5f6g7h8j9k0m`
- `inboxId` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `subject` (string): The subject of the first message. Example: `Invoice 2847`
- `participants` (string[]): Every address seen in the thread other than the inbox's own, sorted. Example: `["sam@example.com"]`
- `messageCount` (integer)
- `isRead` (boolean): False until the thread is marked read or a reply is sent.
- `isSeen` (boolean, optional): Whether a person has looked at the thread in the console since mail last arrived in it. It is the console's own mark and says nothing about `isRead`, which is what an agent polls: a person looking at a thread does not mark it read. Older deployments omit it.
- `metadata` (Metadata, optional)
- `labels` (ThreadLabels, optional)
- `riskLevel` ("low" | "medium" | "high" | "critical" | null, optional): The highest risk level among the thread's inbound messages that the owner has not marked safe; null when none was assessed. Older deployments omit it.
- `firstMessageAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `lastMessageAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `lastMessageId` (string | null)
- `createdAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`

Example:
```json
{
  "id": "thr_01jc5a1b2c3d4e5f6g7h8j9k0m",
  "inboxId": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "subject": "Invoice 2847",
  "participants": [
    "sam@example.com"
  ],
  "messageCount": 1,
  "isRead": false,
  "metadata": {},
  "labels": [],
  "riskLevel": "low",
  "firstMessageAt": "2026-11-05T10:05:00.000Z",
  "lastMessageAt": "2026-11-05T10:05:00.000Z",
  "lastMessageId": "msg_01jc5a6g7h8j9k0m1n2p3q4r5s",
  "createdAt": "2026-11-05T10:05:00.000Z"
}
```

## ThreadPage

A page of an inbox's threads, newest activity first. Trashed threads are left out.

**Fields: ThreadPage**
- `data` (Thread[])
- `limit` (integer): The page size that was applied.
- `offset` (integer): The offset that was applied.
- `total` (integer): How many threads match, across every page.

## ThreadMessages

A thread with its messages in order.

**Fields: ThreadMessages**
- `thread` (Thread)
- `data` (Message[]): Oldest first, at most 500.

## UpdateThread

Changes to the thread's read state, metadata or labels. Omitted fields stay as they are; metadata and labels replace the entire value.

**Fields: UpdateThread**
- `isRead` (boolean, optional)
- `metadata` (Metadata, optional)
- `labels` (ThreadLabels, optional)

Example:
```json
{
  "isRead": true
}
```

## SetThreadSeen

Whether a person has looked at the thread: true once they opened it, false to show it as new again.

**Fields: SetThreadSeen**
- `seen` (boolean)

Example:
```json
{
  "seen": true
}
```

## SendAttachment

A file to attach, base64-encoded.

**Fields: SendAttachment**
- `filename` (string)
- `contentType` (string) Example: `application/pdf`
- `content` (string (base64)): Base64. The 25 MiB message limit is enforced after decoding.
- `disposition` ("attachment" | "inline", optional): Inline attachments are referenced from the HTML body by `contentId`.
- `contentId` (string, optional): The Content-ID an inline image is referenced by, as `cid:<contentId>`.

Example:
```json
{
  "filename": "report.pdf",
  "contentType": "application/pdf",
  "content": "JVBERi0xLjQK..."
}
```

## SendMessage

A message to send from an inbox: a new one with `to` and `subject`, or a reply with `threadId`.

**Fields: SendMessage**
- `to` (string | string[], optional): Recipients. Optional on a reply, where it defaults to the last inbound message's Reply-To or sender.
- `cc` (string | string[], optional)
- `bcc` (string | string[], optional)
- `replyTo` (string, optional): The address replies should go to instead of the inbox.
- `subject` (string, optional): Required on a new message. A reply defaults to `Re: <thread subject>`.
- `text` (string, optional): The plain-text body.
- `html` (string, optional): The HTML body. Text is derived from it when `text` is absent.
- `body` (string, optional): A convenience: treated as HTML when it looks like HTML, as text otherwise. Ignored when `text` or `html` is given.
- `threadId` (string, optional): A thread id (thr_...). Makes the message a reply in this thread: threading headers, the default subject and recipient, and the quoted previous message come from it. An unknown, foreign or trashed thread answers 404 `thread_not_found`. Example: `thr_01jc5a1b2c3d4e5f6g7h8j9k0m`
- `includeQuote` (boolean, optional): On a reply, quote the previous message under the text. Defaults to true.
- `attachments` (SendAttachment[], optional)

Example:
```json
{
  "to": "sam@example.com",
  "subject": "Thursday",
  "text": "Thursday works."
}
```

## SendMessageForm

The same send as multipart/form-data: the text fields by name, repeated `attachments` file fields, `includeQuote` as text (`false`, `0` or `no` turn the quote off).

**Fields: SendMessageForm**
- `to` (string, optional)
- `cc` (string, optional)
- `bcc` (string, optional)
- `replyTo` (string, optional)
- `subject` (string, optional)
- `text` (string, optional)
- `html` (string, optional)
- `body` (string, optional)
- `threadId` (string, optional)
- `includeQuote` (string, optional)
- `attachments` (binary[], optional)

## PushSubscription

One browser on one device that the owner switched notifications on for. The address notifications are sent to is never answered.

**Fields: PushSubscription**
- `id` (string): A push subscription's identifier. Example: `psh_01jc5f1a2b3c4d5e6f7g8h9j0k`
- `createdAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `lastDeliveredAt` (string (date-time) | null): When a push service last accepted a notification for it; null until the first.

Example:
```json
{
  "id": "psh_01jc5f1a2b3c4d5e6f7g8h9j0k",
  "createdAt": "2026-11-05T10:05:00.000Z",
  "lastDeliveredAt": null
}
```

## PushSettings

Whether this deployment can send notifications, the key a browser subscribes with, and the account's subscriptions, oldest first.

**Fields: PushSettings**
- `available` (boolean): Whether this deployment has notifications configured. Where it has not, there is no key and nothing can be subscribed.
- `publicKey` (string | null): The application server key a browser subscribes with: an uncompressed P-256 point in base64url. Null where notifications are not configured. Example: `BAa0PjquH4AsQaDVl7stumrfQkF25D5eq5cDI3vLILFFIArx2o3ucteiAy6y5sH5jGLSsn6xjD5aRv4LFNVU9TM`
- `subscriptions` (PushSubscription[]): At most 10.

Example:
```json
{
  "available": true,
  "publicKey": "BAa0PjquH4AsQaDVl7stumrfQkF25D5eq5cDI3vLILFFIArx2o3ucteiAy6y5sH5jGLSsn6xjD5aRv4LFNVU9TM",
  "subscriptions": [
    {
      "id": "psh_01jc5f1a2b3c4d5e6f7g8h9j0k",
      "createdAt": "2026-11-05T10:05:00.000Z",
      "lastDeliveredAt": null
    }
  ]
}
```

## CreatePushSubscription

The address a browser was given when the owner allowed notifications there.

**Fields: CreatePushSubscription**
- `endpoint` (string): The subscription's endpoint, as the browser gave it: an https address at a push service (fcm.googleapis.com, push.services.mozilla.com, push.apple.com, notify.windows.com, or a name under one of them). An address anywhere else is refused. Example: `https://fcm.googleapis.com/fcm/send/dQw4w9WgXcQ:APA91bHexample`

Example:
```json
{
  "endpoint": "https://fcm.googleapis.com/fcm/send/dQw4w9WgXcQ:APA91bHexample"
}
```

## SecurityPolicy

What happens to assessed mail and what an agent may send afterwards (ADR-018). Two thresholds on the risk score decide between delivering, warning and holding; a message from a blocked sender is refused whatever its score.

**Fields: SecurityPolicy**
- `level` ("relaxed" | "balanced" | "strict" | "custom"): The preset the policy equals (`relaxed`, `balanced`, `strict`), or `custom` when it matches none.
- `warnAt` (integer | null): Mail scoring at least this is delivered with a warning and is never answered automatically. Null means never. Example: `60`
- `holdAt` (integer | null): Mail scoring at least this is held for the owner and kept from agents. Null means never. Not below `warnAt`. Example: `85`
- `labels` (object of "warn" | "hold"): The least that happens to mail carrying a label, whatever its score: `warn` or `hold`. Replaced as a whole; {} clears it. Example: `{"prompt_injection":"hold"}`
- `holdUnauthenticatedNewSenders` (boolean): Hold mail from a sender the inbox has never dealt with when it does not authenticate as its domain.
- `modelAnalysis` (boolean): Let a model read the content of mail the signals leave undecided. The text goes to the deployment's AI gateway, is not kept and is never used for training. Off: assessments rest on the deterministic signals alone.
- `replyGuard` (boolean): Refuse an agent's reply into a thread that holds a flagged message: one this policy warns about or holds, by its score or a label, or one the owner marked unsafe (403 `risk_blocked`). A message stops counting once the owner marks it safe, or while its sender is trusted and it passed authentication. A console session is never refused.
- `recipients` ("any" | "known"): `known`: an agent may write only to senders the inbox trusts or knows, and to the account's own inboxes (403 `risk_blocked` otherwise). Having written to the inbox, or being named in a message, does not make a recipient known: answering a stranger takes a person, or trusting them first. `any`: no such limit. A console session is never refused.
- `sendApproval` ("off" | "apps" | "all"): Whose sends wait for the owner when a recipient is not one the inbox knows or trusts, nor one of the account's own inboxes. `apps`: a connected app's. `all`: an app's and an API key's. `off`: nobody's. A send that waits answers 202 with a held send, which the owner sends or discards; it expires unsent after 7 days. A console session is never held, and neither is mail an inbox rule generates. It applies whatever the deployment's `enforcement`, except `off`, where no record of senders is kept and nothing is held. No preset changes it. An account that never chose starts on `apps`.
- `allowKeyManagement` (boolean): Let account keys loosen protection (trust a sender, raise a threshold, release held mail, approve a held send). Off by default, and only a console session can switch it on. Account scope only.
- `deepScan` (boolean): Run every attachment, in both directions, through the deployment's malware engine. The bytes go to an isolated scanner that keeps nothing. Off: attachments are still checked by their structure. No effect where the deployment has no engine (`deepScanAvailable`).
- `linkSandbox` (boolean): Open the most suspect links of a message in an isolated browser before the message is delivered, to see where they lead. The site a link points at sees a visit. Links that verify an address, sign in, accept an invitation or unsubscribe are never opened, and neither are an authenticated sender's links to its own site. No effect where the deployment has no sandbox.
- `unscannable` ("deliver" | "warn" | "hold"): The least that happens to mail carrying something that could not be checked (a locked archive, or a scan that did not finish): `deliver`, `warn` or `hold`.

Example:
```json
{
  "level": "balanced",
  "warnAt": 60,
  "holdAt": 85,
  "holdUnauthenticatedNewSenders": false,
  "replyGuard": true,
  "recipients": "any",
  "unscannable": "warn",
  "labels": {},
  "modelAnalysis": true,
  "sendApproval": "apps",
  "allowKeyManagement": false,
  "deepScan": true,
  "linkSandbox": true
}
```

## UpdateSecurityPolicy

Changes to a policy. `level` applies a preset first; any other field given with it, or alone, then replaces that one value. Fields left out stay as they are. Loosening protection needs a console session unless the account allows its account keys to.

**Fields: UpdateSecurityPolicy**
- `level` ("relaxed" | "balanced" | "strict", optional): Apply this preset's thresholds and guards. It also clears the per-label rules, unless `labels` is given with it.
- `warnAt` (integer | null, optional): Mail scoring at least this is delivered with a warning and is never answered automatically. Null means never. Example: `60`
- `holdAt` (integer | null, optional): Mail scoring at least this is held for the owner and kept from agents. Null means never. Not below `warnAt`. Example: `85`
- `labels` (object of "warn" | "hold", optional): The least that happens to mail carrying a label, whatever its score: `warn` or `hold`. Replaced as a whole; {} clears it. Example: `{"prompt_injection":"hold"}`
- `holdUnauthenticatedNewSenders` (boolean, optional): Hold mail from a sender the inbox has never dealt with when it does not authenticate as its domain.
- `modelAnalysis` (boolean, optional): Let a model read the content of mail the signals leave undecided. The text goes to the deployment's AI gateway, is not kept and is never used for training. Off: assessments rest on the deterministic signals alone.
- `replyGuard` (boolean, optional): Refuse an agent's reply into a thread that holds a flagged message: one this policy warns about or holds, by its score or a label, or one the owner marked unsafe (403 `risk_blocked`). A message stops counting once the owner marks it safe, or while its sender is trusted and it passed authentication. A console session is never refused.
- `recipients` ("any" | "known", optional): `known`: an agent may write only to senders the inbox trusts or knows, and to the account's own inboxes (403 `risk_blocked` otherwise). Having written to the inbox, or being named in a message, does not make a recipient known: answering a stranger takes a person, or trusting them first. `any`: no such limit. A console session is never refused.
- `sendApproval` ("off" | "apps" | "all", optional): Whose sends wait for the owner when a recipient is not one the inbox knows or trusts, nor one of the account's own inboxes. `apps`: a connected app's. `all`: an app's and an API key's. `off`: nobody's. A send that waits answers 202 with a held send, which the owner sends or discards; it expires unsent after 7 days. A console session is never held, and neither is mail an inbox rule generates. It applies whatever the deployment's `enforcement`, except `off`, where no record of senders is kept and nothing is held. No preset changes it. An account that never chose starts on `apps`.
- `allowKeyManagement` (boolean, optional): Let account keys loosen protection (trust a sender, raise a threshold, release held mail, approve a held send). Off by default, and only a console session can switch it on. Account scope only.
- `deepScan` (boolean, optional): Run every attachment, in both directions, through the deployment's malware engine. The bytes go to an isolated scanner that keeps nothing. Off: attachments are still checked by their structure. No effect where the deployment has no engine (`deepScanAvailable`).
- `linkSandbox` (boolean, optional): Open the most suspect links of a message in an isolated browser before the message is delivered, to see where they lead. The site a link points at sees a visit. Links that verify an address, sign in, accept an invitation or unsubscribe are never opened, and neither are an authenticated sender's links to its own site. No effect where the deployment has no sandbox.
- `unscannable` ("deliver" | "warn" | "hold", optional): The least that happens to mail carrying something that could not be checked (a locked archive, or a scan that did not finish): `deliver`, `warn` or `hold`.

Example:
```json
{
  "level": "strict"
}
```

## SecuritySettings

A policy as it applies to the account or to one inbox, with what this deployment does with it.

**Fields: SecuritySettings**
- `scope` ("account" | "inbox")
- `inboxId` (string | null): The inbox the settings are for; null for the account's.
- `inherited` (boolean): Inbox scope: true while the inbox has no policy of its own and follows the account's. Always false for the account.
- `policy` (SecurityPolicy)
- `enforcement` ("off" | "observe" | "enforce"): What the deployment does: `enforce` applies the policy; `observe` assesses mail and records the result without warning, holding or blocking anything; `off` does not assess.
- `modelAnalysisAvailable` (boolean): Whether this deployment has a model to read content with. When false, `modelAnalysis` has no effect.
- `deepScanAvailable` (boolean, optional): Whether this deployment runs the malware engine and the link sandbox. When false, `deepScan` and `linkSandbox` have no effect. Older deployments omit it.
- `updatedAt` (string (date-time) | null): When the policy was last changed; null while it is the default.

Example:
```json
{
  "scope": "account",
  "inboxId": null,
  "inherited": false,
  "policy": {
    "level": "balanced",
    "warnAt": 60,
    "holdAt": 85,
    "holdUnauthenticatedNewSenders": false,
    "replyGuard": true,
    "recipients": "any",
    "unscannable": "warn",
    "labels": {},
    "modelAnalysis": true,
    "sendApproval": "apps",
    "allowKeyManagement": false,
    "deepScan": true,
    "linkSandbox": true
  },
  "enforcement": "enforce",
  "modelAnalysisAvailable": true,
  "deepScanAvailable": true,
  "updatedAt": null
}
```

## Sender

A sender as one inbox knows them: what arrived from the address, what the inbox sent it, and the standing that follows. The name is text the sender chose, not a verified identity.

**Fields: Sender**
- `address` (string) Example: `sam@example.com`
- `name` (string | null): The display name last seen on their mail. Example: `Sam Rivera`
- `standing` ("trusted" | "known" | "new" | "blocked"): The standing in force: the owner's rule when one matches, otherwise what the sender earned.
- `source` ("rule" | "learned"): `rule` when a sender rule for the address or its domain decides the standing; `learned` otherwise.
- `kind` ("person" | "automated" | "bulk"): What their mail has mostly been: from a person, automated, or bulk.
- `received` (integer): Messages received from the address.
- `authenticated` (integer): How many of them passed DMARC.
- `sent` (integer): Messages the inbox sent to the address. One is enough to make the sender known.
- `flagged` (integer): Messages from the address that were warned about, held or marked unsafe. Any flag keeps a sender from being known.
- `lastRiskLevel` ("low" | "medium" | "high" | "critical" | null)
- `firstSeenAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `lastSeenAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`

Example:
```json
{
  "address": "sam@example.com",
  "name": "Sam Rivera",
  "standing": "known",
  "source": "learned",
  "kind": "person",
  "received": 14,
  "authenticated": 14,
  "sent": 9,
  "flagged": 0,
  "lastRiskLevel": "low",
  "firstSeenAt": "2026-11-05T10:05:00.000Z",
  "lastSeenAt": "2026-11-05T10:05:00.000Z"
}
```

## SenderPage

A page of an inbox's senders, most recent first.

**Fields: SenderPage**
- `data` (Sender[])
- `limit` (integer): The page size that was applied.
- `offset` (integer): The offset that was applied.
- `total` (integer): How many senders match, across every page.

## CreateSenderRule

The owner's word on a sender: an address or a whole domain, trusted or blocked, for one inbox or the whole account. A rule for the same match in the same scope is replaced.

**Fields: CreateSenderRule**
- `match` (string): An address (`sam@example.com`) or a domain (`example.com`, which covers every address at it, not its subdomains). Example: `sam@example.com`
- `standing` ("trusted" | "blocked"): `trusted`: their authenticated mail is treated as low risk and replies to them are never guarded. `blocked`: their mail is refused. Trusting needs a console session unless the account allows its account keys to.
- `inboxId` (string, optional): Apply to this inbox only. Omit for every inbox of the account. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `note` (string, optional): A label for whoever reads the list later, at most 200 characters.

Example:
```json
{
  "match": "sam@example.com",
  "standing": "trusted"
}
```

## SenderRule

A sender rule: who it matches, what it says, and where it applies.

**Fields: SenderRule**
- `id` (string): A sender rule identifier. Example: `snr_01jc5f1a2b3c4d5e6f7g8h9j0k`
- `kind` ("address" | "domain")
- `match` (string) Example: `sam@example.com`
- `standing` ("trusted" | "blocked")
- `inboxId` (string | null): The inbox the rule applies to; null for the whole account.
- `note` (string | null)
- `createdAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `updatedAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`

Example:
```json
{
  "id": "snr_01jc5f1a2b3c4d5e6f7g8h9j0k",
  "kind": "address",
  "match": "sam@example.com",
  "standing": "trusted",
  "inboxId": null,
  "note": null,
  "createdAt": "2026-11-05T10:05:00.000Z",
  "updatedAt": "2026-11-05T10:05:00.000Z"
}
```

## SenderRulePage

A page of sender rules, newest first.

**Fields: SenderRulePage**
- `data` (SenderRule[])
- `limit` (integer): The page size that was applied.
- `offset` (integer): The offset that was applied.
- `total` (integer): How many rules match, across every page.

## HeldMessage

A message kept from agents until the owner decides. Keys and app tokens get this stub and nothing else of the message: who, when and why, never the subject, the body or an attachment.

**Fields: HeldMessage**
- `id` (string): A message identifier. Example: `msg_01jc5a6g7h8j9k0m1n2p3q4r5s`
- `inboxId` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `from` (string): The sender's address. Example: `billing@example.net`
- `subject` (string | null): The subject, for a caller that may review held mail (a console session, or an account key the account allows); null for every other caller.
- `attachments` (integer): How many attachments the message carries.
- `sizeBytes` (integer)
- `receivedAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `risk` (RiskAssessment)

Example:
```json
{
  "id": "msg_01jc5a6g7h8j9k0m1n2p3q4r5s",
  "inboxId": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "from": "billing@example.net",
  "subject": null,
  "attachments": 1,
  "sizeBytes": 48120,
  "receivedAt": "2026-11-05T10:05:00.000Z",
  "risk": {
    "score": 92,
    "level": "critical",
    "labels": [
      "prompt_injection",
      "impersonation"
    ],
    "reasons": [
      "hidden_text",
      "instruction_override",
      "dmarc_fail"
    ],
    "sender": {
      "standing": "new",
      "authenticated": false
    },
    "action": "held",
    "analysis": "full",
    "review": null
  }
}
```

## HeldMessagePage

A page of an inbox's held messages, newest first.

**Fields: HeldMessagePage**
- `data` (HeldMessage[])
- `limit` (integer): The page size that was applied.
- `offset` (integer): The offset that was applied.
- `total` (integer): How many messages are held, across every page.

## RiskFeedback

The owner's verdict on a delivered message. `safe` lifts the reply guard for it; `unsafe` flags the sender and stops automatic replies to it.

**Fields: RiskFeedback**
- `verdict` ("safe" | "unsafe")

Example:
```json
{
  "verdict": "safe"
}
```

## SecurityAuditEntry

One change to what protects the account: who made it, to what, and when. Entries carry no mail content.

**Fields: SecurityAuditEntry**
- `id` (string): A security audit entry identifier. Example: `sau_01jc5f1a2b3c4d5e6f7g8h9j0k`
- `action` ("policy_updated" | "inbox_policy_updated" | "inbox_policy_reset" | "sender_trusted" | "sender_blocked" | "sender_rule_removed" | "message_released" | "message_discarded" | "message_marked_safe" | "message_marked_unsafe" | "send_blocked" | "send_approved" | "send_discarded" | "sign_in_allowed" | "sign_in_blocked" | "baa_signed" | "baa_terminated" | "guardrails_updated" | "inbox_guardrails_updated" | "inbox_guardrails_reset" | "guardrail_created" | "guardrail_updated" | "guardrail_deleted" | "original_viewed")
- `actor` (object)
  - `kind` ("session" | "key"): A person in the console, or an API key.
  - `id` (string | null): The identity provider's user id, or the key's id.
- `inboxId` (string | null): The inbox the change was about; null for the account.
- `target` (string | null): The address, domain, message id or held send id the change was about.
- `detail` (string | null): What changed, in a few words: the fields of a policy, or the standing of a rule.
- `at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`

Example:
```json
{
  "id": "sau_01jc5f1a2b3c4d5e6f7g8h9j0k",
  "action": "sender_trusted",
  "actor": {
    "kind": "session",
    "id": "user_2abc"
  },
  "inboxId": null,
  "target": "sam@example.com",
  "detail": "trusted",
  "at": "2026-11-05T10:05:00.000Z"
}
```

## SecurityAuditPage

A page of the security audit log, newest first.

**Fields: SecurityAuditPage**
- `data` (SecurityAuditEntry[])
- `limit` (integer): The page size that was applied.
- `offset` (integer): The offset that was applied.
- `total` (integer)

## SecurityPreviewRequest

What to evaluate and under which policy. Give exactly one of `messageId` (a stored message, with the assessment it already has), `sample` (a built-in message) or `text`/`html` (your own). Nothing is stored or sent, and no model is called: a sample and your own message are judged by the deterministic signals.

**Fields: SecurityPreviewRequest**
- `inboxId` (string, optional): Evaluate as this inbox: its senders and, without `policy`, its policy. Defaults to the message's inbox, or to the account's policy with no sender history. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `messageId` (string, optional): A stored inbound message of the account that was assessed. A held one needs a caller that may review held mail. Example: `msg_01jc5a6g7h8j9k0m1n2p3q4r5s`
- `sample` ("ordinary" | "phishing" | "prompt_injection" | "impersonation", optional): A built-in message: ordinary mail, a phishing attempt, an injection hidden from the reader, or an impersonation.
- `from` (string, optional): The sender of your own message. Defaults to a sender the inbox has never seen. Example: `stranger@example.net`
- `authenticated` (boolean, optional): Whether your own message passed authentication for its sender's domain. Defaults to true, so the content decides; false shows what a forged sender looks like.
- `subject` (string, optional)
- `text` (string, optional): The plain-text body of your own message.
- `html` (string, optional): The HTML body of your own message.
- `policy` (UpdateSecurityPolicy, optional): A draft to evaluate under, applied over the policy in force. Omit to use the policy in force.

Example:
```json
{
  "sample": "prompt_injection",
  "policy": {
    "level": "strict"
  }
}
```

## SecurityPreview

What would happen to the message under the policy, and exactly what an agent reading the inbox would be given for it. The assessment's `action` is the one the policy leads to: what `enforce` would do, whatever the deployment's mode.

**Fields: SecurityPreview**
- `risk` (RiskAssessment)
- `refused` (boolean): True when the sender is blocked: the message would be refused and never stored, whatever `risk.action` says the policy would otherwise have done.
- `agentView` (string): The text an agent receives for the message: the fenced mail, the mail behind a warning, the stub of a held message, or nothing but a note for mail that is refused.
- `enforcement` ("off" | "observe" | "enforce"): The deployment's mode, so a caller can say whether this is what happens today.

Example:
```json
{
  "risk": {
    "score": 92,
    "level": "critical",
    "labels": [
      "prompt_injection"
    ],
    "reasons": [
      "hidden_text",
      "instruction_override"
    ],
    "sender": {
      "standing": "new",
      "authenticated": false
    },
    "action": "held",
    "analysis": "signals",
    "review": null
  },
  "refused": false,
  "agentView": "A message from stranger@example.net is held for review: critical risk (prompt_injection). Its content is not shown.",
  "enforcement": "enforce"
}
```

## HeldSend

A message that waits for the owner: one that was asked to be sent and that the security policy kept, or a draft written for the owner to send. Every caller that can read the inbox gets who it is to and where it stands; the subject and the text are added for a caller that may decide (a console session, or an account key the account allows).

**Fields: HeldSend**
- `id` (string): A held send's identifier. Example: `hsd_01jc5f1a2b3c4d5e6f7g8h9j0k`
- `inboxId` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `kind` ("held" | "draft"): Why it waits. `held`: the security policy kept a send for the owner. `draft`: an app or a key wrote it as a draft, and only the owner sends it.
- `status` ("held" | "sent" | "discarded" | "expired"): `held` while it waits. `sent` once the owner approved it and the mail went out. `discarded` when the owner said no. `expired` when nobody decided in time. Only a held send can be decided.
- `threadId` (string | null): The thread a reply was written into; null for a new message.
- `to` (string[]): Who it would go to: the recipients the request named, or on a reply that named none, the one the thread gives. Example: `["sam@example.com"]`
- `cc` (string[])
- `bcc` (string[])
- `unknownRecipients` (string[]): The recipients that made it wait: addresses the inbox neither knows nor trusts. Empty for a draft. Example: `["sam@example.com"]`
- `subject` (string | null): The subject as written, for a caller that may decide; null for every other caller, and on a reply that left it to the thread.
- `text` (string | null): The text as written (derived from the HTML when only HTML was given, and cut at 200,000 characters), for a caller that may decide; null for every other caller.
- `attachments` (integer): How many attachments it carries.
- `requestedBy` (object)
  - `kind` ("app" | "key"): A connected app, or an API key.
  - `name` (string | null): The app's or the key's name, when it has one. Example: `Support agent`
- `messageId` (string | null): The message it became once it was sent; null otherwise.
- `createdAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `expiresAt` (string (date-time)): When it expires unsent: 7 days after it was made, or 30 for a draft. Example: `2026-11-05T10:05:00.000Z`
- `decidedAt` (string (date-time) | null): When it was sent, discarded or expired; null while it waits.

Example:
```json
{
  "id": "hsd_01jc5f1a2b3c4d5e6f7g8h9j0k",
  "inboxId": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "kind": "held",
  "status": "held",
  "threadId": null,
  "to": [
    "sam@example.com"
  ],
  "cc": [],
  "bcc": [],
  "unknownRecipients": [
    "sam@example.com"
  ],
  "subject": null,
  "text": null,
  "attachments": 0,
  "requestedBy": {
    "kind": "app",
    "name": "Support agent"
  },
  "messageId": null,
  "createdAt": "2026-11-05T10:05:00.000Z",
  "expiresAt": "2026-11-12T10:05:00.000Z",
  "decidedAt": null
}
```

## HeldSendPage

A page of an inbox's held sends, newest first.

**Fields: HeldSendPage**
- `data` (HeldSend[])
- `limit` (integer): The page size that was applied.
- `offset` (integer): The offset that was applied.
- `total` (integer): How many match, across every page.

## SendOutcome

What a send answers: the stored message when it went out (201), or a held send when it waits for the owner (202). A held send has `status`; a sent message has `direction`. A message that waits has not been sent and must not be sent again: the owner decides.

**Fields: SendOutcome**
One of:

SentMessage: The stored outbound message, with the identifier the sending provider assigned.
- `id` (string): A message identifier. Example: `msg_01jc5a6g7h8j9k0m1n2p3q4r5s`
- `inboxId` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `threadId` (string): A thread identifier. Example: `thr_01jc5a1b2c3d4e5f6g7h8j9k0m`
- `direction` ("inbound" | "outbound")
- `rfcMessageId` (string | null): The Message-ID header of inbound mail; null for mail this API sent. Example: `<a1b2c3@example.com>`
- `inReplyTo` (string | null): The In-Reply-To header, when the message is a reply.
- `references` (string[]): The References chain, oldest first.
- `from` (NamedAddress)
- `to` (NamedAddress[])
- `cc` (NamedAddress[])
- `bcc` (NamedAddress[]): Only outbound mail carries blind copies.
- `replyTo` (string | null): The Reply-To address, when one was given.
- `deliveryRole` ("to" | "cc" | "bcc" | null): How the inbox received the message: as a to, cc or bcc recipient. Null for outbound mail.
- `subject` (string) Example: `Invoice 2847`
- `text` (string | null): The plain-text body, or text derived from the HTML when there was none.
- `hasHtml` (boolean): Whether an HTML body is stored; read it at /v1/messages/{messageId}/html.
- `rawUrl` (string | null): Where to download the original message/rfc822; null for outbound mail.
- `sizeBytes` (integer)
- `category` ("personal" | "automated" | "marketing" | "bounce" | "spam" | "malicious"): What kind of mail this is; ordinary outbound mail is personal and rule-generated mail is automated.
- `autoReplyable` (boolean): False for anything an agent should not answer on its own.
- `verdict` ("clean" | "unverified" | "suspicious" | null): From the authentication results; null for outbound mail.
- `spamScore` (number | null): How likely the message is junk, from 0 to 1, when it was assessed; null otherwise.
- `authentication` (AuthenticationResults | null)
- `service` (MessageService | null, optional): The outside service the message came from, for the inbox's passport; null for any other mail and for outbound mail. Older deployments omit it.
- `risk` (RiskAssessment | null, optional): Doorman's assessment of an inbound message (ADR-019). Null for outbound mail and for mail that was not assessed. Older deployments omit it.
- `redaction` (Redaction, optional): What the account's healthcare guardrails found in the message (ADR-027), and whether `subject`, `text` and the attachments' `parsedText` carry placeholders in place of it. Absent where no guardrail applies.
- `occurredAt` (string (date-time)): When the message arrived or was sent. Example: `2026-11-05T10:05:00.000Z`
- `attachments` (Attachment[])
- `providerMessageId` (string | null): The provider's message identifier, used to thread replies to this message. Example: `<b2c3d4@doorman.example>`

HeldSend: A message that waits for the owner: one that was asked to be sent and that the security policy kept, or a draft written for the owner to send. Every caller that can read the inbox gets who it is to and where it stands; the subject and the text are added for a caller that may decide (a console session, or an account key the account allows).
- `id` (string): A held send's identifier. Example: `hsd_01jc5f1a2b3c4d5e6f7g8h9j0k`
- `inboxId` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `kind` ("held" | "draft"): Why it waits. `held`: the security policy kept a send for the owner. `draft`: an app or a key wrote it as a draft, and only the owner sends it.
- `status` ("held" | "sent" | "discarded" | "expired"): `held` while it waits. `sent` once the owner approved it and the mail went out. `discarded` when the owner said no. `expired` when nobody decided in time. Only a held send can be decided.
- `threadId` (string | null): The thread a reply was written into; null for a new message.
- `to` (string[]): Who it would go to: the recipients the request named, or on a reply that named none, the one the thread gives. Example: `["sam@example.com"]`
- `cc` (string[])
- `bcc` (string[])
- `unknownRecipients` (string[]): The recipients that made it wait: addresses the inbox neither knows nor trusts. Empty for a draft. Example: `["sam@example.com"]`
- `subject` (string | null): The subject as written, for a caller that may decide; null for every other caller, and on a reply that left it to the thread.
- `text` (string | null): The text as written (derived from the HTML when only HTML was given, and cut at 200,000 characters), for a caller that may decide; null for every other caller.
- `attachments` (integer): How many attachments it carries.
- `requestedBy` (object)
  - `kind` ("app" | "key"): A connected app, or an API key.
  - `name` (string | null): The app's or the key's name, when it has one. Example: `Support agent`
- `messageId` (string | null): The message it became once it was sent; null otherwise.
- `createdAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `expiresAt` (string (date-time)): When it expires unsent: 7 days after it was made, or 30 for a draft. Example: `2026-11-05T10:05:00.000Z`
- `decidedAt` (string (date-time) | null): When it was sent, discarded or expired; null while it waits.

Example:
```json
{
  "id": "msg_01jc5b7h8j9k0m1n2p3q4r5s6t",
  "inboxId": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "threadId": "thr_01jc5a1b2c3d4e5f6g7h8j9k0m",
  "direction": "outbound",
  "rfcMessageId": null,
  "inReplyTo": "<a1b2c3@example.com>",
  "references": [
    "<a1b2c3@example.com>"
  ],
  "from": {
    "address": "concierge@doorman.example",
    "name": "Acme concierge"
  },
  "to": [
    {
      "address": "sam@example.com",
      "name": null
    }
  ],
  "cc": [],
  "bcc": [],
  "replyTo": null,
  "deliveryRole": null,
  "subject": "Re: Invoice 2847",
  "text": "Thanks, confirming for Thursday.",
  "hasHtml": false,
  "rawUrl": null,
  "sizeBytes": 31,
  "category": "personal",
  "autoReplyable": false,
  "verdict": null,
  "spamScore": null,
  "authentication": null,
  "occurredAt": "2026-11-05T10:05:00.000Z",
  "attachments": [],
  "providerMessageId": "<b2c3d4@doorman.example>"
}
```

## ServicePlan

What the service costs, as it was recorded. Every field may be null.

**Fields: ServicePlan**
- `name` (string | null): The plan's name. Example: `Team`
- `amount` (number | null): The price in the currency's main unit: 12.5 for 12.50. Example: `12`
- `currency` (string | null): An ISO 4217 code. Example: `USD`
- `interval` ("week" | "month" | "year" | null): How often the price is charged.
- `renewsOn` (string | null): The next renewal or charge, as a calendar day (YYYY-MM-DD).

Example:
```json
{
  "name": "Team",
  "amount": 12,
  "currency": "USD",
  "interval": "month",
  "renewsOn": "2026-12-01"
}
```

## ServicePlanInput

What the service costs. It replaces the recorded plan as a whole: a field left out is recorded as null.

**Fields: ServicePlanInput**
- `name` (string | null, optional)
- `amount` (number | null, optional): The price in the currency's main unit: 12.5 for 12.50.
- `currency` (string | null, optional) Example: `USD`
- `interval` ("week" | "month" | "year" | null, optional)
- `renewsOn` (string | null, optional): The next renewal or charge, as a calendar day (YYYY-MM-DD).

Example:
```json
{
  "name": "Team",
  "amount": 12,
  "currency": "USD",
  "interval": "month",
  "renewsOn": "2026-12-01"
}
```

## ServiceActorRef

Who signed up: an agent's installation or key, or the person in the console.

**Fields: ServiceActorRef**
- `kind` ("installation" | "key" | "person")
- `id` (string | null): The installation (`ins_`) or key (`key_`) identifier; null for a person.

Example:
```json
{
  "kind": "installation",
  "id": "ins_01jc5f1a2b3c4d5e6f7g8h9j0k"
}
```

## ServiceAttention

An active warning on a service: why it needs the owner's look and when that mail arrived. Cleared only by the owner.

**Fields: ServiceAttention**
- `reason` ("unexplained_code" | "password_reset" | "security"): `unexplained_code` when a verification code or sign-in link arrived with no recent agent declaration or read to account for it; `password_reset` or `security` when the service sent a reset or a security notice.
- `at` (string (date-time)): When the message that raised the warning arrived. Example: `2026-11-05T10:05:00.000Z`

Example:
```json
{
  "reason": "unexplained_code",
  "at": "2026-11-05T10:05:00.000Z"
}
```

## SignInClientSummary

A relying party as a person is shown it: the host it is identified by, whether it proved the host is its own, and the name it gives itself.

**Fields: SignInClientSummary**
- `id` (string): An identifier this API issued (`sic_`), or the URL of the identity document the relying party published.
- `name` (string): What the relying party calls itself. A label, not proof of who it is.
- `host` (string): The host the relying party is identified by. Example: `app.example.net`
- `verified` (boolean): Whether the relying party proved that the host is its own. One that has not can sign in only addresses of the account that registered it.

Example:
```json
{
  "id": "sic_01jc5f1a2b3c4d5e6f7g8h9j0k",
  "name": "Example Tools",
  "host": "app.example.net",
  "verified": true
}
```

## ServiceSignIn

How an address signs in to a service with Doorman: its connection to one relying party under the service's domain, what the owner decided about it, and how it has been used.

**Fields: ServiceSignIn**
- `id` (string): The identifier of one address's connection to one relying party. Example: `sig_01jc5f1a2b3c4d5e6f7g8h9j0k`
- `client` (SignInClientSummary)
- `state` ("pending" | "allowed" | "blocked"): `pending` while an agent asked to sign in and the owner has not answered, `allowed` once the owner (or the account's own setting) said yes, `blocked` once the owner stopped it.
- `shareOwner` (boolean): Whether the relying party is told who owns the agent, when it asks.
- `requestedAt` (string (date-time) | null): When an agent last asked to sign in while it was not allowed to; null otherwise.
- `decidedAt` (string (date-time) | null): When it was last allowed or blocked.
- `firstSignInAt` (string (date-time) | null)
- `lastSignInAt` (string (date-time) | null)
- `signInCount` (integer): Sign-ins completed.

Example:
```json
{
  "id": "sig_01jc5f1a2b3c4d5e6f7g8h9j0k",
  "client": {
    "id": "sic_01jc5f1a2b3c4d5e6f7g8h9j0k",
    "name": "Example Tools",
    "host": "app.example.net",
    "verified": true
  },
  "state": "allowed",
  "shareOwner": false,
  "requestedAt": null,
  "decidedAt": "2026-11-05T10:05:00.000Z",
  "firstSignInAt": "2026-11-05T10:05:00.000Z",
  "lastSignInAt": "2026-11-05T10:05:00.000Z",
  "signInCount": 4
}
```

## Service

An outside service an inbox's address is signed up for: found in mail the service sent, declared by an agent before it signed up, or added by a person.

**Fields: Service**
- `id` (string): A passport service identifier. Example: `svc_01jc5g2b3c4d5e6f7g8h9j0k1m`
- `inboxId` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `inboxAddress` (string): The address the service knows the agent by. Example: `concierge@doorman.example`
- `domain` (string): The service's registrable domain. This is what identifies it: when it was found in mail, the sender was authenticated for it. Example: `example.net`
- `name` (string): A label: the sender's display name when the service was found in mail, or the name an agent or a person gave it. It is a claim, not proof; the domain is what was checked. Example: `Example Tools`
- `status` ("pending" | "active" | "cancelled" | "archived"): `pending` until the sign-up is confirmed (a welcome or a receipt arrives, the agent reads its code, or a person says so), `active`, `cancelled`, or `archived` when a person set it aside as not a sign-up.
- `source` ("detected" | "declared" | "manual"): `detected` from mail, `declared` by an agent, or `manual` when a person added it.
- `acquiredBy` (ServiceActorRef | null): Who signed up: the agent that declared the service or first read one of its codes, or the person who added it. Null when it was only found in mail.
- `note` (string | null): A note a person or an agent left.
- `plan` (ServicePlan | null): What the service costs, when someone recorded it.
- `attention` (ServiceAttention | null): An unacknowledged warning on the service (an unexplained code or link, a password reset, or a security notice); null otherwise, and always null on archived services.
- `invitedAt` (string (date-time) | null): When the newest invitation from the service arrived: mail that asks the address to join, with a link that accepts. The invitation is open while the service is `pending`. Null when the service never sent one.
- `signIns` (ServiceSignIn[]): How the address signs in to the service with Doorman: one entry for each relying party under the service's domain. Empty when it gets in some other way, or where the deployment has not switched sign-in on.
- `lastSignal` ("verification" | "welcome" | "receipt" | "password_reset" | "security" | "trial" | "cancellation" | "other" | null): What the newest mail from the service was about.
- `lastSignalAt` (string (date-time) | null)
- `lastReceiptAt` (string (date-time) | null): When the newest receipt or invoice arrived: a sign that the service is paid.
- `lastSecurityAt` (string (date-time) | null): When the newest password reset or security notice arrived.
- `messageCount` (integer): Messages tied to the service.
- `firstSeenAt` (string (date-time) | null): When the first mail from the service arrived; null until one does.
- `lastSeenAt` (string (date-time) | null): When the newest mail from the service arrived.
- `createdAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `updatedAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`

Example:
```json
{
  "id": "svc_01jc5g2b3c4d5e6f7g8h9j0k1m",
  "inboxId": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "inboxAddress": "concierge@doorman.example",
  "domain": "example.net",
  "name": "Example Tools",
  "status": "active",
  "source": "declared",
  "acquiredBy": {
    "kind": "installation",
    "id": "ins_01jc5f1a2b3c4d5e6f7g8h9j0k"
  },
  "note": null,
  "plan": {
    "name": "Team",
    "amount": 12,
    "currency": "USD",
    "interval": "month",
    "renewsOn": "2026-12-01"
  },
  "attention": null,
  "invitedAt": null,
  "lastSignal": "receipt",
  "lastSignalAt": "2026-11-05T10:05:00.000Z",
  "lastReceiptAt": "2026-11-05T10:05:00.000Z",
  "lastSecurityAt": null,
  "messageCount": 3,
  "firstSeenAt": "2026-11-05T10:05:00.000Z",
  "lastSeenAt": "2026-11-05T10:05:00.000Z",
  "createdAt": "2026-11-05T10:05:00.000Z",
  "updatedAt": "2026-11-05T10:05:00.000Z",
  "signIns": []
}
```

## ServicePage

A page of services, newest activity first.

**Fields: ServicePage**
- `data` (Service[])
- `limit` (integer): The page size that was applied.
- `offset` (integer): The offset that was applied.
- `total` (integer): How many services match, across every page.

## ServiceEvidence

A message that tied the service to the address: what it was about and where to read it, never its text.

**Fields: ServiceEvidence**
- `messageId` (string): A message identifier. Example: `msg_01jc5a6g7h8j9k0m1n2p3q4r5s`
- `threadId` (string): A thread identifier. Example: `thr_01jc5a1b2c3d4e5f6g7h8j9k0m`
- `subject` (string) Example: `Your verification code`
- `signal` ("verification" | "welcome" | "receipt" | "password_reset" | "security" | "trial" | "cancellation" | "other")
- `occurredAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`

Example:
```json
{
  "messageId": "msg_01jc5a6g7h8j9k0m1n2p3q4r5s",
  "threadId": "thr_01jc5a1b2c3d4e5f6g7h8j9k0m",
  "subject": "Your verification code",
  "signal": "verification",
  "occurredAt": "2026-11-05T10:05:00.000Z"
}
```

## ServiceDetail

A service with the newest messages that tied it to the address.

**Fields: ServiceDetail**
- `id` (string): A passport service identifier. Example: `svc_01jc5g2b3c4d5e6f7g8h9j0k1m`
- `inboxId` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `inboxAddress` (string): The address the service knows the agent by. Example: `concierge@doorman.example`
- `domain` (string): The service's registrable domain. This is what identifies it: when it was found in mail, the sender was authenticated for it. Example: `example.net`
- `name` (string): A label: the sender's display name when the service was found in mail, or the name an agent or a person gave it. It is a claim, not proof; the domain is what was checked. Example: `Example Tools`
- `status` ("pending" | "active" | "cancelled" | "archived"): `pending` until the sign-up is confirmed (a welcome or a receipt arrives, the agent reads its code, or a person says so), `active`, `cancelled`, or `archived` when a person set it aside as not a sign-up.
- `source` ("detected" | "declared" | "manual"): `detected` from mail, `declared` by an agent, or `manual` when a person added it.
- `acquiredBy` (ServiceActorRef | null): Who signed up: the agent that declared the service or first read one of its codes, or the person who added it. Null when it was only found in mail.
- `note` (string | null): A note a person or an agent left.
- `plan` (ServicePlan | null): What the service costs, when someone recorded it.
- `attention` (ServiceAttention | null): An unacknowledged warning on the service (an unexplained code or link, a password reset, or a security notice); null otherwise, and always null on archived services.
- `invitedAt` (string (date-time) | null): When the newest invitation from the service arrived: mail that asks the address to join, with a link that accepts. The invitation is open while the service is `pending`. Null when the service never sent one.
- `signIns` (ServiceSignIn[]): How the address signs in to the service with Doorman: one entry for each relying party under the service's domain. Empty when it gets in some other way, or where the deployment has not switched sign-in on.
- `lastSignal` ("verification" | "welcome" | "receipt" | "password_reset" | "security" | "trial" | "cancellation" | "other" | null): What the newest mail from the service was about.
- `lastSignalAt` (string (date-time) | null)
- `lastReceiptAt` (string (date-time) | null): When the newest receipt or invoice arrived: a sign that the service is paid.
- `lastSecurityAt` (string (date-time) | null): When the newest password reset or security notice arrived.
- `messageCount` (integer): Messages tied to the service.
- `firstSeenAt` (string (date-time) | null): When the first mail from the service arrived; null until one does.
- `lastSeenAt` (string (date-time) | null): When the newest mail from the service arrived.
- `createdAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `updatedAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `evidence` (ServiceEvidence[]): Newest first, at most 20. Messages in trashed threads are left out.

Example:
```json
{
  "id": "svc_01jc5g2b3c4d5e6f7g8h9j0k1m",
  "inboxId": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "inboxAddress": "concierge@doorman.example",
  "domain": "example.net",
  "name": "Example Tools",
  "status": "active",
  "source": "declared",
  "acquiredBy": {
    "kind": "installation",
    "id": "ins_01jc5f1a2b3c4d5e6f7g8h9j0k"
  },
  "note": null,
  "plan": {
    "name": "Team",
    "amount": 12,
    "currency": "USD",
    "interval": "month",
    "renewsOn": "2026-12-01"
  },
  "attention": null,
  "invitedAt": null,
  "lastSignal": "receipt",
  "lastSignalAt": "2026-11-05T10:05:00.000Z",
  "lastReceiptAt": "2026-11-05T10:05:00.000Z",
  "lastSecurityAt": null,
  "messageCount": 3,
  "firstSeenAt": "2026-11-05T10:05:00.000Z",
  "lastSeenAt": "2026-11-05T10:05:00.000Z",
  "createdAt": "2026-11-05T10:05:00.000Z",
  "updatedAt": "2026-11-05T10:05:00.000Z",
  "signIns": [],
  "evidence": [
    {
      "messageId": "msg_01jc5a6g7h8j9k0m1n2p3q4r5s",
      "threadId": "thr_01jc5a1b2c3d4e5f6g7h8j9k0m",
      "subject": "Your receipt",
      "signal": "receipt",
      "occurredAt": "2026-11-05T10:05:00.000Z"
    }
  ]
}
```

## CreateService

A service the inbox's address is about to be signed up for, or already is. An agent declares one before it signs up, so the codes that arrive for it are attributed to the agent; a person adds one by hand. A domain the inbox already has answers with that service. What it costs is recorded afterwards, with an update.

**Fields: CreateService**
- `domain` (string): The service's domain, or a host under it: `app.example.net` is recorded as `example.net`. Example: `example.net`
- `name` (string, optional): A label, at most 100 characters. Defaults to the domain.
- `note` (string | null, optional): At most 500 characters: why the agent signed up, or the plan it chose and its price.

Example:
```json
{
  "domain": "example.net",
  "name": "Example Tools",
  "note": "Sign-up for the weekly report"
}
```

## UpdateService

Changes to a service. Fields left out stay as they are; null clears the note, the plan, or an active warning.

**Fields: UpdateService**
- `name` (string, optional)
- `status` ("pending" | "active" | "cancelled" | "archived", optional): `archived` sets the service aside as not a sign-up: mail from it no longer makes it pending again. It clears any active warning and stops every one of the service's `signIns`.
- `note` (string | null, optional)
- `plan` (ServicePlanInput | null, optional)
- `attention` (any, optional): Null clears an active `attention` warning once the owner has checked the account. Needs a console session unless the account allows its account keys to (403 `session_required`).
- `signIn` (object, optional): A decision about one of the service's `signIns`. Stopping one, and no longer sharing the owner, are open to any key that reaches the service. Allowing one, and sharing the owner, need a console session unless the account allows its account keys to (403 `session_required`).
  - `id` (string): The identifier of one address's connection to one relying party. Example: `sig_01jc5f1a2b3c4d5e6f7g8h9j0k`
  - `state` ("allowed" | "blocked", optional): `allowed` lets the address sign in to the relying party; `blocked` stops it and ends the links, codes and tokens it was given.
  - `shareOwner` (boolean, optional): Whether the relying party is told who owns the agent, when it asks.

Example:
```json
{
  "status": "cancelled"
}
```

## PassportSettings

How the account's passport alerts and briefs its owner, and what its agents may do alone when they sign in with Doorman.

**Fields: PassportSettings**
- `alertEmails` (boolean): Send an email to `alertEmail` when an authenticated service sends a password reset, a security notice, or a verification code or sign-in link that no recent agent action explains.
- `alertEmail` (string (email)): Where alert emails are sent: the account owner's address. Example: `sam@example.com`
- `emailAvailable` (boolean): Whether this deployment has email sending configured for owner alerts.
- `signInAvailable` (boolean): Whether this deployment has Sign in with Doorman switched on. Where it has not, the two settings below change nothing.
- `agentSignIn` (boolean): Whether an agent may sign in to a service the owner has not allowed yet. Off by default: the owner allows each service once for each address, and the agent signs in alone from then on.
- `shareOwner` (boolean): Whether a service an agent signed in to alone is told who owns the agent, when it asks. Off by default. A service the owner allowed is told what the owner chose then.
- `briefingEmails` (boolean): Whether a daily briefing is emailed to `alertEmail`: how many emails arrived and how many things wait for a decision, in counts only, with links to the console. No briefing is sent on a day with nothing to report.
- `briefingHour` (integer): The hour of the day, in `timeZone`, at which the briefing is sent.
- `timeZone` (string): The IANA time zone `briefingHour` is read in. Example: `America/Guayaquil`
- `updatedAt` (string (date-time) | null): When these settings were last changed; null while they are the default.

Example:
```json
{
  "alertEmails": false,
  "alertEmail": "dana@example.com",
  "emailAvailable": true,
  "signInAvailable": true,
  "agentSignIn": false,
  "shareOwner": false,
  "briefingEmails": false,
  "briefingHour": 8,
  "timeZone": "UTC",
  "updatedAt": null
}
```

## UpdatePassportSettings

Changes to the passport's settings. Fields left out stay as they are. Switching `alertEmails` or `briefingEmails` off, and switching `agentSignIn` or `shareOwner` on, need a console session unless the account allows its account keys to.

**Fields: UpdatePassportSettings**
- `alertEmails` (boolean, optional): Whether to email the account owner when a service receives an unexplained code or link, a password reset, or a security notice.
- `agentSignIn` (boolean, optional): Whether an agent may sign in to a service the owner has not allowed yet.
- `shareOwner` (boolean, optional): Whether a service an agent signed in to alone is told who owns the agent, when it asks.
- `briefingEmails` (boolean, optional): Whether to email the account owner a daily briefing in counts only. The first one covers what arrives from the moment it is switched on.
- `briefingHour` (integer, optional): The hour of the day, in `timeZone`, at which the briefing is sent.
- `timeZone` (string, optional): The IANA time zone `briefingHour` is read in. Example: `America/Guayaquil`

Example:
```json
{
  "alertEmails": true
}
```

## VerificationLink

A sign-in or confirmation link read from a message.

**Fields: VerificationLink**
- `url` (string) Example: `https://app.example.net/verify?token=...`
- `host` (string) Example: `app.example.net`
- `matchesSender` (boolean): True when the link's registrable domain is the authenticated sender's. Open any other link only when your user agrees.

Example:
```json
{
  "url": "https://app.example.net/verify?token=abc",
  "host": "app.example.net",
  "matchesSender": true
}
```

## Verification

A verification code or a sign-in link that arrived within the last hour, or an invitation's link from the last 14 days, read from the message by the inbox.

**Fields: Verification**
- `messageId` (string): A message identifier. Example: `msg_01jc5a6g7h8j9k0m1n2p3q4r5s`
- `threadId` (string): A thread identifier. Example: `thr_01jc5a1b2c3d4e5f6g7h8j9k0m`
- `inboxId` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `serviceId` (string | null): The service in the inbox's passport, when the sender was authenticated.
- `domain` (string | null): The sender's registrable domain when the sender was authenticated (DMARC passed); null otherwise. Example: `example.net`
- `from` (string): The sender's address. Example: `no-reply@example.net`
- `subject` (string) Example: `Your verification code`
- `signal` ("verification" | "welcome" | "receipt" | "password_reset" | "security" | "trial" | "cancellation" | "other"): What the message is for: `verification` for a sign-up or sign-in, `password_reset` for a reset someone asked for. A reset or a code nobody on your side asked for is a warning sign.
- `code` (string | null): The one-time code, or null when the message carried a link only. Example: `849204`
- `link` (VerificationLink | null)
- `verified` (boolean): Whether the sender was authenticated (DMARC passed). Treat an unverified code or link with suspicion.
- `unexplained` (boolean): True once an authenticated `verification` code or link has waited past the grace window without a recent agent declaration or read to account for it.
- `invitation` (boolean): True when the link accepts an invitation to join the service, which someone there sent to the address. Follow it only when your user asked you to join that service: an invitation that arrives on its own is not a reason to join. An invitation is never `unexplained`.
- `receivedAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `expiresAt` (string (date-time)): When this read stops serving it. The service's own expiry may be sooner. Example: `2026-11-05T10:05:00.000Z`
- `readAt` (string (date-time) | null): When a credential first read it here; null until then.

Example:
```json
{
  "messageId": "msg_01jc5a6g7h8j9k0m1n2p3q4r5s",
  "threadId": "thr_01jc5a1b2c3d4e5f6g7h8j9k0m",
  "inboxId": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "serviceId": "svc_01jc5g2b3c4d5e6f7g8h9j0k1m",
  "domain": "example.net",
  "from": "no-reply@example.net",
  "subject": "Your verification code",
  "signal": "verification",
  "code": "849204",
  "link": null,
  "verified": true,
  "unexplained": false,
  "invitation": false,
  "receivedAt": "2026-11-05T10:05:00.000Z",
  "expiresAt": "2026-11-05T11:05:00.000Z",
  "readAt": null
}
```

## VerificationList

The verification codes and sign-in links of the last hour and the invitations of the last 14 days, newest first.

**Fields: VerificationList**
- `data` (Verification[]): At most 20.

## StartSignIn

The service an agent wants to sign in to with the inbox's address: its domain, or the relying party's own id. One of the two.

**Fields: StartSignIn**
- `domain` (string, optional): The service's domain or host.
- `clientId` (string, optional): Or the relying party's id, when the service states one.

Example:
```json
{
  "domain": "app.example.net"
}
```

## SignInStart

What starting a sign-in answered. Only `ready` carries a link, and the link is a secret.

**Fields: SignInStart**
- `status` ("ready" | "approval_required" | "blocked" | "unsupported"): `ready`: open `url` in the browser that should hold the session at the service, before `expiresAt`. `approval_required`: the owner has to allow this service once, at `approvalUrl`; start again after they have. `blocked`: the owner stopped this address signing in there, and it is not to sign in there another way. `unsupported`: the service does not accept Sign in with Doorman, so sign up with its own form and the verification codes instead.
- `inboxId` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `serviceId` (string | null): The service in the inbox's passport, recorded when the sign-in started; null when `unsupported`.
- `client` (SignInClientSummary | null): The relying party the sign-in is for; null when `unsupported`.
- `url` (string | null): `ready` only: the single-use sign-in link. It signs this address in to this service, once. Open it in the browser that should hold the session, and never send it to anyone or write it anywhere.
- `approvalUrl` (string | null): `approval_required` only: where the owner allows the service. Tell your user; it needs their own session.
- `expiresAt` (string (date-time) | null): `ready` only: when the link stops working.

Example:
```json
{
  "status": "ready",
  "inboxId": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "serviceId": "svc_01jc5g2b3c4d5e6f7g8h9j0k1m",
  "client": {
    "id": "sic_01jc5f1a2b3c4d5e6f7g8h9j0k",
    "name": "Example Tools",
    "host": "app.example.net",
    "verified": true
  },
  "url": "https://doorman.example/passport/start?link=dsl_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
  "approvalUrl": null,
  "expiresAt": "2026-11-05T10:10:00.000Z"
}
```

## SignInApproval

A sign-in that waits for the owner's decision, bound to the console session that read it. Nothing is allowed automatically.

**Fields: SignInApproval**
- `requestId` (string): A waiting authorization request. Example: `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa`
- `client` (SignInClientSummary)
- `inboxId` (string | null): The address that would be signed in, when the request already says which: the browser opened a sign-in link for it, or the relying party named it. Null when the owner has to choose one.
- `inboxAddress` (string | null) Example: `concierge@doorman.example`
- `state` ("pending" | "allowed" | "blocked" | null): What was decided before about this address at this relying party; null when nothing was, or when no address is named yet.
- `shareOwner` (boolean): Whether this relying party is already told who owns the agent.
- `scopes` (("openid" | "email" | "profile" | "owner_profile" | "owner_email")[]): What the relying party asked to be told.
- `ownerRequested` (boolean): Whether it asked who owns the agent. The owner answers that separately, with `shareOwner`.
- `redirectHost` (string): Where the browser goes back to once the owner decides. Example: `app.example.net`
- `expiresAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `csrf` (string): Sent back with the decision. Each read replaces it. Example: `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa`

Example:
```json
{
  "requestId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "client": {
    "id": "sic_01jc5f1a2b3c4d5e6f7g8h9j0k",
    "name": "Example Tools",
    "host": "app.example.net",
    "verified": true
  },
  "inboxId": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "inboxAddress": "concierge@doorman.example",
  "state": null,
  "shareOwner": false,
  "scopes": [
    "openid",
    "email"
  ],
  "ownerRequested": false,
  "redirectHost": "app.example.net",
  "expiresAt": "2026-11-05T10:20:00.000Z",
  "csrf": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
}
```

## DecideSignIn

The owner's decision on one waiting sign-in. Allowing it allows the address at that relying party from then on, until the owner stops it.

**Fields: DecideSignIn**
- `decision` ("allow" | "deny")
- `inboxId` (string, optional): The address to sign in, when the request named none. Where it named one, leave it out or repeat it. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `shareOwner` (boolean, optional): Whether the relying party is told who owns the agent, when it asks. Left out, a new connection does not, and an existing one keeps its choice.
- `csrf` (string): A waiting authorization request. Example: `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa`

Example:
```json
{
  "decision": "allow",
  "shareOwner": false,
  "csrf": "bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb"
}
```

## SignInDecision

Where the browser goes next: back to the relying party, with a code or with `access_denied`.

**Fields: SignInDecision**
- `redirectUrl` (string)

Example:
```json
{
  "redirectUrl": "https://app.example.net/auth/callback?state=af0ifjsldkj&iss=https%3A%2F%2Fid.doorman.example&code=dsc_zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz"
}
```

## SignInLinkRequest

A sign-in link, as the web app's server presents it for the browser that opened it.

**Fields: SignInLinkRequest**
- `link` (string): The secret a sign-in link carries: single use, 5 minutes. Example: `dsl_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx`

Example:
```json
{
  "link": "dsl_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
}
```

## SignInLinkPreview

What a sign-in link is for, so the page can say it before anyone continues. It carries no secret.

**Fields: SignInLinkPreview**
- `inboxAddress` (string) Example: `concierge@doorman.example`
- `client` (SignInClientSummary)
- `expiresAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`

Example:
```json
{
  "inboxAddress": "concierge@doorman.example",
  "client": {
    "id": "sic_01jc5f1a2b3c4d5e6f7g8h9j0k",
    "name": "Example Tools",
    "host": "app.example.net",
    "verified": true
  },
  "expiresAt": "2026-11-05T10:10:00.000Z"
}
```

## SignInLinkOpened

The link is spent. The web app keeps `binding` in a short-lived cookie on its own origin and sends the browser to `startUrl`.

**Fields: SignInLinkOpened**
- `binding` (string): What ties one browser to the sign-in it opened. Example: `dsb_yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy`
- `bindingExpiresAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `startUrl` (string): Where the browser continues: the relying party's start URL with `iss` and `login_hint`, or its own front page when it registered none.

Example:
```json
{
  "binding": "dsb_yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy",
  "bindingExpiresAt": "2026-11-05T10:10:00.000Z",
  "startUrl": "https://app.example.net/auth/doorman?iss=https%3A%2F%2Fid.doorman.example&login_hint=concierge%40doorman.example"
}
```

## ResumeSignIn

A waiting authorization request, and the binding its browser holds when it opened a sign-in link.

**Fields: ResumeSignIn**
- `requestId` (string): A waiting authorization request. Example: `aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa`
- `binding` (string, optional): From the browser's cookie. Left out when the browser holds none. Example: `dsb_yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy`

Example:
```json
{
  "requestId": "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa",
  "binding": "dsb_yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy"
}
```

## SignInResumed

What became of a waiting authorization request: the browser goes back to the relying party, or the owner has to decide first.

**Fields: SignInResumed**
- `status` ("redirect" | "approval_required")
- `redirectUrl` (string | null): `redirect` only: back to the relying party, with a code or with an error.
- `approvalUrl` (string | null): `approval_required` only: where the owner decides, in the console.

Example:
```json
{
  "status": "redirect",
  "redirectUrl": "https://app.example.net/auth/callback?state=af0ifjsldkj&iss=https%3A%2F%2Fid.doorman.example&code=dsc_zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz",
  "approvalUrl": null
}
```

## CreateSignInClient

Register a relying party: a service that lets agents sign in with Doorman. It is identified by its host, and every URL it registers is on that host.

**Fields: CreateSignInClient**
- `name` (string): What the service calls itself. People are shown the host beside it.
- `host` (string): The host agents sign in at. A public name the service can prove is its own, or `localhost`, `127.0.0.1` or `[::1]` while developing: a relying party on your own machine signs in your own addresses only. Example: `app.example.net`
- `redirectUris` (string[])
- `startUrl` (string, optional): Where the service starts a Sign in with Doorman (OpenID Connect's `initiate_login_uri`). A sign-in link sends the browser there with `iss` and `login_hint`. Without one, the browser is sent to the service's front page.
- `tokenEndpointAuthMethod` ("client_secret_basic" | "client_secret_post" | "none", optional): Defaults to `client_secret_basic`. A relying party with a secret may present it either way. `none` registers a public one, which holds no secret and uses S256 PKCE.

Example:
```json
{
  "name": "Example Tools",
  "host": "app.example.net",
  "redirectUris": [
    "https://app.example.net/auth/callback"
  ],
  "startUrl": "https://app.example.net/auth/doorman"
}
```

## UpdateSignInClient

Replace the fields given. The host never changes: register another relying party for another host.

**Fields: UpdateSignInClient**
- `name` (string, optional)
- `redirectUris` (string[], optional): Every one on the relying party's host.
- `startUrl` (string | null, optional): On the relying party's host. Null removes it.

Example:
```json
{
  "name": "Example Tools Workspace"
}
```

## SignInClient

A relying party a developer registered, without its secret.

**Fields: SignInClient**
- `id` (string): A registered relying party's identifier. Example: `sic_01jc5f1a2b3c4d5e6f7g8h9j0k`
- `name` (string)
- `host` (string)
- `redirectUris` (string[])
- `startUrl` (string | null)
- `tokenEndpointAuthMethod` ("client_secret_basic" | "client_secret_post" | "none")
- `verified` (boolean): Whether the host proved it is the relying party's own. Until it does, only addresses of the account that registered it can sign in.
- `verifiedAt` (string (date-time) | null)
- `proof` (object | null): How the host proves it is the relying party's own; null for a host on the developer's own machine, which has nothing to prove.
  - `url` (string): Serve the file here, over HTTPS, without a redirect.
  - `body` (object): The file's JSON. Other fields beside these two are ignored.
    - `client_id` (string): A registered relying party's identifier. Example: `sic_01jc5f1a2b3c4d5e6f7g8h9j0k`
    - `proof` (string)
- `status` ("active" | "deleted")
- `createdAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `updatedAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`

Example:
```json
{
  "id": "sic_01jc5f1a2b3c4d5e6f7g8h9j0k",
  "name": "Example Tools",
  "host": "app.example.net",
  "redirectUris": [
    "https://app.example.net/auth/callback"
  ],
  "startUrl": "https://app.example.net/auth/doorman",
  "tokenEndpointAuthMethod": "client_secret_basic",
  "verified": false,
  "verifiedAt": null,
  "proof": {
    "url": "https://app.example.net/.well-known/doorman-sign-in.json",
    "body": {
      "client_id": "sic_01jc5f1a2b3c4d5e6f7g8h9j0k",
      "proof": "ccccccccccccccccccccccccccccccccccccccccccc"
    }
  },
  "status": "active",
  "createdAt": "2026-11-05T10:05:00.000Z",
  "updatedAt": "2026-11-05T10:05:00.000Z"
}
```

## CreatedSignInClient

A new relying party and, unless it is a public one, its secret, shown once.

**Fields: CreatedSignInClient**
- `id` (string): A registered relying party's identifier. Example: `sic_01jc5f1a2b3c4d5e6f7g8h9j0k`
- `name` (string)
- `host` (string)
- `redirectUris` (string[])
- `startUrl` (string | null)
- `tokenEndpointAuthMethod` ("client_secret_basic" | "client_secret_post" | "none")
- `verified` (boolean): Whether the host proved it is the relying party's own. Until it does, only addresses of the account that registered it can sign in.
- `verifiedAt` (string (date-time) | null)
- `proof` (object | null): How the host proves it is the relying party's own; null for a host on the developer's own machine, which has nothing to prove.
  - `url` (string): Serve the file here, over HTTPS, without a redirect.
  - `body` (object): The file's JSON. Other fields beside these two are ignored.
    - `client_id` (string): A registered relying party's identifier. Example: `sic_01jc5f1a2b3c4d5e6f7g8h9j0k`
    - `proof` (string)
- `status` ("active" | "deleted")
- `createdAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `updatedAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `clientSecret` (string | null)

## SignInClientList

The relying parties the account registered, oldest first.

**Fields: SignInClientList**
- `data` (SignInClient[])

## SignInClientSecret

A relying party's new secret, shown once. The one before it stops working at once.

**Fields: SignInClientSecret**
- `id` (string): A registered relying party's identifier. Example: `sic_01jc5f1a2b3c4d5e6f7g8h9j0k`
- `clientSecret` (string)

## SignInTokenRequest

A form-encoded code exchange. A relying party with a secret sends it with HTTP Basic or in the body; a public one sends the PKCE verifier. Other fields are ignored.

**Fields: SignInTokenRequest**
- `grant_type` ("authorization_code")
- `code` (string)
- `redirect_uri` (string)
- `client_id` (string, optional)
- `client_secret` (string, optional)
- `code_verifier` (string, optional)

Example:
```json
{
  "grant_type": "authorization_code",
  "code": "replace-with-the-code-from-the-callback",
  "redirect_uri": "https://app.example.net/auth/callback"
}
```

## SignInTokens

The id token, and an access token for the userinfo endpoint. There is no refresh token: a longer session is the relying party's own.

**Fields: SignInTokens**
- `access_token` (string)
- `token_type` ("Bearer")
- `expires_in` (integer)
- `id_token` (string): An ES256 JWT. Check its signature against the published keys, and its `iss`, `aud`, `exp` and `nonce`.
- `scope` (string): What was granted, which may be less than was asked: who owns the agent is told only where the owner allowed it.

## SignInUserInfo

The claims about the signed-in address, read again from live state on every call.

**Fields: SignInUserInfo**
- `sub` (string): The address's subject: the same at every relying party, and a new one if the address is ever given up and issued again. Example: `f0Jx2kQp9wLr7TzV3mYb8nHc5dGs1aKe4uWq6oPi0Ag`
- `actor_type` ("agent"): Always `agent`: the one signing in is software acting for its owner.
- `email` (string, optional): `email`: the address. Example: `concierge@doorman.example`
- `email_verified` (true, optional)
- `name` (string, optional): `profile`: the address's display name, when it has one.
- `owner_sub` (string, optional): `profile`: who owns the agent, as an identifier that is different at every relying party.
- `owner_name` (string, optional): `owner_profile`, where the owner allowed it: the owner's name.
- `owner_email` (string, optional): `owner_email`, where the owner allowed it: the owner's own address.
- `owner_email_verified` (true, optional)

Example:
```json
{
  "sub": "f0Jx2kQp9wLr7TzV3mYb8nHc5dGs1aKe4uWq6oPi0Ag",
  "actor_type": "agent",
  "email": "concierge@doorman.example",
  "email_verified": true
}
```

## SignInDiscovery

OpenID Connect discovery for Sign in with Doorman.

**Fields: SignInDiscovery**
- `issuer` (string)
- `authorization_endpoint` (string)
- `token_endpoint` (string)
- `userinfo_endpoint` (string)
- `jwks_uri` (string)
- `response_types_supported` ("code"[])
- `response_modes_supported` ("query"[])
- `grant_types_supported` ("authorization_code"[])
- `subject_types_supported` ("public"[])
- `id_token_signing_alg_values_supported` ("ES256"[])
- `scopes_supported` (("openid" | "email" | "profile" | "owner_profile" | "owner_email")[])
- `claims_supported` (("sub" | "actor_type" | "email" | "email_verified" | "name" | "owner_sub" | "owner_name" | "owner_email" | "owner_email_verified" | "iss" | "aud" | "iat" | "exp" | "auth_time" | "jti" | "nonce")[])
- `token_endpoint_auth_methods_supported` (("client_secret_basic" | "client_secret_post" | "none")[])
- `code_challenge_methods_supported` ("S256"[])
- `authorization_response_iss_parameter_supported` (true)
- `client_id_metadata_document_supported` (true)
- `request_parameter_supported` (false)
- `request_uri_parameter_supported` (false)
- `claims_parameter_supported` (false)

Example:
```json
{
  "issuer": "https://id.doorman.example",
  "authorization_endpoint": "https://id.doorman.example/sign-in/authorize",
  "token_endpoint": "https://id.doorman.example/sign-in/token",
  "userinfo_endpoint": "https://id.doorman.example/sign-in/userinfo",
  "jwks_uri": "https://id.doorman.example/sign-in/jwks.json",
  "response_types_supported": [
    "code"
  ],
  "response_modes_supported": [
    "query"
  ],
  "grant_types_supported": [
    "authorization_code"
  ],
  "subject_types_supported": [
    "public"
  ],
  "id_token_signing_alg_values_supported": [
    "ES256"
  ],
  "scopes_supported": [
    "openid",
    "email",
    "profile",
    "owner_profile",
    "owner_email"
  ],
  "claims_supported": [
    "sub",
    "actor_type",
    "email",
    "email_verified",
    "name",
    "owner_sub",
    "owner_name",
    "owner_email",
    "owner_email_verified",
    "iss",
    "aud",
    "iat",
    "exp",
    "auth_time",
    "jti",
    "nonce"
  ],
  "token_endpoint_auth_methods_supported": [
    "client_secret_basic",
    "client_secret_post",
    "none"
  ],
  "code_challenge_methods_supported": [
    "S256"
  ],
  "authorization_response_iss_parameter_supported": true,
  "client_id_metadata_document_supported": true,
  "request_parameter_supported": false,
  "request_uri_parameter_supported": false,
  "claims_parameter_supported": false
}
```

## SignInJwk

One public signing key: P-256, for ES256. Its `kid` is the key's RFC 7638 thumbprint.

**Fields: SignInJwk**
- `kty` ("EC")
- `crv` ("P-256")
- `x` (string)
- `y` (string)
- `kid` (string)
- `use` ("sig")
- `alg` ("ES256")

## SignInJwks

The provider's public signing keys. A key is published before it signs and stays published until every token it signed has expired.

**Fields: SignInJwks**
- `keys` (SignInJwk[])

## SignInProtocolError

A protocol error, distinct from the Inbox API's error envelope: the code, and a fixed sentence when one helps. The sentence is written by the provider and never carries text from the request.

**Fields: SignInProtocolError**
- `error` ("invalid_request" | "invalid_client" | "invalid_grant" | "invalid_scope" | "unauthorized_client" | "unsupported_grant_type" | "unsupported_response_type" | "access_denied" | "login_required" | "interaction_required" | "request_not_supported" | "request_uri_not_supported" | "registration_not_supported" | "invalid_token" | "invalid_client_metadata" | "temporarily_unavailable" | "server_error")
- `error_description` (string, optional)

Example:
```json
{
  "error": "invalid_grant"
}
```

## Member

One person in an organization, with the role the API keeps for them.

**Fields: Member**
- `userId` (string): The identity provider's id of a person. Example: `user_2abcDEF3ghiJKL`
- `email` (string (email)): The person's verified address, as their last session carried it. Example: `sam@example.com`
- `name` (string): The person's name as their last session carried it; empty when it carried none. Example: `Dana Ortiz`
- `role` ("owner" | "admin" | "member" | "viewer"): What the person may do: `owner` and `admin` may do everything, `member` reads, changes and sends mail, `viewer` reads it.
- `status` ("active" | "deactivated" | "removed"): `active`, `deactivated` for a member who is refused until an admin lets them in again, or `removed` for one who has left.
- `joinedAt` (string (date-time)): When the person first worked in the organization. Example: `2026-11-05T10:05:00.000Z`
- `lastSeenAt` (string (date-time) | null): About when the person last worked in the organization; null when never.
- `invitedBy` (string | null): Who invited the person, when an invitation brought them in; null otherwise.
- `isSelf` (boolean): True for the signed-in person's own entry.

Example:
```json
{
  "userId": "user_2abcDEF3ghiJKL",
  "email": "dana@example.com",
  "name": "Dana Ortiz",
  "role": "owner",
  "status": "active",
  "joinedAt": "2026-11-05T10:05:00.000Z",
  "lastSeenAt": "2026-11-05T10:05:00.000Z",
  "invitedBy": null,
  "isSelf": true
}
```

## MemberList

The organization's people, in the order they joined. Empty for a personal account.

**Fields: MemberList**
- `data` (Member[])

## UpdateMember

A member's new role.

**Fields: UpdateMember**
- `role` ("owner" | "admin" | "member" | "viewer"): The new role: `owner` and `admin` may do everything, `member` reads, changes and sends mail, `viewer` reads it. Only an owner may make someone an owner or change an owner's role.

Example:
```json
{
  "role": "admin"
}
```

## Invitation

What an invitation to the organization is meant to grant. The identity provider sends the email; the person takes the role when they first sign in to the organization.

**Fields: Invitation**
- `id` (string): An invitation's identifier. Example: `inv_01jc5f1a2b3c4d5e6f7g8h9j0k`
- `email` (string (email)): The invited address. Example: `sam@example.com`
- `role` ("owner" | "admin" | "member" | "viewer"): The role the person takes when they come in.
- `status` ("pending" | "accepted" | "revoked" | "expired")
- `invitedBy` (object): Who sent it.
  - `userId` (string): The identity provider's id of a person. Example: `user_2abcDEF3ghiJKL`
  - `name` (string): The inviter's name at the time. Example: `Dana Ortiz`
- `providerInvitationId` (string | null): The identity provider's id of the invitation, once the console has had it sent; null until then.
- `createdAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `expiresAt` (string (date-time)): When it stops being open: 30 days after it was made or last sent again. Example: `2026-11-05T10:05:00.000Z`
- `acceptedAt` (string (date-time) | null): When the person came in; null until then.

Example:
```json
{
  "id": "inv_01jc5f1a2b3c4d5e6f7g8h9j0k",
  "email": "sam@example.com",
  "role": "member",
  "status": "pending",
  "invitedBy": {
    "userId": "user_2abcDEF3ghiJKL",
    "name": "Dana Ortiz"
  },
  "providerInvitationId": null,
  "createdAt": "2026-11-05T10:05:00.000Z",
  "expiresAt": "2026-12-05T10:05:00.000Z",
  "acceptedAt": null
}
```

## InvitationList

The organization's invitations, newest first. Empty for a personal account.

**Fields: InvitationList**
- `data` (Invitation[])

## CreateInvitation

Who to invite, and as what.

**Fields: CreateInvitation**
- `email` (string (email)): The address to invite. It is stored in lowercase. Example: `sam@example.com`
- `role` ("owner" | "admin" | "member" | "viewer", optional): The role the person takes when they come in: `owner` and `admin` may do everything, `member` reads, changes and sends mail, `viewer` reads it. Only an owner may invite an owner. Defaults to `member`.

Example:
```json
{
  "email": "sam@example.com",
  "role": "member"
}
```

## UpdateInvitation

The identity provider's invitation that was sent for this one. Recording a different one than before means the invitation was sent again, and it stays open that much longer.

**Fields: UpdateInvitation**
- `providerInvitationId` (string): The identity provider's id of the invitation it sent. Example: `orginv_2abcDEF3ghiJKL`

Example:
```json
{
  "providerInvitationId": "orginv_2abcDEF3ghiJKL"
}
```

## AssistantMessage

One entry of the transcript the console keeps, including the proposals it ran and what came of them.

**Fields: AssistantMessage**
- `role` ("user" | "assistant" | "tool")
- `content` (string)
- `toolCallId` (string, optional): On a tool message: the proposal it answers.
- `name` (string, optional): On a tool message: the tool's name.

Example:
```json
{
  "role": "user",
  "content": "How many threads are unread?"
}
```

## AssistantStage

The pages and controls the console can show this turn. Cues may only name these identifiers.

**Fields: AssistantStage**
- `routes` (object[])
  - `id` (string)
  - `label` (string)
  - `href` (string)
  - `needsInbox` (boolean)
- `landmarks` (object[])
  - `id` (string)
  - `routes` (string[])
  - `label` (string)

## AssistantStageCue

A navigation, pointer or progress cue for the console's declared stage.

**Fields: AssistantStageCue**
One of:

(inline)
- `id` (string)
- `kind` ("go")
- `route` (string)
- `inboxId` (string | null)

(inline)
- `id` (string)
- `kind` ("point")
- `landmark` (string)
- `note` (string)

(inline)
- `id` (string)
- `kind` ("rounds")
- `steps` (string[])
- `current` (integer)

## AssistantChatRequest

One turn of Ask Doorman: the transcript so far and where in the console the person is.

**Fields: AssistantChatRequest**
- `messages` (AssistantMessage[]): At most 40 messages; the last one must come from the person or be a tool result.
- `context` (object)
  - `page` (string): The console path the person is on. Example: `/console/inboxes`
  - `inboxId` (string, optional): The inbox the page is about, when there is one.
  - `stage` (AssistantStage, optional)

Example:
```json
{
  "messages": [
    {
      "role": "user",
      "content": "How many threads are unread?"
    }
  ],
  "context": {
    "page": "/console/inboxes",
    "inboxId": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z"
  }
}
```

## AssistantProposal

A change the assistant wants to make. Nothing runs until the person confirms it in the console.

**Fields: AssistantProposal**
- `id` (string) Example: `prp_0123456789abcdefghjkmnpqrs`
- `name` ("create_inbox" | "create_api_key" | "set_inbox_webhook" | "create_endpoint" | "send_message" | "mark_thread_read" | "delete_inbox" | "revoke_key" | "rotate_secret" | "delete_endpoint" | "set_protection" | "trust_sender" | "block_sender" | "release_message" | "discard_message" | "add_domain")
- `args` (object): Validated arguments in the shape the console's server actions take.
- `summary` (string): One sentence saying what confirming does.

Example:
```json
{
  "id": "prp_0123456789abcdefghjkmnpqrs",
  "name": "create_inbox",
  "args": {
    "mailboxName": "concierge"
  },
  "summary": "Create the inbox concierge@doorman.example."
}
```

## AssistantEvent

The named events of the assistant's response stream: `event: <name>` then the JSON on one `data:` line. A turn ends with `done` or `error`; a `proposal` ends it too.

**Fields: AssistantEvent**
One of:

(inline)
- `event` ("text")
- `data` (object)
  - `delta` (string)

(inline)
- `event` ("tool")
- `data` (object)
  - `name` ("list_inboxes" | "get_inbox" | "list_threads" | "list_domains" | "get_domain" | "list_services" | "get_overview" | "get_usage_and_plan" | "list_keys" | "get_webhooks" | "get_metrics_summary" | "docs_lookup" | "read_message" | "get_security" | "list_senders" | "list_held")
  - `summary` (string)

(inline)
- `event` ("proposal")
- `data` (AssistantProposal)

(inline)
- `event` ("stage")
- `data` (AssistantStageCue)

(inline)
- `event` ("done")
- `data` (object)

(inline)
- `event` ("error")
- `data` (object)
  - `code` (string)
  - `message` (string)

Example:
```json
{
  "event": "text",
  "data": {
    "delta": "Three threads are unread."
  }
}
```

## InboxWebhook

The inbox's single webhook: one URL that receives every event for it.

**Fields: InboxWebhook**
- `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:
```json
{
  "url": "https://agent.example.com/hooks/doorman",
  "secret": "whsec_...ODk="
}
```

## InboxWebhookSecret

The inbox webhook with its new signing secret, shown once.

**Fields: InboxWebhookSecret**
- `url` (string)
- `secret` (string): A Standard Webhooks secret (whsec_ and base64), shown once. Verify signatures with its decoded bytes. Example: `whsec_dGVzdC13ZWJob29rLXNpZ25pbmctc2VjcmV0LTAxMjM0NTY3ODk=`

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

## SetInboxWebhook

Where the inbox's events go. Setting it again replaces the URL and mints a new secret.

**Fields: SetInboxWebhook**
- `url` (string): An https URL without credentials (http is accepted in local development). Example: `https://agent.example.com/hooks/doorman`

Example:
```json
{
  "url": "https://agent.example.com/hooks/doorman"
}
```

## LastDelivery

The newest delivery to an endpoint.

**Fields: LastDelivery**
- `status` ("pending" | "delivered" | "failed")
- `statusCode` (integer | null)
- `at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`

Example:
```json
{
  "status": "delivered",
  "statusCode": 200,
  "at": "2026-11-05T10:05:00.000Z"
}
```

## Endpoint

An account webhook endpoint: receives the account's events across inboxes, with its own signing secret.

**Fields: Endpoint**
- `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:
```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"
  }
}
```

## EndpointList

The account's endpoints, oldest first.

**Fields: EndpointList**
- `data` (Endpoint[])

## CreatedEndpoint

A new endpoint with its signing secret, shown once.

**Fields: CreatedEndpoint**
- `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:
```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="
}
```

## EndpointSecret

An endpoint's new signing secret, shown once.

**Fields: EndpointSecret**
- `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:
```json
{
  "id": "whk_01jc5d1a2b3c4d5e6f7g8h9j0k",
  "secret": "whsec_dGVzdC13ZWJob29rLXNpZ25pbmctc2VjcmV0LTAxMjM0NTY3ODk="
}
```

## EndpointTestResult

What happened to one signed test delivery.

**Fields: EndpointTestResult**
- `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:
```json
{
  "ok": true,
  "statusCode": 200,
  "error": null,
  "durationMs": 212
}
```

## CreateEndpoint

A new account endpoint.

**Fields: CreateEndpoint**
- `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.

Example:
```json
{
  "name": "Orchestrator",
  "url": "https://agent.example.com/hooks/doorman",
  "eventTypes": [
    "message.received"
  ],
  "inboxIds": [],
  "enabled": true
}
```

## UpdateEndpoint

Changes to an endpoint; fields left out stay as they are.

**Fields: UpdateEndpoint**
- `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.

Example:
```json
{
  "enabled": false
}
```

## Delivery

One event sent to one target, with every attempt's outcome.

**Fields: Delivery**
- `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:
```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"
}
```

## DeliveryPage

A target's deliveries, newest first.

**Fields: DeliveryPage**
- `data` (Delivery[])
- `nextCursor` (string | null): Pass as `cursor` for the next page; null on the last page.

## MessageReceivedEvent

The `message.received` event, as it is signed and posted to webhooks and framed on the stream. Field names use snake_case.

**Fields: MessageReceivedEvent**
- `event` ("message.received")
- `event_id` (string): Stable across retries; deduplicate on it. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `occurred_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `inbox_id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `thread_id` (string): A thread identifier. Example: `thr_01jc5a1b2c3d4e5f6g7h8j9k0m`
- `message` (object)
  - `id` (string): A message identifier. Example: `msg_01jc5a6g7h8j9k0m1n2p3q4r5s`
  - `rfc_message_id` (string | null)
  - `from` (string): The sender's address. Example: `sam@example.com`
  - `to` (string): The inbox's address. Example: `concierge@doorman.example`
  - `header_to` (string | null): The first To header address, which may differ from the inbox when it was copied.
  - `delivery_role` ("to" | "cc" | "bcc" | null)
  - `cc` (string[])
  - `address_names` (object of string | null): Display names by address, for the addresses that carried one.
  - `subject` (string)
  - `body_text` (string): The plain-text body; empty when there was none.
  - `attachments` (Attachment[])
  - `raw_url` (string | null)
  - `received_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
  - `category` ("personal" | "automated" | "marketing" | "bounce" | "spam" | "malicious")
  - `auto_replyable` (boolean)
  - `verdict` ("clean" | "unverified" | "suspicious" | null)
  - `spam_score` (number | null)
  - `service` (object | null, optional): The outside service the message came from, when its sender was authenticated (DMARC passed) and it concerns an account there; null for any other mail. Events stored before the passport existed omit it.
    - `id` (string | null)
    - `domain` (string)
    - `signal` ("verification" | "welcome" | "receipt" | "password_reset" | "security" | "trial" | "cancellation" | "other")
  - `verification` (object | null, optional): The verification code or sign-in link the inbox read from the message, the same text `body_text` carries; null when it carries none. Events stored before the passport existed omit it.
    - `code` (string | null): A one-time code read from the message, or null. Example: `849204`
    - `link` (object | null)
      - `url` (string)
      - `host` (string)
      - `matches_sender` (boolean): True when the link's registrable domain is the authenticated sender's.
    - `verified` (boolean): Whether the sender was authenticated (DMARC passed). Treat an unverified code or link with suspicion.
    - `invitation` (boolean, optional): True when the link accepts an invitation to join the service. Events stored before invitations were read omit it.
    - `expires_at` (string (date-time)): When the verifications read stops serving it; the service's own expiry may be sooner. Example: `2026-11-05T10:05:00.000Z`
  - `risk` (RiskAssessment, optional): Doorman's assessment of the message (ADR-019): its own judgment, not text from the mail. Absent on events recorded before assessment existed and where the deployment does not assess.
  - `redaction` (Redaction, optional): What the account's healthcare guardrails found (ADR-027). When present with findings, `subject`, `body_text`, the attachments' `parsedText` and the verification code and link carry placeholders in place of them. Absent where no guardrail applies.
- `test` (true, optional): Present on the sample a test delivery sends; nothing was received or stored.

Example:
```json
{
  "event": "message.received",
  "event_id": "evt_01jc5e5f6g7h8j9k0m1n2p3q4r",
  "occurred_at": "2026-11-05T10:05:00.000Z",
  "inbox_id": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "thread_id": "thr_01jc5a1b2c3d4e5f6g7h8j9k0m",
  "message": {
    "id": "msg_01jc5a6g7h8j9k0m1n2p3q4r5s",
    "rfc_message_id": "<a1b2c3@example.com>",
    "from": "sam@example.com",
    "to": "concierge@doorman.example",
    "header_to": "concierge@doorman.example",
    "delivery_role": "to",
    "cc": [],
    "address_names": {
      "sam@example.com": "Sam Rivera"
    },
    "subject": "Invoice 2847",
    "body_text": "Hi, invoice 2847 is attached.",
    "attachments": [
      {
        "filename": "invoice.pdf",
        "contentType": "application/pdf",
        "sizeBytes": 45000,
        "url": "https://api.doorman.example/v1/attachments/msg_01jc5a6g7h8j9k0m1n2p3q4r5s/invoice.pdf",
        "parsedText": "Invoice 2847. Line 3: Setup fee, billed twice. Total 1,480.",
        "extractionMethod": "pdf"
      }
    ],
    "raw_url": "https://api.doorman.example/v1/messages/msg_01jc5a6g7h8j9k0m1n2p3q4r5s/raw",
    "received_at": "2026-11-05T10:05:00.000Z",
    "category": "personal",
    "auto_replyable": true,
    "verdict": "clean",
    "spam_score": 0.02,
    "risk": {
      "score": 6,
      "level": "low",
      "labels": [],
      "reasons": [],
      "sender": {
        "standing": "known",
        "authenticated": true
      },
      "action": "delivered",
      "analysis": "full",
      "review": null
    }
  }
}
```

## CreatedInbox

A freshly issued inbox. When the request asked for them, `webhook` carries the webhook with its signing secret and `key` the inbox-scoped key with its token; both are shown once and null otherwise.

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

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

## MessageSentEvent

A message accepted by the sending provider and stored. This is not proof of final delivery.

**Fields: MessageSentEvent**
- `event` ("message.sent")
- `event_id` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `occurred_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `inbox_id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `thread_id` (string): A thread identifier. Example: `thr_01jc5a1b2c3d4e5f6g7h8j9k0m`
- `message` (object)
  - `id` (string): A message identifier. Example: `msg_01jc5a6g7h8j9k0m1n2p3q4r5s`
  - `provider_message_id` (string | null)
  - `from` (string)
  - `to` (string[])
  - `cc` (string[])
  - `bcc` (string[])
  - `subject` (string)
  - `body_text` (string)
  - `attachments` (Attachment[])
  - `sent_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
  - `redaction` (Redaction, optional): What the account's healthcare guardrails found in what was sent (ADR-027). When present with findings, `subject`, `body_text` and the attachments' `parsedText` carry placeholders in place of them. Absent where no guardrail applies.

Example:
```json
{
  "event": "message.sent",
  "event_id": "evt_01jc5e5f6g7h8j9k0m1n2p3q4r",
  "occurred_at": "2026-11-05T10:05:00.000Z",
  "inbox_id": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "thread_id": "thr_01jc5a1b2c3d4e5f6g7h8j9k0m",
  "message": {
    "id": "msg_01jc5a6g7h8j9k0m1n2p3q4r5s",
    "provider_message_id": "<sent@doorman.example>",
    "from": "concierge@doorman.example",
    "to": [
      "sam@example.com"
    ],
    "cc": [],
    "bcc": [],
    "subject": "Re: Invoice 2847",
    "body_text": "Thank you.",
    "attachments": [],
    "sent_at": "2026-11-05T10:05:00.000Z"
  }
}
```

## ThreadUpdatedEvent

The thread's extension state after a read-state, metadata, label or trash change. A no-op edit emits no event.

**Fields: ThreadUpdatedEvent**
- `event` ("thread.updated")
- `event_id` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `occurred_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `inbox_id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `thread_id` (string): A thread identifier. Example: `thr_01jc5a1b2c3d4e5f6g7h8j9k0m`
- `thread` (object)
  - `id` (string): A thread identifier. Example: `thr_01jc5a1b2c3d4e5f6g7h8j9k0m`
  - `is_read` (boolean)
  - `trashed_at` (string (date-time) | null)
  - `metadata` (Metadata)
  - `labels` (ThreadLabels)
  - `updated_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`

Example:
```json
{
  "event": "thread.updated",
  "event_id": "evt_01jc5e5f6g7h8j9k0m1n2p3q4r",
  "occurred_at": "2026-11-05T10:05:00.000Z",
  "inbox_id": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "thread_id": "thr_01jc5a1b2c3d4e5f6g7h8j9k0m",
  "thread": {
    "id": "thr_01jc5a1b2c3d4e5f6g7h8j9k0m",
    "is_read": true,
    "trashed_at": null,
    "metadata": {},
    "labels": [
      "billing"
    ],
    "updated_at": "2026-11-05T10:05:00.000Z"
  }
}
```

## InboxCreatedEvent

An inbox was created. No API key or webhook signing secret is included.

**Fields: InboxCreatedEvent**
- `event` ("inbox.created")
- `event_id` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `occurred_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `inbox_id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `inbox` (object)
  - `id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
  - `address` (string)
  - `display_name` (string | null)
  - `external_id` (string | null)
  - `metadata` (Metadata)

Example:
```json
{
  "event": "inbox.created",
  "event_id": "evt_01jc5e5f6g7h8j9k0m1n2p3q4r",
  "occurred_at": "2026-11-05T10:05:00.000Z",
  "inbox_id": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "inbox": {
    "id": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
    "address": "concierge@doorman.example",
    "display_name": "Acme concierge",
    "external_id": null,
    "metadata": {}
  }
}
```

## InboxDeletedEvent

An inbox was deleted through the API. Delivered to matching account endpoints, not the removed inbox webhook. The address is the one it held before deletion.

**Fields: InboxDeletedEvent**
- `event` ("inbox.deleted")
- `event_id` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `occurred_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `inbox_id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `inbox` (object)
  - `id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
  - `address` (string)
  - `deleted_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`

Example:
```json
{
  "event": "inbox.deleted",
  "event_id": "evt_01jc5e5f6g7h8j9k0m1n2p3q4r",
  "occurred_at": "2026-11-05T10:05:00.000Z",
  "inbox_id": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "inbox": {
    "id": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
    "address": "concierge@doorman.example",
    "deleted_at": "2026-11-05T10:05:00.000Z"
  }
}
```

## DeliveryFailedEvent

A webhook delivery reached a terminal failure. Account endpoint failures have inbox_id null and require account scope. Failure notifications never produce further failure notifications.

**Fields: DeliveryFailedEvent**
- `event` ("delivery.failed")
- `event_id` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `occurred_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `inbox_id` (string | null)
- `delivery` (object)
  - `id` (string): A webhook delivery identifier. Example: `whd_01jc5f1a2b3c4d5e6f7g8h9j0k`
  - `event_id` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
  - `target` (object)
    - `kind` ("inbox" | "endpoint")
    - `id` (string)
  - `attempts` (integer)
  - `last_status_code` (integer | null)
  - `last_error` (string)

Example:
```json
{
  "event": "delivery.failed",
  "event_id": "evt_01jc5e5f6g7h8j9k0m1n2p3q4r",
  "occurred_at": "2026-11-05T10:05:00.000Z",
  "inbox_id": null,
  "delivery": {
    "id": "whd_01jc5f1a2b3c4d5e6f7g8h9j0k",
    "event_id": "evt_01jc5e5f6g7h8j9k0m1n2p3q4r",
    "target": {
      "kind": "endpoint",
      "id": "whk_01jc5d1a2b3c4d5e6f7g8h9j0k"
    },
    "attempts": 5,
    "last_status_code": 503,
    "last_error": "HTTP 503"
  }
}
```

## MessageHeldEvent

A message arrived and is held for the owner under the security policy (ADR-018). The payload says who, when and why, and nothing of the message itself: no subject, no body, no attachment. When the owner releases it, message.received follows with the content; a discarded message produces nothing further.

**Fields: MessageHeldEvent**
- `event` ("message.held")
- `event_id` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `occurred_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `inbox_id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `message` (object)
  - `id` (string): A message identifier. Example: `msg_01jc5a6g7h8j9k0m1n2p3q4r5s`
  - `from` (string): The sender's address.
  - `held_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
  - `risk` (RiskAssessment)

Example:
```json
{
  "event": "message.held",
  "event_id": "evt_01jc5e5f6g7h8j9k0m1n2p3q4r",
  "occurred_at": "2026-11-05T10:05:00.000Z",
  "inbox_id": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "message": {
    "id": "msg_01jc5a6g7h8j9k0m1n2p3q4r5s",
    "from": "billing@example.net",
    "held_at": "2026-11-05T10:05:00.000Z",
    "risk": {
      "score": 92,
      "level": "critical",
      "labels": [
        "prompt_injection",
        "impersonation"
      ],
      "reasons": [
        "hidden_text",
        "instruction_override",
        "dmarc_fail"
      ],
      "sender": {
        "standing": "new",
        "authenticated": false
      },
      "action": "held",
      "analysis": "full",
      "review": null
    }
  }
}
```

## SendHeldEvent

A message waits for the owner before it leaves the inbox: one that was asked to be sent and that the security policy kept (`sendApproval`), or a draft written for the owner to send (`kind` says which). The payload says who it is to and who asked, and nothing of what it says: no subject, no body, no attachment. When the owner sends it, message.sent follows; when the owner discards it or nobody decides in time, send.discarded does.

**Fields: SendHeldEvent**
- `event` ("send.held")
- `event_id` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `occurred_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `inbox_id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `send` (object)
  - `id` (string): A held send's identifier. Example: `hsd_01jc5f1a2b3c4d5e6f7g8h9j0k`
  - `thread_id` (string | null): The thread a reply was written into; null for a new message.
  - `to` (string[])
  - `cc` (string[])
  - `bcc` (string[])
  - `requested_by` ("app" | "key")
  - `kind` ("held" | "draft"): Why it waits: `held` when the security policy kept a send, `draft` when it was written as a draft for the owner to send.
  - `held_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
  - `expires_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`

Example:
```json
{
  "event": "send.held",
  "event_id": "evt_01jc5e5f6g7h8j9k0m1n2p3q4r",
  "occurred_at": "2026-11-05T10:05:00.000Z",
  "inbox_id": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "send": {
    "id": "hsd_01jc5f1a2b3c4d5e6f7g8h9j0k",
    "thread_id": null,
    "to": [
      "sam@example.com"
    ],
    "cc": [],
    "bcc": [],
    "requested_by": "app",
    "kind": "held",
    "held_at": "2026-11-05T10:05:00.000Z",
    "expires_at": "2026-11-12T10:05:00.000Z"
  }
}
```

## SendDiscardedEvent

A held send ended without being sent: the owner discarded it, or it expired. Nothing of what it said is included.

**Fields: SendDiscardedEvent**
- `event` ("send.discarded")
- `event_id` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `occurred_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `inbox_id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `send` (object)
  - `id` (string): A held send's identifier. Example: `hsd_01jc5f1a2b3c4d5e6f7g8h9j0k`
  - `thread_id` (string | null): The thread a reply was written into; null for a new message.
  - `to` (string[])
  - `cc` (string[])
  - `bcc` (string[])
  - `requested_by` ("app" | "key")
  - `kind` ("held" | "draft"): Why it waits: `held` when the security policy kept a send, `draft` when it was written as a draft for the owner to send.
  - `reason` ("discarded" | "expired"): `discarded` by the owner, or `expired` because nobody decided in time.
  - `discarded_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`

Example:
```json
{
  "event": "send.discarded",
  "event_id": "evt_01jc5e5f6g7h8j9k0m1n2p3q4r",
  "occurred_at": "2026-11-05T10:05:00.000Z",
  "inbox_id": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "send": {
    "id": "hsd_01jc5f1a2b3c4d5e6f7g8h9j0k",
    "thread_id": null,
    "to": [
      "sam@example.com"
    ],
    "cc": [],
    "bcc": [],
    "requested_by": "app",
    "kind": "held",
    "reason": "discarded",
    "discarded_at": "2026-11-05T10:05:00.000Z"
  }
}
```

## SignInRequestedEvent

An address asked to sign in to a service for the first time and waits for the owner to allow it (Sign in with Doorman). Asking again while it waits emits nothing. Nothing in the payload lets anyone sign in.

**Fields: SignInRequestedEvent**
- `event` ("sign_in.requested")
- `event_id` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `occurred_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `inbox_id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `sign_in` (object)
  - `id` (string): The identifier of one address's connection to one relying party. Example: `sig_01jc5f1a2b3c4d5e6f7g8h9j0k`
  - `service_id` (string): The service in the address's passport that the sign-in belongs to. Example: `svc_01jc5g2b3c4d5e6f7g8h9j0k1m`
  - `client` (object)
    - `id` (string): The relying party's client id: one this API issued, or the URL of the identity it published.
    - `name` (string): What the relying party calls itself. A label, never proof of who it is.
    - `host` (string): The host that identifies the relying party.
  - `requested_by` ("app" | "key" | "owner"): Who asked: a connected app, an API key, or the owner in the console.
  - `requested_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`

Example:
```json
{
  "event": "sign_in.requested",
  "event_id": "evt_01jc5e5f6g7h8j9k0m1n2p3q4r",
  "occurred_at": "2026-11-05T10:05:00.000Z",
  "inbox_id": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "sign_in": {
    "id": "sig_01jc5f1a2b3c4d5e6f7g8h9j0k",
    "service_id": "svc_01jc5g2b3c4d5e6f7g8h9j0k1m",
    "client": {
      "id": "sic_01jc5f1a2b3c4d5e6f7g8h9j0k",
      "name": "Example Tools",
      "host": "app.example.net"
    },
    "requested_by": "app",
    "requested_at": "2026-11-05T10:05:00.000Z"
  }
}
```

## SignInCompletedEvent

An address signed in to a service: the relying party exchanged its code for tokens (Sign in with Doorman). The payload names the service and carries no token, code or claim.

**Fields: SignInCompletedEvent**
- `event` ("sign_in.completed")
- `event_id` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `occurred_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `inbox_id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `sign_in` (object)
  - `id` (string): The identifier of one address's connection to one relying party. Example: `sig_01jc5f1a2b3c4d5e6f7g8h9j0k`
  - `service_id` (string): The service in the address's passport that the sign-in belongs to. Example: `svc_01jc5g2b3c4d5e6f7g8h9j0k1m`
  - `client` (object)
    - `id` (string): The relying party's client id: one this API issued, or the URL of the identity it published.
    - `name` (string): What the relying party calls itself. A label, never proof of who it is.
    - `host` (string): The host that identifies the relying party.
  - `completed_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`

Example:
```json
{
  "event": "sign_in.completed",
  "event_id": "evt_01jc5e5f6g7h8j9k0m1n2p3q4r",
  "occurred_at": "2026-11-05T10:05:00.000Z",
  "inbox_id": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "sign_in": {
    "id": "sig_01jc5f1a2b3c4d5e6f7g8h9j0k",
    "service_id": "svc_01jc5g2b3c4d5e6f7g8h9j0k1m",
    "client": {
      "id": "sic_01jc5f1a2b3c4d5e6f7g8h9j0k",
      "name": "Example Tools",
      "host": "app.example.net"
    },
    "completed_at": "2026-11-05T10:05:00.000Z"
  }
}
```

## WebhookEvent

A signed event payload, discriminated by event. New event types are additive.

**Fields: WebhookEvent**
One of:

MessageReceivedEvent: The `message.received` event, as it is signed and posted to webhooks and framed on the stream. Field names use snake_case.
- `event` ("message.received")
- `event_id` (string): Stable across retries; deduplicate on it. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `occurred_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `inbox_id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `thread_id` (string): A thread identifier. Example: `thr_01jc5a1b2c3d4e5f6g7h8j9k0m`
- `message` (object)
  - `id` (string): A message identifier. Example: `msg_01jc5a6g7h8j9k0m1n2p3q4r5s`
  - `rfc_message_id` (string | null)
  - `from` (string): The sender's address. Example: `sam@example.com`
  - `to` (string): The inbox's address. Example: `concierge@doorman.example`
  - `header_to` (string | null): The first To header address, which may differ from the inbox when it was copied.
  - `delivery_role` ("to" | "cc" | "bcc" | null)
  - `cc` (string[])
  - `address_names` (object of string | null): Display names by address, for the addresses that carried one.
  - `subject` (string)
  - `body_text` (string): The plain-text body; empty when there was none.
  - `attachments` (Attachment[])
  - `raw_url` (string | null)
  - `received_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
  - `category` ("personal" | "automated" | "marketing" | "bounce" | "spam" | "malicious")
  - `auto_replyable` (boolean)
  - `verdict` ("clean" | "unverified" | "suspicious" | null)
  - `spam_score` (number | null)
  - `service` (object | null, optional): The outside service the message came from, when its sender was authenticated (DMARC passed) and it concerns an account there; null for any other mail. Events stored before the passport existed omit it.
    - `id` (string | null)
    - `domain` (string)
    - `signal` ("verification" | "welcome" | "receipt" | "password_reset" | "security" | "trial" | "cancellation" | "other")
  - `verification` (object | null, optional): The verification code or sign-in link the inbox read from the message, the same text `body_text` carries; null when it carries none. Events stored before the passport existed omit it.
    - `code` (string | null): A one-time code read from the message, or null. Example: `849204`
    - `link` (object | null)
      - `url` (string)
      - `host` (string)
      - `matches_sender` (boolean): True when the link's registrable domain is the authenticated sender's.
    - `verified` (boolean): Whether the sender was authenticated (DMARC passed). Treat an unverified code or link with suspicion.
    - `invitation` (boolean, optional): True when the link accepts an invitation to join the service. Events stored before invitations were read omit it.
    - `expires_at` (string (date-time)): When the verifications read stops serving it; the service's own expiry may be sooner. Example: `2026-11-05T10:05:00.000Z`
  - `risk` (RiskAssessment, optional): Doorman's assessment of the message (ADR-019): its own judgment, not text from the mail. Absent on events recorded before assessment existed and where the deployment does not assess.
  - `redaction` (Redaction, optional): What the account's healthcare guardrails found (ADR-027). When present with findings, `subject`, `body_text`, the attachments' `parsedText` and the verification code and link carry placeholders in place of them. Absent where no guardrail applies.
- `test` (true, optional): Present on the sample a test delivery sends; nothing was received or stored.

MessageSentEvent: A message accepted by the sending provider and stored. This is not proof of final delivery.
- `event` ("message.sent")
- `event_id` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `occurred_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `inbox_id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `thread_id` (string): A thread identifier. Example: `thr_01jc5a1b2c3d4e5f6g7h8j9k0m`
- `message` (object)
  - `id` (string): A message identifier. Example: `msg_01jc5a6g7h8j9k0m1n2p3q4r5s`
  - `provider_message_id` (string | null)
  - `from` (string)
  - `to` (string[])
  - `cc` (string[])
  - `bcc` (string[])
  - `subject` (string)
  - `body_text` (string)
  - `attachments` (Attachment[])
  - `sent_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
  - `redaction` (Redaction, optional): What the account's healthcare guardrails found in what was sent (ADR-027). When present with findings, `subject`, `body_text` and the attachments' `parsedText` carry placeholders in place of them. Absent where no guardrail applies.

ThreadUpdatedEvent: The thread's extension state after a read-state, metadata, label or trash change. A no-op edit emits no event.
- `event` ("thread.updated")
- `event_id` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `occurred_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `inbox_id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `thread_id` (string): A thread identifier. Example: `thr_01jc5a1b2c3d4e5f6g7h8j9k0m`
- `thread` (object)
  - `id` (string): A thread identifier. Example: `thr_01jc5a1b2c3d4e5f6g7h8j9k0m`
  - `is_read` (boolean)
  - `trashed_at` (string (date-time) | null)
  - `metadata` (Metadata)
  - `labels` (ThreadLabels)
  - `updated_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`

InboxCreatedEvent: An inbox was created. No API key or webhook signing secret is included.
- `event` ("inbox.created")
- `event_id` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `occurred_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `inbox_id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `inbox` (object)
  - `id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
  - `address` (string)
  - `display_name` (string | null)
  - `external_id` (string | null)
  - `metadata` (Metadata)

InboxDeletedEvent: An inbox was deleted through the API. Delivered to matching account endpoints, not the removed inbox webhook. The address is the one it held before deletion.
- `event` ("inbox.deleted")
- `event_id` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `occurred_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `inbox_id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `inbox` (object)
  - `id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
  - `address` (string)
  - `deleted_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`

DeliveryFailedEvent: A webhook delivery reached a terminal failure. Account endpoint failures have inbox_id null and require account scope. Failure notifications never produce further failure notifications.
- `event` ("delivery.failed")
- `event_id` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `occurred_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `inbox_id` (string | null)
- `delivery` (object)
  - `id` (string): A webhook delivery identifier. Example: `whd_01jc5f1a2b3c4d5e6f7g8h9j0k`
  - `event_id` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
  - `target` (object)
    - `kind` ("inbox" | "endpoint")
    - `id` (string)
  - `attempts` (integer)
  - `last_status_code` (integer | null)
  - `last_error` (string)

MessageHeldEvent: A message arrived and is held for the owner under the security policy (ADR-018). The payload says who, when and why, and nothing of the message itself: no subject, no body, no attachment. When the owner releases it, message.received follows with the content; a discarded message produces nothing further.
- `event` ("message.held")
- `event_id` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `occurred_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `inbox_id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `message` (object)
  - `id` (string): A message identifier. Example: `msg_01jc5a6g7h8j9k0m1n2p3q4r5s`
  - `from` (string): The sender's address.
  - `held_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
  - `risk` (RiskAssessment)

SendHeldEvent: A message waits for the owner before it leaves the inbox: one that was asked to be sent and that the security policy kept (`sendApproval`), or a draft written for the owner to send (`kind` says which). The payload says who it is to and who asked, and nothing of what it says: no subject, no body, no attachment. When the owner sends it, message.sent follows; when the owner discards it or nobody decides in time, send.discarded does.
- `event` ("send.held")
- `event_id` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `occurred_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `inbox_id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `send` (object)
  - `id` (string): A held send's identifier. Example: `hsd_01jc5f1a2b3c4d5e6f7g8h9j0k`
  - `thread_id` (string | null): The thread a reply was written into; null for a new message.
  - `to` (string[])
  - `cc` (string[])
  - `bcc` (string[])
  - `requested_by` ("app" | "key")
  - `kind` ("held" | "draft"): Why it waits: `held` when the security policy kept a send, `draft` when it was written as a draft for the owner to send.
  - `held_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
  - `expires_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`

SendDiscardedEvent: A held send ended without being sent: the owner discarded it, or it expired. Nothing of what it said is included.
- `event` ("send.discarded")
- `event_id` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `occurred_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `inbox_id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `send` (object)
  - `id` (string): A held send's identifier. Example: `hsd_01jc5f1a2b3c4d5e6f7g8h9j0k`
  - `thread_id` (string | null): The thread a reply was written into; null for a new message.
  - `to` (string[])
  - `cc` (string[])
  - `bcc` (string[])
  - `requested_by` ("app" | "key")
  - `kind` ("held" | "draft"): Why it waits: `held` when the security policy kept a send, `draft` when it was written as a draft for the owner to send.
  - `reason` ("discarded" | "expired"): `discarded` by the owner, or `expired` because nobody decided in time.
  - `discarded_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`

SignInRequestedEvent: An address asked to sign in to a service for the first time and waits for the owner to allow it (Sign in with Doorman). Asking again while it waits emits nothing. Nothing in the payload lets anyone sign in.
- `event` ("sign_in.requested")
- `event_id` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `occurred_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `inbox_id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `sign_in` (object)
  - `id` (string): The identifier of one address's connection to one relying party. Example: `sig_01jc5f1a2b3c4d5e6f7g8h9j0k`
  - `service_id` (string): The service in the address's passport that the sign-in belongs to. Example: `svc_01jc5g2b3c4d5e6f7g8h9j0k1m`
  - `client` (object)
    - `id` (string): The relying party's client id: one this API issued, or the URL of the identity it published.
    - `name` (string): What the relying party calls itself. A label, never proof of who it is.
    - `host` (string): The host that identifies the relying party.
  - `requested_by` ("app" | "key" | "owner"): Who asked: a connected app, an API key, or the owner in the console.
  - `requested_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`

SignInCompletedEvent: An address signed in to a service: the relying party exchanged its code for tokens (Sign in with Doorman). The payload names the service and carries no token, code or claim.
- `event` ("sign_in.completed")
- `event_id` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `occurred_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `inbox_id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `sign_in` (object)
  - `id` (string): The identifier of one address's connection to one relying party. Example: `sig_01jc5f1a2b3c4d5e6f7g8h9j0k`
  - `service_id` (string): The service in the address's passport that the sign-in belongs to. Example: `svc_01jc5g2b3c4d5e6f7g8h9j0k1m`
  - `client` (object)
    - `id` (string): The relying party's client id: one this API issued, or the URL of the identity it published.
    - `name` (string): What the relying party calls itself. A label, never proof of who it is.
    - `host` (string): The host that identifies the relying party.
  - `completed_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`

## EventSummary

What a list shows without the payload; none of it is body text.

**Fields: EventSummary**
- `from` (string | null)
- `subject` (string | null)
- `messageId` (string | null)
- `threadId` (string | null)

Example:
```json
{
  "from": "sam@example.com",
  "subject": "Invoice 2847",
  "messageId": "msg_01jc5a6g7h8j9k0m1n2p3q4r5s",
  "threadId": "thr_01jc5a1b2c3d4e5f6g7h8j9k0m"
}
```

## Event

Something that happened in the account, in a log every subscriber reads from.

**Fields: Event**
- `id` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `seq` (integer): The position in the account's log: the cursor for paging and polling. Example: `1042`
- `type` ("message.received" | "message.sent" | "thread.updated" | "inbox.created" | "inbox.deleted" | "delivery.failed" | "message.held" | "send.held" | "send.discarded" | "sign_in.requested" | "sign_in.completed")
- `inboxId` (string | null)
- `occurredAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `summary` (EventSummary)

Example:
```json
{
  "id": "evt_01jc5e5f6g7h8j9k0m1n2p3q4r",
  "seq": 1042,
  "type": "message.received",
  "inboxId": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "occurredAt": "2026-11-05T10:05:00.000Z",
  "summary": {
    "from": "sam@example.com",
    "subject": "Invoice 2847",
    "messageId": "msg_01jc5a6g7h8j9k0m1n2p3q4r5s",
    "threadId": "thr_01jc5a1b2c3d4e5f6g7h8j9k0m"
  }
}
```

## EventPage

Events newest first, the answer to a `cursor` (or no cursor) request.

**Fields: EventPage**
- `data` (Event[])
- `nextCursor` (string | null): The `seq` to pass as `cursor` for the next page, as a string; null on the last page. Example: `1041`

## EventPoll

Events oldest first, the answer to an `after` request.

**Fields: EventPoll**
- `data` (Event[])
- `latestSeq` (integer): The `seq` to poll from next: the last event of a full page, otherwise the account's newest.

## EventList

A page (with `cursor` or nothing) or a poll (with `after`).

**Fields: EventList**
One of:

EventPage: Events newest first, the answer to a `cursor` (or no cursor) request.
- `data` (Event[])
- `nextCursor` (string | null): The `seq` to pass as `cursor` for the next page, as a string; null on the last page. Example: `1041`

EventPoll: Events oldest first, the answer to an `after` request.
- `data` (Event[])
- `latestSeq` (integer): The `seq` to poll from next: the last event of a full page, otherwise the account's newest.

## EventDetail

An event, the payload exactly as it was signed and sent, and the deliveries it produced.

**Fields: EventDetail**
- `event` (Event)
- `payload` (WebhookEvent | object): The typed event payload, or an unknown future event object.
- `deliveries` (Delivery[]): Inbox-scoped keys see the inbox webhook's delivery only.

## RuleWhen

All supplied conditions must match. At least one condition is required.

**Fields: RuleWhen**
- `category` ("personal" | "automated" | "marketing" | "bounce" | "spam" | "malicious", optional)
- `sender` (string (email), optional): Exact normalized From address. A match is not proof of sender identity.
- `subjectContains` (string, optional): Case-insensitive subject substring, not a regular expression.
- `minRiskLevel` ("low" | "medium" | "high" | "critical", optional): The message's risk level is this or higher. A message that was not assessed never matches.
- `senderStanding` ("trusted" | "known" | "new" | "blocked", optional): The sender's standing when the message arrived. A message that was not assessed never matches.

## RuleAction

One action. Generated mail is plain text, loop-guarded and subject to normal sending limits.

**Fields: RuleAction**
One of:

(inline)
- `type` ("label")
- `label` (ThreadLabel)

(inline)
- `type` ("auto_reply")
- `text` (string): Plain text, with optional {{sender}}, {{subject}} and {{inbox}} substitutions. No code, HTML or remote templates.

(inline)
- `type` ("forward")
- `to` (string (email))

(inline)
- `type` ("trash")

## CreateRule

An inbound rule, enabled by default. Only account credentials may manage rules.

**Fields: CreateRule**
- `name` (string)
- `enabled` (boolean, optional)
- `when` (RuleWhen)
- `then` (RuleAction[]): Executed in array order. At most one auto_reply or forward action per rule.

Example:
```json
{
  "name": "Invoice triage",
  "when": {
    "category": "personal",
    "subjectContains": "invoice"
  },
  "then": [
    {
      "type": "label",
      "label": "billing"
    }
  ]
}
```

## UpdateRule

Replace the supplied fields; omitted fields stay as they are. Changes cancel pending executions of the old revision.

**Fields: UpdateRule**
- `name` (string, optional)
- `enabled` (boolean, optional)
- `when` (RuleWhen, optional)
- `then` (RuleAction[], optional): Executed in array order. At most one auto_reply or forward action per rule.

Example:
```json
{
  "enabled": false
}
```

## Rule

An inbound rule. Rules run oldest first, with id as the tie-breaker; actions run in array order.

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

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

## RuleList

The inbox's rules, oldest first. At most 25.

**Fields: RuleList**
- `data` (Rule[])

## RuleRun

A durable execution of a rule snapshot. An uncertain execution is not automatically retried: a mail provider may already have accepted the message.

**Fields: RuleRun**
- `id` (string): A rule execution identifier. Example: `rrn_01jc5f1a2b3c4d5e6f7g8h9j0k`
- `ruleId` (string): An inbox rule identifier. Example: `rul_01jc5f1a2b3c4d5e6f7g8h9j0k`
- `eventId` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `status` ("pending" | "running" | "completed" | "failed" | "skipped" | "uncertain")
- `completedActions` (integer)
- `skippedActions` (integer)
- `lastError` (string | null): A content-free reason code, never provider text or message contents.
- `createdAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `updatedAt` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`

## RuleRunPage

Execution history, newest first.

**Fields: RuleRunPage**
- `data` (RuleRun[])
- `limit` (integer): The page size that was applied.
- `offset` (integer): The offset that was applied.
- `total` (integer)

## StreamSubscribe

Start receiving events, for everything the key can see or a narrower set. Subscriptions accumulate.

**Fields: StreamSubscribe**
- `type` ("subscribe")
- `inbox_ids` (string[], optional): Up to 32 inbox ids, all of them the key's.
- `event_types` (("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): Only these event types; absent or empty means all.
- `last_event_id` (string, optional): Replay every event after this one (up to 100, filtered by the subscription) before live events. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`

Example:
```json
{
  "type": "subscribe",
  "inbox_ids": [
    "inb_01jc4q7w9k2m5n8p3r6t1v4x7z"
  ]
}
```

## StreamUnsubscribe

Stop receiving events: everything, or specific inboxes.

**Fields: StreamUnsubscribe**
- `type` ("unsubscribe")
- `inbox_ids` (string[], optional): The inboxes to stop receiving for; absent or empty stops everything.

Example:
```json
{
  "type": "unsubscribe"
}
```

## StreamPing

A keepalive the edge answers with pong without waking the stream; send one every 30 to 60 seconds through idle proxies.

**Fields: StreamPing**
- `type` ("ping")

Example:
```json
{
  "type": "ping"
}
```

## StreamClientFrame

A JSON text frame the client sends on /v1/ws.

**Fields: StreamClientFrame**
One of:

StreamSubscribe: Start receiving events, for everything the key can see or a narrower set. Subscriptions accumulate.
- `type` ("subscribe")
- `inbox_ids` (string[], optional): Up to 32 inbox ids, all of them the key's.
- `event_types` (("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): Only these event types; absent or empty means all.
- `last_event_id` (string, optional): Replay every event after this one (up to 100, filtered by the subscription) before live events. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`

StreamUnsubscribe: Stop receiving events: everything, or specific inboxes.
- `type` ("unsubscribe")
- `inbox_ids` (string[], optional): The inboxes to stop receiving for; absent or empty stops everything.

StreamPing: A keepalive the edge answers with pong without waking the stream; send one every 30 to 60 seconds through idle proxies.
- `type` ("ping")

## StreamSubscribed

The subscription in force after a subscribe frame; empty arrays mean all.

**Fields: StreamSubscribed**
- `type` ("subscribed")
- `inbox_ids` (string[])
- `event_types` (string[])

Example:
```json
{
  "type": "subscribed",
  "inbox_ids": [
    "inb_01jc4q7w9k2m5n8p3r6t1v4x7z"
  ],
  "event_types": []
}
```

## StreamUnsubscribed

The answer to an unsubscribe frame, echoing the inboxes it named.

**Fields: StreamUnsubscribed**
- `type` ("unsubscribed")
- `inbox_ids` (string[])

Example:
```json
{
  "type": "unsubscribed",
  "inbox_ids": []
}
```

## StreamPong

The answer to a ping.

**Fields: StreamPong**
- `type` ("pong")

Example:
```json
{
  "type": "pong"
}
```

## StreamError

A frame that could not be honoured; the connection stays open.

**Fields: StreamError**
- `type` ("error")
- `message` (string)

Example:
```json
{
  "type": "error",
  "message": "last_event_id was not found on this account."
}
```

## StreamEvent

An event as the stream frames it: the webhook payload plus when it was pushed. `attempt` is always 1; a missed frame is recovered with `last_event_id`, not retried.

**Fields: StreamEvent**
One of:

(inline)
- `event` ("message.received")
- `event_id` (string): Stable across retries; deduplicate on it. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `occurred_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `inbox_id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `thread_id` (string): A thread identifier. Example: `thr_01jc5a1b2c3d4e5f6g7h8j9k0m`
- `message` (object)
  - `id` (string): A message identifier. Example: `msg_01jc5a6g7h8j9k0m1n2p3q4r5s`
  - `rfc_message_id` (string | null)
  - `from` (string): The sender's address. Example: `sam@example.com`
  - `to` (string): The inbox's address. Example: `concierge@doorman.example`
  - `header_to` (string | null): The first To header address, which may differ from the inbox when it was copied.
  - `delivery_role` ("to" | "cc" | "bcc" | null)
  - `cc` (string[])
  - `address_names` (object of string | null): Display names by address, for the addresses that carried one.
  - `subject` (string)
  - `body_text` (string): The plain-text body; empty when there was none.
  - `attachments` (Attachment[])
  - `raw_url` (string | null)
  - `received_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
  - `category` ("personal" | "automated" | "marketing" | "bounce" | "spam" | "malicious")
  - `auto_replyable` (boolean)
  - `verdict` ("clean" | "unverified" | "suspicious" | null)
  - `spam_score` (number | null)
  - `service` (object | null, optional): The outside service the message came from, when its sender was authenticated (DMARC passed) and it concerns an account there; null for any other mail. Events stored before the passport existed omit it.
    - `id` (string | null)
    - `domain` (string)
    - `signal` ("verification" | "welcome" | "receipt" | "password_reset" | "security" | "trial" | "cancellation" | "other")
  - `verification` (object | null, optional): The verification code or sign-in link the inbox read from the message, the same text `body_text` carries; null when it carries none. Events stored before the passport existed omit it.
    - `code` (string | null): A one-time code read from the message, or null. Example: `849204`
    - `link` (object | null)
      - `url` (string)
      - `host` (string)
      - `matches_sender` (boolean): True when the link's registrable domain is the authenticated sender's.
    - `verified` (boolean): Whether the sender was authenticated (DMARC passed). Treat an unverified code or link with suspicion.
    - `invitation` (boolean, optional): True when the link accepts an invitation to join the service. Events stored before invitations were read omit it.
    - `expires_at` (string (date-time)): When the verifications read stops serving it; the service's own expiry may be sooner. Example: `2026-11-05T10:05:00.000Z`
  - `risk` (RiskAssessment, optional): Doorman's assessment of the message (ADR-019): its own judgment, not text from the mail. Absent on events recorded before assessment existed and where the deployment does not assess.
  - `redaction` (Redaction, optional): What the account's healthcare guardrails found (ADR-027). When present with findings, `subject`, `body_text`, the attachments' `parsedText` and the verification code and link carry placeholders in place of them. Absent where no guardrail applies.
- `test` (true, optional): Present on the sample a test delivery sends; nothing was received or stored.
- `delivered_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `attempt` (1)

(inline)
- `event` ("message.sent")
- `event_id` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `occurred_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `inbox_id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `thread_id` (string): A thread identifier. Example: `thr_01jc5a1b2c3d4e5f6g7h8j9k0m`
- `message` (object)
  - `id` (string): A message identifier. Example: `msg_01jc5a6g7h8j9k0m1n2p3q4r5s`
  - `provider_message_id` (string | null)
  - `from` (string)
  - `to` (string[])
  - `cc` (string[])
  - `bcc` (string[])
  - `subject` (string)
  - `body_text` (string)
  - `attachments` (Attachment[])
  - `sent_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
  - `redaction` (Redaction, optional): What the account's healthcare guardrails found in what was sent (ADR-027). When present with findings, `subject`, `body_text` and the attachments' `parsedText` carry placeholders in place of them. Absent where no guardrail applies.
- `delivered_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `attempt` (1)

(inline)
- `event` ("thread.updated")
- `event_id` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `occurred_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `inbox_id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `thread_id` (string): A thread identifier. Example: `thr_01jc5a1b2c3d4e5f6g7h8j9k0m`
- `thread` (object)
  - `id` (string): A thread identifier. Example: `thr_01jc5a1b2c3d4e5f6g7h8j9k0m`
  - `is_read` (boolean)
  - `trashed_at` (string (date-time) | null)
  - `metadata` (Metadata)
  - `labels` (ThreadLabels)
  - `updated_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `delivered_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `attempt` (1)

(inline)
- `event` ("inbox.created")
- `event_id` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `occurred_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `inbox_id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `inbox` (object)
  - `id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
  - `address` (string)
  - `display_name` (string | null)
  - `external_id` (string | null)
  - `metadata` (Metadata)
- `delivered_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `attempt` (1)

(inline)
- `event` ("inbox.deleted")
- `event_id` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `occurred_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `inbox_id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `inbox` (object)
  - `id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
  - `address` (string)
  - `deleted_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `delivered_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `attempt` (1)

(inline)
- `event` ("delivery.failed")
- `event_id` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `occurred_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `inbox_id` (string | null)
- `delivery` (object)
  - `id` (string): A webhook delivery identifier. Example: `whd_01jc5f1a2b3c4d5e6f7g8h9j0k`
  - `event_id` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
  - `target` (object)
    - `kind` ("inbox" | "endpoint")
    - `id` (string)
  - `attempts` (integer)
  - `last_status_code` (integer | null)
  - `last_error` (string)
- `delivered_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `attempt` (1)

(inline)
- `event` ("message.held")
- `event_id` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `occurred_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `inbox_id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `message` (object)
  - `id` (string): A message identifier. Example: `msg_01jc5a6g7h8j9k0m1n2p3q4r5s`
  - `from` (string): The sender's address.
  - `held_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
  - `risk` (RiskAssessment)
- `delivered_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `attempt` (1)

(inline)
- `event` ("send.held")
- `event_id` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `occurred_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `inbox_id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `send` (object)
  - `id` (string): A held send's identifier. Example: `hsd_01jc5f1a2b3c4d5e6f7g8h9j0k`
  - `thread_id` (string | null): The thread a reply was written into; null for a new message.
  - `to` (string[])
  - `cc` (string[])
  - `bcc` (string[])
  - `requested_by` ("app" | "key")
  - `kind` ("held" | "draft"): Why it waits: `held` when the security policy kept a send, `draft` when it was written as a draft for the owner to send.
  - `held_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
  - `expires_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `delivered_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `attempt` (1)

(inline)
- `event` ("send.discarded")
- `event_id` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `occurred_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `inbox_id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `send` (object)
  - `id` (string): A held send's identifier. Example: `hsd_01jc5f1a2b3c4d5e6f7g8h9j0k`
  - `thread_id` (string | null): The thread a reply was written into; null for a new message.
  - `to` (string[])
  - `cc` (string[])
  - `bcc` (string[])
  - `requested_by` ("app" | "key")
  - `kind` ("held" | "draft"): Why it waits: `held` when the security policy kept a send, `draft` when it was written as a draft for the owner to send.
  - `reason` ("discarded" | "expired"): `discarded` by the owner, or `expired` because nobody decided in time.
  - `discarded_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `delivered_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `attempt` (1)

(inline)
- `event` ("sign_in.requested")
- `event_id` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `occurred_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `inbox_id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `sign_in` (object)
  - `id` (string): The identifier of one address's connection to one relying party. Example: `sig_01jc5f1a2b3c4d5e6f7g8h9j0k`
  - `service_id` (string): The service in the address's passport that the sign-in belongs to. Example: `svc_01jc5g2b3c4d5e6f7g8h9j0k1m`
  - `client` (object)
    - `id` (string): The relying party's client id: one this API issued, or the URL of the identity it published.
    - `name` (string): What the relying party calls itself. A label, never proof of who it is.
    - `host` (string): The host that identifies the relying party.
  - `requested_by` ("app" | "key" | "owner"): Who asked: a connected app, an API key, or the owner in the console.
  - `requested_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `delivered_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `attempt` (1)

(inline)
- `event` ("sign_in.completed")
- `event_id` (string): An event identifier. Example: `evt_01jc5e5f6g7h8j9k0m1n2p3q4r`
- `occurred_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `inbox_id` (string): An inbox identifier. Example: `inb_01jc4q7w9k2m5n8p3r6t1v4x7z`
- `sign_in` (object)
  - `id` (string): The identifier of one address's connection to one relying party. Example: `sig_01jc5f1a2b3c4d5e6f7g8h9j0k`
  - `service_id` (string): The service in the address's passport that the sign-in belongs to. Example: `svc_01jc5g2b3c4d5e6f7g8h9j0k1m`
  - `client` (object)
    - `id` (string): The relying party's client id: one this API issued, or the URL of the identity it published.
    - `name` (string): What the relying party calls itself. A label, never proof of who it is.
    - `host` (string): The host that identifies the relying party.
  - `completed_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `delivered_at` (string (date-time)) Example: `2026-11-05T10:05:00.000Z`
- `attempt` (1)

Example:
```json
{
  "event": "message.received",
  "event_id": "evt_01jc5e5f6g7h8j9k0m1n2p3q4r",
  "occurred_at": "2026-11-05T10:05:00.000Z",
  "inbox_id": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z",
  "thread_id": "thr_01jc5a1b2c3d4e5f6g7h8j9k0m",
  "message": {
    "id": "msg_01jc5a6g7h8j9k0m1n2p3q4r5s",
    "rfc_message_id": "<a1b2c3@example.com>",
    "from": "sam@example.com",
    "to": "concierge@doorman.example",
    "header_to": "concierge@doorman.example",
    "delivery_role": "to",
    "cc": [],
    "address_names": {
      "sam@example.com": "Sam Rivera"
    },
    "subject": "Invoice 2847",
    "body_text": "Hi, invoice 2847 is attached.",
    "attachments": [
      {
        "filename": "invoice.pdf",
        "contentType": "application/pdf",
        "sizeBytes": 45000,
        "url": "https://api.doorman.example/v1/attachments/msg_01jc5a6g7h8j9k0m1n2p3q4r5s/invoice.pdf",
        "parsedText": "Invoice 2847. Line 3: Setup fee, billed twice. Total 1,480.",
        "extractionMethod": "pdf"
      }
    ],
    "raw_url": "https://api.doorman.example/v1/messages/msg_01jc5a6g7h8j9k0m1n2p3q4r5s/raw",
    "received_at": "2026-11-05T10:05:00.000Z",
    "category": "personal",
    "auto_replyable": true,
    "verdict": "clean",
    "spam_score": null
  },
  "delivered_at": "2026-11-05T10:05:00.000Z",
  "attempt": 1
}
```

## StreamServerFrame

A JSON text frame the server sends on /v1/ws.

**Fields: StreamServerFrame**
One of:

StreamSubscribed: The subscription in force after a subscribe frame; empty arrays mean all.
- `type` ("subscribed")
- `inbox_ids` (string[])
- `event_types` (string[])

StreamUnsubscribed: The answer to an unsubscribe frame, echoing the inboxes it named.
- `type` ("unsubscribed")
- `inbox_ids` (string[])

StreamPong: The answer to a ping.
- `type` ("pong")

StreamError: A frame that could not be honoured; the connection stays open.
- `type` ("error")
- `message` (string)

StreamEvent: An event as the stream frames it: the webhook payload plus when it was pushed. `attempt` is always 1; a missed frame is recovered with `last_event_id`, not retried.
