/api/user/mfa/totp

Manage TOTP (Time-based One-Time Password) for multi-factor authentication

Info

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:

PropertyTypeDescription
secretstringA new TOTP secret (base32 encoded).
qrcodestringData URL for a QR code to scan in your authenticator app.

If you already have TOTP enabled:

PropertyTypeDescription
secretstringYour current TOTP secret (base32 encoded).

POST
Request

Enable TOTP.

Body

Content-Type: application/json

PropertyTypeDescription
secretstringRequired. The TOTP secret. This was returned from the GET request above.
codestringRequired. 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

PropertyTypeDescription
codestringRequired. 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.



Last updated: 5/30/2025
Edit this page on GitHub