Skip to main content

How to use the Drupal REST API to trigger I've forgot (need to change) my password.

POST: {domain}/user/password?_format=hal_json
Content-type: application/hal_json
Accept: application/hal+json

Or if you are using hal_json then use

POST: {domain}/user/password?_format=json
Content-type: application/json
Accept: application/json

Body

{
  "mail": "your@yoursite.email"
}

All going well there will be no response.

 

Other responses

However, if you have sent an email that doesn't exist on the site, then the response will be text-based.  Such as:

{
    "message": "Unrecognized username or email address."
}

The user is blocked or not activated:

{
    "message": "The user has not been activated or is blocked."
}

 

 

Related articles