Skip to main content
PATCH
/
auth
/
resetpassword
Reset password
curl --request PATCH \
  --url https://api.royalti.io/auth/resetpassword \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "email": "[email protected]",
  "new_password": "<string>"
}
'
{
  "message": "Password Reset Successful"
}
This endpoint requires authentication. Include your Bearer token in the Authorization header.

Description

/auth/resetpassword Description:
The /auth/resetpassword endpoint allows users to reset their password by providing a verification code along with the new password. The verification code is typically sent to the user’s email after initiating the password reset process.
Method:
PATCH
Query Parameter:
ParameterTypeDescription
codestringThe verification code sent to the user’s email.
Request Payload:
ParameterTypeDescription
emailstringThe email address of the user.
new_passwordstringThe new password to be set.
Request Example: Requires bearer token from response in /forgotpassword request
See example of the responses below

Code Examples

const response = await fetch('https://api.royalti.io/auth/resetpassword', {
  method: 'PATCH',
  headers: {
    'Authorization': `Bearer ${token}`,
    'Content-Type': 'application/json'
  },
  body: JSON.stringify({
    "email": "sample-email",
    "new_password": "sample-new_password"
  })
});

const data = await response.json();
console.log(data);

Authorizations

Authorization
string
header
required

JWT Authorization header using the Bearer scheme. Format: "Bearer {token}"

Query Parameters

code
string

The verification code sent to the user's email

Body

application/json
email
string<email>
required

The email address of the user

new_password
string
required

The new password to be set

Response

Success - If Logged In

message
string