Docs
Open the console →
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
NameInRequiredDescription
orgbodyyesOrganization name.
namebodyyesYour name.
emailbodyyesWork email (globally unique today).
passwordbodyyesAt least 8 characters.
Example request
json
{ "org": "Acme", "name": "Ada Lovelace", "email": "ada.lovelace@example.com", "password": "correct horse" }
Example response
json
{ "ok": true }
Errors
StatusWhen
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
NameInRequiredDescription
emailbodyyesAccount email.
passwordbodyyesAccount password.
Example request
json
{ "email": "ada.lovelace@example.com", "password": "correct horse battery" }
Example response
json
// No MFA:
{ "ok": true }
// MFA enabled:
{ "ok": true, "mfaRequired": true, "mfaToken": "…" }
Errors
StatusWhen
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
json
{ "ok": true }
GET/api/auth/meSession or Bearer

Return the current user, including effective capabilities.

Example response
json
{ "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
StatusWhen
401Not signed in / invalid token.
POST/api/auth/mfa/setupSession

Begin TOTP enrollment; returns a secret and an otpauth URL.

Example response
json
{ "secret": "BASE32…", "otpauthUrl": "otpauth://totp/CloudControl:…" }
Errors
StatusWhen
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
NameInRequiredDescription
codebodyyesCurrent 6-digit authenticator code.
Example request
json
{ "code": "123456" }
Example response
json
{ "ok": true, "recoveryCodes": ["…", "… (8 total)"] }
Errors
StatusWhen
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
NameInRequiredDescription
mfaTokenbodyyesSingle-use token from login.
codebodyyesAuthenticator or recovery code.
Example request
json
{ "mfaToken": "…", "code": "123456" }
Example response
json
{ "ok": true }
Errors
StatusWhen
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
NameInRequiredDescription
codebodyyesAuthenticator or recovery code.
Example response
json
{ "ok": true }
Errors
StatusWhen
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
{ "enabled": true }
Errors
StatusWhen
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
NameInRequiredDescription
emailbodyyesAccount email.
Example request
json
{ "email": "ada.lovelace@example.com" }
Example response
json
{ "ok": true }
Errors
StatusWhen
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
NameInRequiredDescription
tokenbodyyesSingle-use token from the reset link.
passwordbodyyesNew password, at least 8 characters.
Example request
json
{ "token": "…", "password": "new-password" }
Example response
json
{ "ok": true }
Errors
StatusWhen
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
NameInRequiredDescription
emailbodynoWork email (its domain is matched).
slugbodynoOrganization slug (alternative to email).
Example request
json
{ "email": "user@acme.io" }
Example response
json
{ "ok": true, "authorizeUrl": "https://idp.example.com/authorize?…" }
Errors
StatusWhen
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.