POST /api/auth/discover — given a login email, return a per-organization BYO-OIDC start URL if its verified domain maps to an enabled IdP, else `None` (ADR 0031 D2a). ALWAYS 200 and non-enumerating: it never reveals whether an email or account exists. It does NOT call `normalize_email` (which errors on malformed) — the service normalizes and returns `None` for malformed input.
const url = 'https://example.com/api/auth/discover';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"email":"example"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/auth/discover \ --header 'Content-Type: application/json' \ --data '{ "email": "example" }'Request Bodyrequired
Section titled “Request Bodyrequired”object
Examplegenerated
{ "email": "example"}Responses
Section titled “Responses”SSO redirect URL for the email’s org, or null
object
The per-organization BYO-OIDC start URL, or null when the email’s domain
maps to no enabled IdP.
Examplegenerated
{ "sso_redirect": "example"}Structured client error
The canonical JSON body of every error response — the single source of truth
the frontend binds to. Every AppError serializes as this exact shape, and
the generated OpenAPI component ApiErrorBody (with its ErrorCode enum) is
what the frontend error schema is generated from, so there is no hand-written
error schema on either end.
object
Machine-readable, stable error code.
Present only on a quota-exceeded 403 — the inline upgrade-CTA payload.
object
The entitlement feature key that was hit, e.g. apps.max_count.
The plan’s limit for this key.
Where to send the user to upgrade.
Current usage (count or bytes, per the key).
Human-readable message (the server’s English text; the client may localize
by code).
Example
{ "code": "not_found"}Structured server error
The canonical JSON body of every error response — the single source of truth
the frontend binds to. Every AppError serializes as this exact shape, and
the generated OpenAPI component ApiErrorBody (with its ErrorCode enum) is
what the frontend error schema is generated from, so there is no hand-written
error schema on either end.
object
Machine-readable, stable error code.
Present only on a quota-exceeded 403 — the inline upgrade-CTA payload.
object
The entitlement feature key that was hit, e.g. apps.max_count.
The plan’s limit for this key.
Where to send the user to upgrade.
Current usage (count or bytes, per the key).
Human-readable message (the server’s English text; the client may localize
by code).
Example
{ "code": "not_found"}