requestPasswordResetEmail mutation

The requestPasswordResetEmail mutation triggers the password reset email by the provided email address. Use it to initiate the process to reset the registered customer’s password before calling the resetPassword mutation.

When the customer clicks the Set a New Password button, Magento sends an email to the customer that contains a URL for resetting their password.

Reset password email

The URL has the following format:

1
https://<MAGENTOSITE>/customer/account/createPassword/?token=gh80pkjGdsPyiXc0sUUXswX1uGN7crUr

Use the value of the token in the resetPassword mutation.

Syntax

mutation: {requestPasswordResetEmail(email: String!): Boolean}

Example usage

The following call triggers the password reset email.

Request:

1
2
3
4
5
mutation {
  requestPasswordResetEmail(
    email: "roni_cost@example.com"
  )
}

Response:

1
2
3
4
5
{
  "data": {
    "requestPasswordResetEmail": true
  }
}

Input arguments

You must specify the customer’s email address in the email input argument.

Output attributes

The requestPasswordResetEmail mutation returns true if both of the following operations are successful:

  • The reset password operation initiates.
  • Magento sends an email containing a reset link.

Otherwise, the mutation returns false.

Errors

Error Description
Cannot reset the customer's password A general error message that appears on some internal system errors. The original error is logged and can be found in the Magento logs.
The account is locked You cannot modify a locked customer account.
The email address has an invalid format. The value provided in the email argument has an invalid format.
You must specify an email address. An empty value is provided in the email argument.

resetPassword mutation