Skip to content
LogoLogo

Begin enrolling a time-based one-time password factor

Begin enrolling a time-based one-time password factor

POST/api/v1/auth/mfa/totp/setup

Generates a shared secret and returns it once, with the otpauth:// URI a QR code encodes. The secret is never readable again; a client that loses it must start enrolment over.

Setup alone does not enable the factor — sign-in keeps working unchanged until confirmTOTP succeeds, so an abandoned enrolment cannot lock anyone out. Restarting setup replaces any unconfirmed secret, which stops a previously displayed QR code from working.

An account that already has a confirmed factor receives 409: allowing a replacement would let whoever holds a live session swap the second factor out silently.

Header Parameters

X-CSRF-TokenRequired
string·min 43·max 43

Session-bound CSRF token. It must exactly match the __Host-assign_csrf cookie sent with the request.

Responses