# Request Reset Password

The `requestResetPassword` mutation allows users to send a password request based on a given email. As a result of the executing of this mutation, a code will be returned, use it in the [`resetPassword`](https://docs.suggestic.com/graphql/query/mutations/user-profile/reset-password) mutation to successfully reset the password.&#x20;

## Required Arguments

| Argument | Type   | Description                               |
| -------- | ------ | ----------------------------------------- |
| `email`  | String | User's email which password will be reset |

## Available Fields

| Field               | Type    | Description                                                                                                                                                                                                                                                        |
| ------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| `success`           | Boolean | <p>True if the reset password has been created</p><p>False if the reset password has not been created</p>                                                                                                                                                          |
| `message`           | String  | Description of the result                                                                                                                                                                                                                                          |
| `resetPasswordCode` | Number  | Code to be used in the [`resetPassword`](https://docs.suggestic.com/graphql/query/mutations/user-profile/reset-password) mutation through the code argument to reset the password. Unused password reset code will expire 24 hours after the request has been sent |

## Examples

The following examples request a reset password code.

### Graphql example

{% tabs %}
{% tab title="Mutation" %}

```graphql
 mutation {
 requestResetPassword(email: "user@mail.com") {
    success
    message
    resetPasswordCode
  }
  }
```

{% endtab %}

{% tab title="Response" %}

```graphql
{
  "data": {
    "requestResetPassword": {
      "success": true,
      "message": "Reset password code created",
      "resetPasswordCode": "ZWE3MWQ0ZjktZDJkYS00NGMzLWE1NjQtNjE3NTUyNTJlY2I4OjVyNy00MzYyYzdkNGRmNGM1NzMwNTlmOA=="
    }
  }
}
```

{% endtab %}
{% endtabs %}

### Curl Example

{% tabs %}
{% tab title="Curl " %}

```java
curl --location --request POST 'https://production.suggestic.com/graphql' \
--header 'Authorization: Token <API-Token>' \
--header 'Content-Type: application/json' \
--data-raw '{"query":"mutation {\n    requestResetPassword(email: \"user@mail.com\") {\n        success message resetPasswordCode\n    }\n}","variables":{}}'
```

{% endtab %}
{% endtabs %}
