/api/user/mfa/totp
Manage TOTP (Time-based One-Time Password) for multi-factor authentication
This endpoint requires authentication.
GET Request
Get your current TOTP secret, or if not set, this will generate a new TOTP secret.
Response
Status: 200 OK
Content-Type: application/json
If you don't have TOTP enabled:
Property | Type | Description |
---|---|---|
secret | string | A new TOTP secret (base32 encoded). |
qrcode | string | Data URL for a QR code to scan in your authenticator app. |
If you already have TOTP enabled:
Property | Type | Description |
---|---|---|
secret | string | Your current TOTP secret (base32 encoded). |
POST Request
Enable TOTP.
Body
Content-Type: application/json
Property | Type | Description |
---|---|---|
secret | string | Required. The TOTP secret. This was returned from the GET request above. |
code | string | Required. 6-digit code from your authenticator app. |
Response
Status: 200 OK
Content-Type: application/json
Returns the updated User object with TOTP enabled.
Error Responses
-
400 Bad Request
If the request body is invalid, missing required fields, or the TOTP code is incorrect.
DELETE Request
Disable TOTP.
Body
Content-Type: application/json
Property | Type | Description |
---|---|---|
code | string | Required. 6-digit code from your authenticator app. |
Response
Status: 200 OK
Content-Type: application/json
Returns the updated User object with TOTP disabled.
Error Responses
-
400 Bad Request
If the request body is invalid, missing required fields, or the TOTP code is incorrect.