> For the complete documentation index, see [llms.txt](https://docs.suggestic.com/graphql/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.suggestic.com/graphql/query/mutations/user-profile/reset-password.md).

# Reset Password

The `resetPassword` mutation will reset the user's password through a code previously generated by the [`requestResetPassword`](https://docs.suggestic.com/graphql/query/mutations/user-profile/request-reset-password) mutation.

## Requirements

* Execute the [`requestResetPassword` ](https://docs.suggestic.com/graphql/query/mutations/user-profile/request-reset-password)mutation in order to get the code to be used to reset the password.

## Required Arguments

| Argument      | Type   | Description                                                                                                                                           |
| ------------- | ------ | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
| `code`        | String | Code to be retrieved in the [`requestResetPassword` ](https://docs.suggestic.com/graphql/query/mutations/user-profile/request-reset-password)mutation |
| `newPassword` | String | The User’s new password                                                                                                                               |

## Available Fields

| Field     | Type    | Description                                                                                                                         |
| --------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------- |
| `success` | Boolean | <p>True if the reset password has been updated successfully</p><p>False if the reset password has not been updated successfully</p> |
| `message` | String  | Description of the result                                                                                                           |

## Examples

The following example updates the password by using a giving reset code.

### Graphql Example

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

```graphql
mutation {
  resetPassword(code: "ZWE3MWQ0ZjktZDJkYS00NGMzLWE1NjQtNjE3NTUyNTJlY2I4OjVyNy00MzYyYzdkNGRmNGM1NzMwNTlmOA==", newPassword:"myStrongPassword") {
    success
    message
  }
}
```

{% endtab %}

{% tab title="Response" %}

```graphql
{
  "data": {
    "resetPassword": {
      "success": true,
      "message": "Your password was successfully updated!"
    }
  }
}
```

{% endtab %}
{% endtabs %}

### Curl example

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

```javascript
curl --location --request POST 'https://production.suggestic.com/graphql' \
--header 'Authorization: Token <API-Token>' \
--header 'Content-Type: application/json' \
--data-raw '{"query":"mutation {\n    resetPassword(code: \"<reset-code-b64>\" newPassword: \"<new-password>\") {\n        success message\n    }\n}","variables":{}}'
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.suggestic.com/graphql/query/mutations/user-profile/reset-password.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
