> ## Documentation Index > Fetch the complete documentation index at: https://developer.rocket.chat/llms.txt > Use this file to discover all available pages before exploring further. # Enable TOTP 2FA > 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 | ## OpenAPI ````json POST /api/v1/users.enableTotp { "openapi": "3.0.0", "info": { "version": "1.0.0", "title": "Authentication" }, "servers": [ { "url": "https://apiexplorer.support.rocket.chat" } ], "tags": [ { "name": "Authentication" }, { "name": "Two-Factor Authentication" } ], "paths": { "/api/v1/users.enableTotp": { "post": { "tags": [ "Two-Factor Authentication" ], "summary": "Enable TOTP 2FA", "description": "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.\n\nThis 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.\n\nThis endpoint replaces the deprecated `2fa:enable` real-time method, which remains available until 9.0.0.\n\n### Changelog\n| Version | Description |\n| ------- | ----------- |\n| 8.8.0 | Added |", "operationId": "post-api-v1-users.enableTotp", "parameters": [ { "$ref": "#/components/parameters/Auth-Token" }, { "$ref": "#/components/parameters/UserId" }, { "name": "X-2fa-Code", "in": "header", "description": "The 2FA code. ", "required": "true", "schema": { "type": "string" } }, { "schema": { "type": "string" }, "in": "header", "name": "X-2fa-method", "description": "The 2FA method. It can be `email`, `totp`, or `password`.", "required": "true" } ], "responses": { "200": { "description": "OK", "content": { "application/json": { "schema": { "type": "object", "properties": { "secret": { "type": "string" }, "url": { "type": "string" }, "success": { "type": "boolean" } }, "required": [ "secret", "url", "success" ], "additionalProperties": "false" }, "examples": { "Success Example": { "value": { "secret": "KZ3EAT7RJVHUYQ2C", "url": "otpauth://totp/Rocket.Chat:dana.reyes?secret=KZ3EAT7RJVHUYQ2C&issuer=Rocket.Chat", "success": "true" } } } } } }, "400": { "description": "Bad Request", "content": { "application/json": { "schema": { "type": "object", "properties": { "success": { "type": "boolean" }, "error": { "type": "string" }, "errorType": { "type": "string" }, "details": { "type": "object", "properties": { "method": { "type": "string" }, "codeGenerated": { "type": "boolean" }, "availableMethods": { "type": "array", "items": { "type": "object" } } } } } }, "examples": { "TOTP Required": { "value": { "success": "false", "error": "TOTP Required [totp-required]", "errorType": "totp-required", "details": { "method": "password", "codeGenerated": "false", "availableMethods": [] } } } } } } }, "401": { "$ref": "#/components/responses/authorizationError" } } } } }, "components": { "parameters": { "Auth-Token": { "name": "X-Auth-Token", "in": "header", "description": "The `authToken` of the authenticated user.", "required": "true", "schema": { "type": "string", "example": "RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f" } }, "UserId": { "name": "X-User-Id", "in": "header", "description": "The `userId` of the authenticated user.", "required": "true", "schema": { "type": "string", "example": "rbAXPnMktTFbNpwtJ" } } }, "responses": { "authorizationError": { "description": "Unauthorized", "content": { "application/json": { "schema": { "type": "object", "properties": { "status": { "type": "string" }, "message": { "type": "string" } }, "x-examples": { "Authorization Error": { "status": "error", "message": "You must be logged in to do this." } } }, "examples": { "Authorization Error": { "value": { "status": "error", "message": "You must be logged in to do this." } } } } } } } } } ````