> ## 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.

# Disable 2FA via Email

> Disable two-factor authentication via email. The 2FA code is required.

## OpenAPI

````json POST /api/v1/users.2fa.disableEmail
{
  "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.disableEmail": {
      "post": {
        "tags": [
          "Two-Factor Authentication"
        ],
        "summary": "Disable 2FA via Email",
        "description": "Disable two-factor authentication via email. The 2FA code is required.",
        "operationId": "post-api-v1-users.2fa.disableEmail",
        "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": {
            "$ref": "#/components/responses/trueSuccess"
          },
          "400": {
            "description": "TOTP Required \n\nThe 2FA code is passed as the `X-2fa-Code` query parameter.\n\nIt's important to note the **required TOTP method** returned from the response.\n\n- If it's `password`, add the hashed password of the user as the `X-2fa-Code` header parameter. \n- If it's `email`, add the 2FA code sent via email as the `X-2fa-Code` header parameter.\n- If it's `totp`, add the code from your authenticator app as the `X-2fa-Code` header parameter.",
            "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": []
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "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"
                }
              }
            }
          }
        }
      }
    }
  }
}
````

