Begin TOTP enrollment
POST /account/security/2fa
Generates a fresh shared secret + returns the base32 form plus the otpauth:// URI for QR rendering. The row is persisted UNCONFIRMED — login flow is NOT yet gated. Caller must POST /account/security/2fa/confirm with a valid code to flip the enrollment to active + receive backup codes.
Re-calling overwrites any prior unconfirmed enrollment; a CONFIRMED enrollment is left in place (caller must DELETE first to re-enroll — that surfaces a “you’re about to disable 2FA” confirmation in the UI).
Authorizations
Section titled “Authorizations ”Responses
Section titled “ Responses ”Enrollment in progress.
object
The shared secret as RFC 4648 base32 (no padding). Authenticator apps that can’t scan QR fall back to manual paste.
Otpauth://totp/
Authentication required, missing, or invalid
object
Human-readable error summary
Example
the request could not be completedExample
{ "error": "authentication required: sign in and retry with a valid session or API token"}2FA already confirmed; disable first to re-enroll.
object
Human-readable error summary
Example
the request could not be completed