# Set a new password with a reset code

`PATCH https://api.cryptohopper.com/v1/user/resetpassword`

Part of [Users](https://www.cryptohopper.com/api-documentation/api-reference/users.md) in the Cryptohopper API reference.

Completes a password reset: checks the verification code from the reset email and sets the new password. Needs no access token.

The new password travels in the query string. The same User-Agent check as Request a password reset runs first.

## Headers

| Name | Type | Required | Description |
|---|---|---|---|
| `access-token` | string | no | The OAuth access token of the user. |
| `Platform` | string | no | Platform of the client: web, ios or android. Defaults to web. |

## Query parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `username` | string | yes | Username of the account. |
| `password` | string | yes | New password; must meet the Cryptohopper password policy. |
| `code` | string | yes | Verification code from the password reset email. |
| `password_verify` | string | yes | Must be the same as password. |

## Example request

```bash
curl -X PATCH "https://api.cryptohopper.com/v1/user/resetpassword?username=USERNAME&password=PASSWORD&code=CODE&password_verify=PASSWORD_VERIFY" \
  -H "access-token: YOUR_ACCESS_TOKEN"
```

## Response

Example response (illustrative values):

```json
{
    "data": "Password has been reset."
}
```

Status codes: 200. Errors return JSON with `status`, `error` and `message`, plus a numeric `code` when the error comes from the API itself rather than the gateway.
