Assistant

Ask Doorman, the console's assistant. Console sessions only.

Ask Doorman

POST/v1/assistant/chat

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

One turn of the console's assistant. The answer is a text/event-stream of named events (see AssistantEvent): text deltas, the read tools that ran, a proposal the person must confirm (which ends the turn), done, or error. Read tools run with the session's account; mutations never run here, they come back as proposals the console runs after confirmation.

OAuth: not available to delegated app tokens.

Organizations: every member's console session may call it. See Roles and permissions.

Parameters
  • x-doorman-domain-proposals"1", in headeroptional

    The browser confirms it preserves domainId when running inbox proposals. Without this capability, a domain-targeted proposal ends with console_update_required instead of a proposal.

  • x-doorman-console-mode"simple" | "developer", in headeroptional

    The console the person is in. With simple the assistant speaks the simple console's plain words (an address, a conversation), keeps keys, webhooks and the other developer tools out of its answers unless the person asks for them, and follows the three setup steps: choose the address, connect the agent, send a test email. Without the header, or with any other value, it answers as the developer console's assistant.

Request body (application/json): AssistantChatRequest

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

  • messagesAssistantMessage[]required

    At most 40 messages; the last one must come from the person or be a tool result.

  • contextobjectrequired

  • pagestringrequired

    The console path the person is on. Example: /console/inboxes

  • inboxIdstringoptional

    The inbox the page is about, when there is one.

  • stageAssistantStageoptional

Answers 200 as text/event-stream: The turn, as server-sent events.

Events in the stream: AssistantEvent

One of:

Alternative 1

  • event"text"required

  • dataobjectrequired

  • deltastringrequired

Alternative 2

  • event"tool"required

  • dataobjectrequired

  • 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"required

  • summarystringrequired

Alternative 3

Alternative 4

Alternative 5

  • event"done"required

  • dataobjectrequired

Alternative 6

  • event"error"required

  • dataobjectrequired

  • codestringrequired

  • messagestringrequired

Errors
StatusErrorMeaning
400validation_errorA field is missing or invalid; the message names it.
400invalid_jsonThe request body is not JSON.
401unauthorizedThe credential was missing, malformed, revoked or belongs to an inactive account.
401session_invalidThe console session token could not be verified.
401session_expiredThe console session token has expired.
401session_claims_missingThe session token does not carry a verified email address.
403session_requiredAccount keys, developer apps, relying parties, installations, consent, approving a sign-in and the assistant require a console session. So does loosening the security policy, trusting a sender, releasing held mail, allowing a sign-in, letting agents sign in to new services alone or telling a service who owns an agent, unless the account allows its account keys to.
403account_suspendedThe account is suspended.
403account_deletedThe account was deleted.
403member_deactivatedThe signed-in person's access to the organization was deactivated, or they were removed from it. It holds from their next request, whatever their session token says. An admin of the organization can let a deactivated member in again.
409account_mismatchThe request named another account in x-doorman-account than the one its credential acts for, as happens when the console's organization was switched in another tab. Reload and try again.
429rate_limit_exceededA per-inbox or per-account rate limit; Retry-After and resetsAt say when to try again.
500internal_errorSomething went wrong on the server.
503assistant_unavailableThe assistant is not configured for this deployment.
curl -s -X POST "https://api.doorman.fyi/v1/assistant/chat" \
  -H "authorization: Bearer $DOORMAN_API_KEY" \
  -H "content-type: application/json" \
  -d '{
    "messages": [
      {
        "role": "user",
        "content": "How many threads are unread?"
      }
    ],
    "context": {
      "page": "/console/inboxes",
      "inboxId": "inb_01jc4q7w9k2m5n8p3r6t1v4x7z"
    }
  }'

Up Down to move, Enter to open, Esc to close