Skip to main content

Reset Password

warning

The user has to be logged in to proceed with this flow.

Make sure to either:

  • Send a valid Authorization header with of type Bearer TOKEN_VALUE where TOKEN_VALUE is the token returned in the response from Sign up or Sign in flow
  • In case your app supports cookie, you can enable request cookies as our API Automatically sets a cookie named session-token which is forwarded with each request to our api.

To reset a user's password, the recommended approach is to make a PUT request to the following endpoint:

curl --request PUT \
--url https://dev-iam.razi.ai/v1/authentication/users/__USERID__/password \
--header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
--header 'Content-Type: application/json' \
--data '{
"currentPassword": "OldSecret@slidezAB",
"newPassword": "Secret@slidezAB"
}'

tip

Link to Playground

In the request URL, replace _USERID_ with the unique identifier of the user whose password needs to be reset. The request body should be a JSON object containing two properties:

  • currentPassword: The user's current password.
  • newPassword: The desired new password for the user.

Upon successful execution, the API will respond with an HTTP status code of 200 OK, indicating that the password has been updated. In case of any errors, an appropriate error response will be returned.