OAuth

Authorization, token exchange and discovery for scoped third-party apps.

Discover authorization

GET/.well-known/oauth-authorization-server

Access public: no credential.

Issuer metadata for authorization-code PKCE, rotating refresh tokens, Client ID Metadata Documents and dynamic client registration.

Public OAuth protocol operation: omit API bearer credentials and cookies. Approval still requires explicit browser consent.

Also available as client.oauth.metadata in Python.

Answers 200: Authorization-server metadata.

Response 200: OAuthServerMetadata

OAuth authorization-server discovery.

  • issuerstringrequired

  • authorization_endpointstringrequired

  • token_endpointstringrequired

  • registration_endpointstringrequired

  • response_types_supported"code"[]required

  • grant_types_supported("authorization_code" | "refresh_token")[]required

  • code_challenge_methods_supported"S256"[]required

  • token_endpoint_auth_methods_supported("none" | "client_secret_post")[]required

  • 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")[]required

  • authorization_response_iss_parameter_supportedtruerequired

  • client_id_metadata_document_supportedtruerequired

Errors
StatusErrorMeaning
500internal_errorSomething went wrong on the server.
curl -s "https://api.doorman.fyi/.well-known/oauth-authorization-server"

Discover the API resource

GET/.well-known/oauth-protected-resource

Access public: no credential.

The Inbox REST API resource identifier, authorization server and supported scopes.

Public OAuth protocol operation: omit API bearer credentials and cookies. Approval still requires explicit browser consent.

Also available as client.oauth.resource in Python.

Answers 200: Protected-resource metadata.

Response 200: OAuthResourceMetadata

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

  • resourcestringrequired

  • authorization_serversstring[]required

  • scopes_supported("account:read" | "inboxes:read" | "inboxes:write" | "mail:read" | "mail:write" | "mail:send" | "mail:draft" | "events:read" | "webhooks:manage" | "rules:manage")[]required

  • bearer_methods_supported"header"[]required

Errors
StatusErrorMeaning
500internal_errorSomething went wrong on the server.
curl -s "https://api.doorman.fyi/.well-known/oauth-protected-resource"

Discover the MCP resource

GET/.well-known/oauth-protected-resource/mcp

Access public: no credential.

The MCP resource identifier, authorization server and the permissions an agent needs by default; the other app permissions remain requestable. MCP tokens cannot be used directly at REST endpoints.

Public OAuth protocol operation: omit API bearer credentials and cookies. Approval still requires explicit browser consent.

Also available as client.oauth.mcp_resource in Python.

Answers 200: MCP protected-resource metadata.

Response 200: OAuthResourceMetadata

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

  • resourcestringrequired

  • authorization_serversstring[]required

  • scopes_supported("account:read" | "inboxes:read" | "inboxes:write" | "mail:read" | "mail:write" | "mail:send" | "mail:draft" | "events:read" | "webhooks:manage" | "rules:manage")[]required

  • bearer_methods_supported"header"[]required

Errors
StatusErrorMeaning
500internal_errorSomething went wrong on the server.
curl -s "https://api.doorman.fyi/.well-known/oauth-protected-resource/mcp"

Begin app authorization

GET/oauth/authorize

Access public: no credential.

Validate a client, its redirect, the resource, the requested scopes and the S256 challenge before redirecting to console consent. A client named by a metadata document URL has that document read and checked first. Unrecognized parameters are ignored. Invalid requests never redirect.

Public OAuth protocol operation: omit API bearer credentials and cookies. Approval still requires explicit browser consent.

Also available as client.oauth.authorize in Python.

Parameters
  • response_type"code", in queryrequired

    Always code.

  • client_idstring | string, in queryrequired

    The client: an id this API issued, or the URL of the client's Client ID Metadata Document. Example: app_01jc5f1a2b3c4d5e6f7g8h9j0k.

  • redirect_uristring, in queryrequired

    A redirect the client registered. A loopback redirect matches on any port; every other redirect matches exactly.

  • resourcestring, in queryrequired

    The API origin for REST access, or the API origin followed by /mcp for the MCP endpoint.

  • scopestring, in queryoptional

    Space-separated permissions. When omitted, the request is for the default agent permissions the client may hold.

  • statestring, in queryoptional

    An opaque value returned unchanged with the answer. A client that sends none gets none back.

  • code_challengestring, in queryrequired

    The S256 PKCE challenge of the verifier the client keeps.

  • code_challenge_method"S256", in queryrequired

    Always S256.

Answers 303: Continue to console consent.

Response header Location: The console consent page.

Answers 400: The OAuth request was refused.

Response 400: OAuthError

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

  • error"invalid_request" | "invalid_client" | "invalid_grant" | "invalid_scope" | "unsupported_grant_type" | "temporarily_unavailable" | "invalid_redirect_uri" | "invalid_client_metadata"required

  • error_descriptionstringoptional

Answers 401: Client authentication failed.

Response 401: OAuthError

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

  • error"invalid_request" | "invalid_client" | "invalid_grant" | "invalid_scope" | "unsupported_grant_type" | "temporarily_unavailable" | "invalid_redirect_uri" | "invalid_client_metadata"required

  • error_descriptionstringoptional

Answers 429: The request or allocation limit was reached.

Response 429: OAuthError

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

  • error"invalid_request" | "invalid_client" | "invalid_grant" | "invalid_scope" | "unsupported_grant_type" | "temporarily_unavailable" | "invalid_redirect_uri" | "invalid_client_metadata"required

  • error_descriptionstringoptional

