Starts the TOTP enrollment for your own account and returns the shared secret and the url to render as a QR code in an authenticator app. Call users.validateTotp with a code from the app to finish the enrollment.
This endpoint requires two-factor verification, so the account owner confirms their identity with an existing second factor before a new authenticator is registered. Requests are limited to five per minute.
This endpoint replaces the deprecated 2fa:enable real-time method, which remains available until 9.0.0.
Changelog
| Version | Description |
|---|---|
| 8.8.0 | Added |
The authToken of the authenticated user.
The userId of the authenticated user.
The 2FA code.
The 2FA method. It can be email, totp, or password.
OK
{
"secret": "KZ3EAT7RJVHUYQ2C",
"url": "otpauth://totp/Rocket.Chat:dana.reyes?secret=KZ3EAT7RJVHUYQ2C&issuer=Rocket.Chat",
"success": true
}Bad Request
{
"success": false,
"error": "TOTP Required [totp-required]",
"errorType": "totp-required",
"details": {
"method": "password",
"codeGenerated": false,
"availableMethods": []
}
}Unauthorized
{
"status": "error",
"message": "You must be logged in to do this."
}