Skip to content
MiniMailer
Docs
Toggle sidebar
Quick links
Documentation
Knowledge Base
API Reference
Changelog
No results found

O Auth

Public OAuth 2.1 endpoints and discovery metadata for MCP clients (apex host, not the api. subdomain).

POST /oauth/register

Register an OAuth client (Dynamic Client Registration)

RFC 7591 Dynamic Client Registration for MCP OAuth clients. Public and unauthenticated, but rate-limited: a redirect URI must be on an allowed first-party origin, and the registered client is public (no secret, token_endpoint_auth_method: none) and constrained to the mcp:use scope. It is redeemed with PKCE at the token endpoint, or through the agent claim ceremony (/oauth/agent/identity + grant_type=claim): the returned grant_types list both authorization_code and the device authorization grant that backs the claim.

POST /oauth/register
curl -X POST https://api.minimailer.app/oauth/register \
  -H "Authorization: Bearer $MINIMAILER_API_TOKEN" \
  -H "Accept: application/vnd.api+json"

Responses

Status
Description
201 Client registered.
400 Invalid client metadata or a redirect URI on a disallowed origin.
POST /oauth/token

Exchange an authorization grant for an access token

OAuth 2.1 token endpoint. Exchanges an authorization code (with PKCE) or a refresh token for a bearer access token. Public — a dynamically registered client is authenticated by its PKCE code_verifier, not a secret.

POST /oauth/token
curl -X POST https://api.minimailer.app/oauth/token \
  -H "Authorization: Bearer $MINIMAILER_API_TOKEN" \
  -H "Accept: application/vnd.api+json"

Responses

Status
Description
200 Access token issued.
400 Invalid or unsupported grant.
401 Client authentication failed.
POST /oauth/revoke

Revoke an access or refresh token

RFC 7009 token revocation. Revokes the supplied token and the rest of its grant: an access token takes its refresh token with it, and a refresh token takes the access token it belongs to. Public — a client registered without a secret is identified by client_id.

A token that is unknown, malformed, expired, already revoked, or issued to a different client is answered 200 without any change, exactly as RFC 7009 §2.2 requires, so the endpoint never reveals whether a token exists.

POST /oauth/revoke
curl -X POST https://api.minimailer.app/oauth/revoke \
  -H "Authorization: Bearer $MINIMAILER_API_TOKEN" \
  -H "Accept: application/vnd.api+json"

Responses

Status
Description
200 The token is revoked, or was already unusable. Empty body.
422 The request was malformed — `token` was missing or not a string. ErrorDocument
POST /oauth/agent/identity

Start an agent claim (auth.md service_auth)

The identity_endpoint of the auth.md agent_auth block. An agent that holds a registered client starts a claim here and receives a claim_token and a short user_code. It shows the code to the account owner, who signs in at verification_uri and approves or denies it; meanwhile the agent polls the token endpoint with grant_type=claim. This is the OAuth 2.0 device authorization grant (RFC 8628) under the auth.md request and response names: claim_token is the device code. Public, unauthenticated and rate-limited. No account is created: only an existing, signed-in account can approve.

POST /oauth/agent/identity
curl -X POST https://api.minimailer.app/oauth/agent/identity \
  -H "Authorization: Bearer $MINIMAILER_API_TOKEN" \
  -H "Accept: application/vnd.api+json"

Responses

Status
Description
200 Claim started. Poll the token endpoint no faster than `interval`.
400 The client cannot use this flow or requested an unknown scope.
401 Unknown client.
422 The request was malformed — `type` is not `service_auth` or `client_id` is missing. ErrorDocument
POST /oauth/agent/events

Notify the server of an agent auth event

The events_endpoint of the auth.md agent_auth block. This server issues no identity assertions, so the one event it accepts concerns a token it issued: a token-revoked event revokes that access or refresh token, exactly as POST /oauth/revoke would. The answer is the same whether or not the token existed, so the endpoint reveals nothing about it.

POST /oauth/agent/events
curl -X POST https://api.minimailer.app/oauth/agent/events \
  -H "Authorization: Bearer $MINIMAILER_API_TOKEN" \
  -H "Accept: application/vnd.api+json"

Responses

Status
Description
202 Event received and applied.
422 The request was malformed — unknown event `type` or missing `token`. ErrorDocument
GET /.well-known/oauth-authorization-server

OAuth 2.0 Authorization Server Metadata (RFC 8414)

Public discovery document describing the OAuth authorization server.

GET /.well-known/oauth-authorization-server
curl -X GET https://api.minimailer.app/.well-known/oauth-authorization-server \
  -H "Authorization: Bearer $MINIMAILER_API_TOKEN" \
  -H "Accept: application/vnd.api+json"

Responses

Status
Description
200 Authorization server metadata.
GET /.well-known/oauth-protected-resource

OAuth 2.0 Protected Resource Metadata (RFC 9728)

Public discovery document describing this protected resource and its authorization servers.

GET /.well-known/oauth-protected-resource
curl -X GET https://api.minimailer.app/.well-known/oauth-protected-resource \
  -H "Authorization: Bearer $MINIMAILER_API_TOKEN" \
  -H "Accept: application/vnd.api+json"

Responses

Status
Description
200 Protected resource metadata.