How to send a reset password request via API?

Hi,

I wonder if there is a way to send a reset password request via an API call? Or perhaps just reset the password via api (then my code will email the user).

For example, I can do this PATCH request but it doesnt sets the password:

PATCH ‘https://******/api/user/v1/accounts/{username}’
{
“name”: “Lorem Ipsum”,
“password”: “newpassword” //doesntwork!!
}

Similarly, I tried the following, doesnt work:

POST /password_reset/
POST /account/password

Hello @rhasan,

For the password reset you can use these endpoints:

api/user/v1/account/password_reset/
api/user/v1/account/password_reset/token/validate/

And for all API endpoint details, you can check this URL.

References:

1 Like

The first endpoint (/user/v1/account/password_reset/) is a GET only for some useless reason. It says there

“HTTP end-point for GETting a description of the password reset form.”

The 2nd endpoint (/user/v1/account/password_reset/token/validate/) is to validate token. There isnt one to reset the password or generate a reset password request.

You are right about this but this will give you the form field data which require to submit for the password reset request.

I have tried this one in the Postman and have received Password reset email on the success of it. Please check your logs for this request and verify what is going wrong. One more thing is that you should pass the email in this POST request.

Reference:

Thanks for the reply buddy.

I have tried this one in the Postman and have received Password reset email on the success of it. Please check your logs for this request and verify what is going wrong. One more thing is that you should pass the email in this POST request.

  1. How did you pass the email param? JSON? or form-data?

As a form-data in Body of Postman.

Oh I got it, it works now. Thanks.
Because everything else works on Json data so I was passing json previously.

Do you know where is the template for this email? it looks pretty awful