Errors
StatusErrorMeaning
500internal_errorSomething went wrong on the server.

Build the authorization URL with a fresh S256 challenge and saved state, then navigate in the user's browser. Do not fetch this route with an API credential or automatically approve the redirect. See the TypeScript flow and Python flow.

Exchange or refresh tokens

POST/oauth/token

Access public: no credential.

Form-encoded code exchange with PKCE or single-use refresh rotation. Reuse of a consumed credential revokes its token family. A connection stays alive while it is refreshed, up to an absolute limit.

Public OAuth protocol operation: omit API bearer credentials and cookies. Approval still requires explicit browser consent.

Also available as client.oauth.token in Python.

Request body (application/x-www-form-urlencoded): OAuthTokenRequest

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

  • grant_type"authorization_code" | "refresh_token"required

  • client_idstring | stringrequired

    A client id this API issued, or the URL of the client's Client ID Metadata Document. Example: app_01jc5f1a2b3c4d5e6f7g8h9j0k

  • client_secretstringoptional

  • resourcestringrequired

  • codestringoptional

  • redirect_uristringoptional

  • code_verifierstringoptional

  • refresh_tokenstringoptional

  • scopestringoptional

Answers 200: The bearer and rotating refresh tokens.

Response 200: OAuthTokens

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

  • access_tokenstringrequired

  • token_type"Bearer"required

  • expires_inintegerrequired

  • refresh_tokenstringrequired

  • scopestringrequired

Answers 400: The OAuth request was refused.

Response 400: OAuthError

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

  • error"invalid_request" | "invalid_client" | "invalid_grant" | "invalid_scope" | "unsupported_grant_type" | "temporarily_unavailable" | "invalid_redirect_uri" | "invalid_client_metadata"required

  • error_descriptionstringoptional

Answers 401: Client authentication failed.

Response 401: OAuthError

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

  • error"invalid_request" | "invalid_client" | "invalid_grant" | "invalid_scope" | "unsupported_grant_type" | "temporarily_unavailable" | "invalid_redirect_uri" | "invalid_client_metadata"required

  • error_descriptionstringoptional

Answers 429: The request or allocation limit was reached.

Response 429: OAuthError

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

  • error"invalid_request" | "invalid_client" | "invalid_grant" | "invalid_scope" | "unsupported_grant_type" | "temporarily_unavailable" | "invalid_redirect_uri" | "invalid_client_metadata"required

  • error_descriptionstringoptional

Errors
StatusErrorMeaning
500internal_errorSomething went wrong on the server.
curl -s -X POST "https://api.doorman.fyi/oauth/token" \
  --data-urlencode 'grant_type=authorization_code' \
  --data-urlencode 'client_id=app_01jc5f1a2b3c4d5e6f7g8h9j0k' \
  --data-urlencode 'resource=https://api.doorman.example' \
  --data-urlencode 'code=replace-with-the-validated-callback-code' \
  --data-urlencode 'redirect_uri=https://agent.example.com/callback' \
  --data-urlencode 'code_verifier=replace-with-the-verifier-saved-before-the-redirect'

Register a public client dynamically

POST/oauth/register

Access public: no credential.

Create an unverified public client with bounded lifetime and quotas. Metadata this API does not use is ignored and the answer states what was registered. Registration alone grants no account access.

Public OAuth protocol operation: omit API bearer credentials and cookies. Approval still requires explicit browser consent.

Also available as client.oauth.register in Python.

Request body (application/json): 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.

  • client_namestringoptional

  • redirect_urisstring[]required

  • token_endpoint_auth_methodstringoptional

  • grant_typesstring[]optional

  • response_typesstring[]optional

  • scopestringoptional

Answers 201: The public client.

Response 201: RegisteredOAuthClient

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

  • client_idstringrequired

    An OAuth client identifier. Example: app_01jc5f1a2b3c4d5e6f7g8h9j0k

  • client_namestringrequired

  • redirect_urisstring[]required

  • token_endpoint_auth_method"none"required

  • grant_types("authorization_code" | "refresh_token")[]required

  • response_types"code"[]required

  • scopestringrequired

  • client_id_issued_atintegerrequired

  • client_id_expires_atintegerrequired

Answers 400: The OAuth request was refused.

Response 400: OAuthError

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

  • error"invalid_request" | "invalid_client" | "invalid_grant" | "invalid_scope" | "unsupported_grant_type" | "temporarily_unavailable" | "invalid_redirect_uri" | "invalid_client_metadata"required

  • error_descriptionstringoptional

Answers 401: Client authentication failed.

Response 401: OAuthError

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

  • error"invalid_request" | "invalid_client" | "invalid_grant" | "invalid_scope" | "unsupported_grant_type" | "temporarily_unavailable" | "invalid_redirect_uri" | "invalid_client_metadata"required

  • error_descriptionstringoptional

Answers 429: The request or allocation limit was reached.

Response 429: OAuthError

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

  • error"invalid_request" | "invalid_client" | "invalid_grant" | "invalid_scope" | "unsupported_grant_type" | "temporarily_unavailable" | "invalid_redirect_uri" | "invalid_client_metadata"required

  • error_descriptionstringoptional

Errors
StatusErrorMeaning
500internal_errorSomething went wrong on the server.
curl -s -X POST "https://api.doorman.fyi/oauth/register" \
  -H "content-type: application/json" \
  -d '{
    "client_name": "Mail triage",
    "redirect_uris": [
      "https://agent.example.com/callback"
    ],
    "scope": "mail:read"
  }'

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