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

# Reset Users TOTP

> Reset 2FA via TOTP for a user in the workspace. Make sure that the `Enable Two Factor Authentication` setting is enabled under **Manage** > **Workspace** > **Settings** > **Accounts** > **Two Factor Authentication**.
* Permission required: `edit-other-user-totp`.
* It requires two-factor authentication, if 2FA is enabled and configured in your workspace.

### Changelog
| Version      | Description |
| ---------------- | ------------|
|3.6.0            | Added       |

## OpenAPI

````json POST /api/v1/users.resetTOTP
{
  "openapi": "3.0.0",
  "info": {
    "version": "1.0.0",
    "title": "User Management"
  },
  "servers": [
    {
      "url": "https://apiexplorer.support.rocket.chat"
    }
  ],
  "tags": [
    {
      "name": "LDAP"
    },
    {
      "name": "Permissions"
    },
    {
      "name": "Roles"
    },
    {
      "name": "Users"
    }
  ],
  "paths": {
    "/api/v1/users.resetTOTP": {
      "post": {
        "summary": "Reset Users TOTP",
        "operationId": "post-api-v1-users.resetTOTP",
        "responses": {
          "200": {
            "$ref": "#/components/responses/trueSuccess"
          },
          "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",
                            "properties": {}
                          }
                        }
                      }
                    }
                  }
                },
                "examples": {
                  "Example 1": {
                    "value": {
                      "success": "false",
                      "error": "TOTP Required [totp-required]",
                      "errorType": "totp-required",
                      "details": {
                        "method": "password",
                        "codeGenerated": "false",
                        "availableMethods": []
                      }
                    }
                  },
                  "Example 2": {
                    "value": {
                      "success": "false",
                      "error": "Not allowed [error-not-allowed]",
                      "errorType": "error-not-allowed"
                    }
                  },
                  "Example 3": {
                    "value": {
                      "success": "false",
                      "error": "The required \"userId\" or \"username\" param provided does not match any users [error-invalid-user]",
                      "errorType": "error-invalid-user"
                    }
                  }
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/authorizationError"
          }
        },
        "parameters": [
          {
            "$ref": "#/components/parameters/Auth-Token"
          },
          {
            "$ref": "#/components/parameters/UserId"
          },
          {
            "$ref": "#/components/parameters/x-2fa-code"
          },
          {
            "$ref": "#/components/parameters/x-2fa-method"
          }
        ],
        "description": "Reset 2FA via TOTP for a user in the workspace. Make sure that the `Enable Two Factor Authentication` setting is enabled under **Manage** > **Workspace** > **Settings** > **Accounts** > **Two Factor Authentication**.\n* Permission required: `edit-other-user-totp`.\n* It requires two-factor authentication, if 2FA is enabled and configured in your workspace.\n\n### Changelog\n| Version      | Description |\n| ---------------- | ------------|\n|3.6.0            | Added       |",
        "tags": [
          "Users"
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "userId": {
                    "type": "string",
                    "description": "The `userId` of the user whose TOTP you want to reset. You can also use the username. If you do not enter a value, the sender's TOTP is reset."
                  }
                }
              },
              "examples": {
                "Example 1": {
                  "value": {
                    "userId": "GonjPyg3gB3Z9ur9s"
                  }
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "responses": {
      "trueSuccess": {
        "description": "OK",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "success": {
                  "type": "boolean"
                }
              }
            },
            "examples": {
              "Success": {
                "value": {
                  "success": "true"
                }
              }
            }
          }
        }
      },
      "authorizationError": {
        "description": "Unauthorized",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "status": {
                  "type": "string"
                },
                "message": {
                  "type": "string"
                }
              }
            },
            "examples": {
              "Authorization Error": {
                "value": {
                  "status": "error",
                  "message": "You must be logged in to do this."
                }
              }
            }
          }
        }
      }
    },
    "parameters": {
      "Auth-Token": {
        "name": "X-Auth-Token",
        "in": "header",
        "description": "The authenticated user token.",
        "required": "true",
        "schema": {
          "type": "string"
        },
        "example": "RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f"
      },
      "UserId": {
        "name": "X-User-Id",
        "in": "header",
        "description": "The authenticated user ID.",
        "required": "true",
        "schema": {
          "type": "string"
        },
        "example": "rbAXPnMktTFbNpwtJ"
      },
      "x-2fa-code": {
        "name": "x-2fa-code",
        "in": "header",
        "description": "Enter the 2FA code. This parameter is required if 2FA is enabled in your workspace. See the <a href=\"https://developer.rocket.chat/apidocs/introduction-to-two-factor-authentication\" target=\"_blank\">Introduction to Two-Factor Authentication</a> document for details.",
        "schema": {
          "type": "string"
        },
        "example": "148750"
      },
      "x-2fa-method": {
        "name": "x-2fa-method",
        "in": "header",
        "schema": {
          "type": "string"
        },
        "description": "Enter the method with which you get the 2FA code. It can be `email`, `totp`, or `password`. This parameter is required if 2FA is enabled in your workspace."
      }
    }
  }
}
````

