This endpoint allows you choose your preferred 2FA type for your account
Headers
Name
Type
Description
Authorization
string
The format for Authorizationis Bearer token_string
Request Body
Name
Type
Description
new_two_fa_value
string
The otp for verification (if new_two_fa_type is google_authenticator and user.google_auth_set_up is false, i.e., the user has not set up google authenticator)
new_two_fa_type
string
The two_factor type the user is changing to. Can be either pin, phone or google_authenticator)
current_two_fa_value
string
The otp (if current_two_fa_type is phone or google_authenticator) or pin (if current_two_fa_type is pin). Required if the user has enabled his/her 2fa (i.e., if user.two_factor_authentication_enabled is true)
This endpoint retrieves the user's set security questions using the Authorization header, reset_password_token or reset_pin_token (listed in order of precedence).
Query Parameters
Name
Type
Description
reset_pin_token
string
Token sent to the user's mail when resetting pin.
reset_password_token
string
Token sent to the user's mail when resetting password.
{
"message": "Security questions retrieved successfully",
"data": [
{
"id": 1,
"name": "What is your favorite color?"
},
{
"id": 2,
"name": "What is your first car?"
},
{
"id": 3,
"name": "What is your mother's maiden name?"
}
]
}
{
"message": "Security question(s) have been set"
}
{
"message": "Invalid format for security_question_answers"
}
{
"message": "Email confirmed"
}
{
"message": "Email could not be confirmed",
"errors": {
"confirm_email_token": "is invalid"
}
}
{
"message": "User's set security questions retrieved successfully",
"data": [
{
"id": "1",
"name": "What is your mother's maiden name?"
},
{
"id": "2",
"name": "What is your first car?"
},
{
"id": "3",
"name": "What is your favorite color?"
}
]
}
{
"message": "Expired token"
}
{
"message": "A reset-pin email has been sent to your mail"
}