Docs / API reference / API reference: Auth API reference API reference: Auth Cloud Control authentication API: register, login, logout, me, MFA (setup/enable/verify/disable/status), password reset, and OIDC single sign-on start and callback.
The authentication surface. Most routes here are public (they are what you use before you have a session); MFA management requires a session.
POST /api/auth/registerPublic
Create a new organization and its Owner, and sign in.
Parameters
Name In Required Description orgbody yes Organization name. namebody yes Your name. emailbody yes Work email (globally unique today). passwordbody yes At least 8 characters.
Example request
json Copy
{ "org": "Acme", "name": "Ada Lovelace", "email": "ada.lovelace@example.com", "password": "correct horse" }Example response
Errors
Status When 400Missing/invalid org, name, email or a password under 8 chars. 409An account with this email already exists. 503Database unavailable.
POST /api/auth/loginPublic
Sign in with email and password. Sets a session cookie, or returns an MFA challenge.
Parameters
Name In Required Description emailbody yes Account email. passwordbody yes Account password.
Example request
json Copy
{ "email": "ada.lovelace@example.com", "password": "correct horse battery" }Example response
json Copy
// No MFA:
{ "ok": true }
// MFA enabled:
{ "ok": true, "mfaRequired": true, "mfaToken": "…" }Errors
Status When 400Missing email or password. 401Email or password incorrect (identical for both). 403The organization is suspended. 429Locked after 5 failures; carries Retry-After. 503Database unavailable.
POST /api/auth/logoutSession
Destroy the current session and clear the cookie.
Example response
GET /api/auth/meSession or Bearer
Return the current user, including effective capabilities.
Example response
json Copy
{ "user": { "id": 1, "orgId": 1, "name": "Ada Lovelace", "email": "ada.lovelace@example.com",
"role": "Org Admin", "orgName": "Acme", "orgSlug": "acme",
"isPlatformAdmin": false, "isOwner": true,
"capabilities": ["read","mutate_infra","manage_cloud_accounts","manage_users_sso","manage_billing_transfer"] } }Errors
Status When 401Not signed in / invalid token.
POST /api/auth/mfa/setupSession
Begin TOTP enrollment; returns a secret and an otpauth URL.
Example response
json Copy
{ "secret": "BASE32…", "otpauthUrl": "otpauth://totp/CloudControl:…" }Errors
Status When 401Not signed in. 409MFA is already enabled — disable it first to re-enroll.
POST /api/auth/mfa/enableSession
Confirm a TOTP code to enable MFA; returns one-time recovery codes.
Parameters
Name In Required Description codebody yes Current 6-digit authenticator code.
Example request
json Copy
{ "code": "123456" }Example response
json Copy
{ "ok": true, "recoveryCodes": ["…", "… (8 total)"] }Errors
Status When 400Missing code, no pending secret, or the code didn't match. 401Not signed in. 409MFA is already enabled.
POST /api/auth/mfa/verifyPublic (MFA challenge)
Exchange a login MFA challenge token plus a code for a session.
Parameters
Name In Required Description mfaTokenbody yes Single-use token from login. codebody yes Authenticator or recovery code.
Example request
json Copy
{ "mfaToken": "…", "code": "123456" }Example response
Errors
Status When 400Missing token or code. 401Invalid/expired challenge or wrong code (identical message). 429Locked after 5 wrong codes; carries Retry-After.
POST /api/auth/mfa/disableSession
Disable MFA, proving possession with a current authenticator or recovery code.
Parameters
Name In Required Description codebody yes Authenticator or recovery code.
Example response
Errors
Status When 400Missing code, MFA not enabled, or the code didn't match. 401Not signed in.
GET /api/auth/mfa/statusSession
Report whether MFA is enabled for the current user.
Example response
json Copy
{ "enabled": true }Errors
Status When 401Not signed in.
POST /api/auth/forgotPublic
Request a password-reset link. Enumeration-safe — the response is identical whether or not the email exists.
Parameters
Name In Required Description emailbody yes Account email.
Example request
json Copy
{ "email": "ada.lovelace@example.com" }Example response
Errors
Status When 400Malformed email. 503Database unavailable.
POST /api/auth/resetPublic (reset token)
Set a new password with a single-use reset token; revokes all existing sessions.
Parameters
Name In Required Description tokenbody yes Single-use token from the reset link. passwordbody yes New password, at least 8 characters.
Example request
json Copy
{ "token": "…", "password": "new-password" }Example response
Errors
Status When 400Password under 8 chars, or an invalid/expired/used token (identical message). 503Database unavailable.
POST /api/auth/oidc/startPublic
Begin SSO: match an email domain or org slug to an enabled OIDC config and return the IdP authorize URL.
Parameters
Name In Required Description emailbody no Work email (its domain is matched). slugbody no Organization slug (alternative to email).
Example request
json Copy
{ "email": "user@acme.io" }Example response
json Copy
{ "ok": true, "authorizeUrl": "https://idp.example.com/authorize?…" }Errors
Status When 400Neither email nor slug provided, or malformed email. 404No enabled SSO for that domain or org (identical whether or not the org exists). 503Database unavailable.
GET /api/auth/oidc/callbackPublic (IdP redirect)
OIDC redirect target. Exchanges the code, verifies the RS256 ID token against your JWKS, JIT-provisions new users with the org default role, and sets a session. Redirects the browser — not called directly.
Previous
← API reference: introduction
Next
API reference: Organization & users →