> ## 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 2FA via Email

> Enable email two-factor authentication for your account. This endpoint only works if the user has at least one verified email. 

## OpenAPI

````json POST /api/v1/users.2fa.enableEmail
{
  "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.2fa.enableEmail": {
      "post": {
        "tags": [
          "Two-Factor Authentication"
        ],
        "summary": "Enable 2FA via Email",
        "description": "Enable email two-factor authentication for your account. This endpoint only works if the user has at least one verified email. ",
        "operationId": "post-api-v1-users.2fa.enableEmail",
        "parameters": [
          {
            "$ref": "#/components/parameters/Auth-Token"
          },
          {
            "$ref": "#/components/parameters/UserId"
          }
        ],
        "responses": {
          "200": {
            "$ref": "#/components/responses/trueSuccess"
          },
          "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": {
      "trueSuccess": {
        "description": "OK",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                }
              },
              "x-examples": {
                "Success": {
                  "success": "true"
                }
              }
            },
            "examples": {
              "Success": {
                "value": {
                  "success": "true"
                }
              }
            }
          }
        }
      },
      "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."
                }
              }
            }
          }
        }
      }
    }
  }
}
````

