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.
issuerstringrequiredauthorization_endpointstringrequiredtoken_endpointstringrequiredregistration_endpointstringrequiredresponse_types_supported"code"[]requiredgrant_types_supported("authorization_code" | "refresh_token")[]requiredcode_challenge_methods_supported"S256"[]requiredtoken_endpoint_auth_methods_supported("none" | "client_secret_post")[]requiredscopes_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")[]requiredauthorization_response_iss_parameter_supportedtruerequiredclient_id_metadata_document_supportedtruerequired
Errors
| Status | Error | Meaning |
|---|---|---|
| 500 | internal_error | Something went wrong on the server. |
curl -s "https://api.doorman.fyi/.well-known/oauth-authorization-server"const response = await fetch("https://api.doorman.fyi/.well-known/oauth-authorization-server", {
headers: {
},
redirect: "manual", credentials: "omit",
});
if (!response.ok) throw new Error(`The API answered ${response.status}.`);
const result = await response.json();import requests
response = requests.get(
"https://api.doorman.fyi/.well-known/oauth-authorization-server",
headers={},
allow_redirects=False, timeout=30,
)
response.raise_for_status()
result = response.json()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.
resourcestringrequiredauthorization_serversstring[]requiredscopes_supported("account:read" | "inboxes:read" | "inboxes:write" | "mail:read" | "mail:write" | "mail:send" | "mail:draft" | "events:read" | "webhooks:manage" | "rules:manage")[]requiredbearer_methods_supported"header"[]required
Errors
| Status | Error | Meaning |
|---|---|---|
| 500 | internal_error | Something went wrong on the server. |
curl -s "https://api.doorman.fyi/.well-known/oauth-protected-resource"const response = await fetch("https://api.doorman.fyi/.well-known/oauth-protected-resource", {
headers: {
},
redirect: "manual", credentials: "omit",
});
if (!response.ok) throw new Error(`The API answered ${response.status}.`);
const result = await response.json();import requests
response = requests.get(
"https://api.doorman.fyi/.well-known/oauth-protected-resource",
headers={},
allow_redirects=False, timeout=30,
)
response.raise_for_status()
result = response.json()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.
resourcestringrequiredauthorization_serversstring[]requiredscopes_supported("account:read" | "inboxes:read" | "inboxes:write" | "mail:read" | "mail:write" | "mail:send" | "mail:draft" | "events:read" | "webhooks:manage" | "rules:manage")[]requiredbearer_methods_supported"header"[]required
Errors
| Status | Error | Meaning |
|---|---|---|
| 500 | internal_error | Something went wrong on the server. |
curl -s "https://api.doorman.fyi/.well-known/oauth-protected-resource/mcp"const response = await fetch("https://api.doorman.fyi/.well-known/oauth-protected-resource/mcp", {
headers: {
},
redirect: "manual", credentials: "omit",
});
if (!response.ok) throw new Error(`The API answered ${response.status}.`);
const result = await response.json();import requests
response = requests.get(
"https://api.doorman.fyi/.well-known/oauth-protected-resource/mcp",
headers={},
allow_redirects=False, timeout=30,
)
response.raise_for_status()
result = response.json()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"requiredclient_idstring | stringrequiredA client id this API issued, or the URL of the client's Client ID Metadata Document. Example:
app_01jc5f1a2b3c4d5e6f7g8h9j0kclient_secretstringoptionalresourcestringrequiredcodestringoptionalredirect_uristringoptionalcode_verifierstringoptionalrefresh_tokenstringoptionalscopestringoptional
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_tokenstringrequiredtoken_type"Bearer"requiredexpires_inintegerrequiredrefresh_tokenstringrequiredscopestringrequired
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"requirederror_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"requirederror_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"requirederror_descriptionstringoptional
Errors
| Status | Error | Meaning |
|---|---|---|
| 500 | internal_error | Something 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'const response = await fetch("https://api.doorman.fyi/oauth/token", {
method: "POST",
headers: {
"content-type": "application/x-www-form-urlencoded",
},
redirect: "manual", credentials: "omit",
body: new URLSearchParams({
"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"
}),
});
if (!response.ok) throw new Error(`The API answered ${response.status}.`);
const result = await response.json();import requests
response = requests.post(
"https://api.doorman.fyi/oauth/token",
headers={},
data={
"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",
},
allow_redirects=False, timeout=30,
)
response.raise_for_status()
result = response.json()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_namestringoptionalredirect_urisstring[]requiredtoken_endpoint_auth_methodstringoptionalgrant_typesstring[]optionalresponse_typesstring[]optionalscopestringoptional
Answers 201: The public client.
Response 201: RegisteredOAuthClient
A bounded public client registration. No client secret or registration management token is issued.
client_idstringrequiredAn OAuth client identifier. Example:
app_01jc5f1a2b3c4d5e6f7g8h9j0kclient_namestringrequiredredirect_urisstring[]requiredtoken_endpoint_auth_method"none"requiredgrant_types("authorization_code" | "refresh_token")[]requiredresponse_types"code"[]requiredscopestringrequiredclient_id_issued_atintegerrequiredclient_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"requirederror_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"requirederror_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"requirederror_descriptionstringoptional
Errors
| Status | Error | Meaning |
|---|---|---|
| 500 | internal_error | Something 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"
}'const response = await fetch("https://api.doorman.fyi/oauth/register", {
method: "POST",
headers: {
"content-type": "application/json",
},
redirect: "manual", credentials: "omit",
body: JSON.stringify({
"client_name": "Mail triage",
"redirect_uris": [
"https://agent.example.com/callback"
],
"scope": "mail:read"
}),
});
if (!response.ok) throw new Error(`The API answered ${response.status}.`);
const result = await response.json();import requests
response = requests.post(
"https://api.doorman.fyi/oauth/register",
headers={},
json={
"client_name": "Mail triage",
"redirect_uris": ["https://agent.example.com/callback"],
"scope": "mail:read",
},
allow_redirects=False, timeout=30,
)
response.raise_for_status()
result = response.json()
