# Method: accounts.resetPassword

- [HTTP request](https://docs.cloud.google.com/identity-platform/docs/reference/rest/v1/accounts/resetPassword#body.HTTP_TEMPLATE)
- [Request body](https://docs.cloud.google.com/identity-platform/docs/reference/rest/v1/accounts/resetPassword#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/identity-platform/docs/reference/rest/v1/accounts/resetPassword#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/identity-platform/docs/reference/rest/v1/accounts/resetPassword#body.response_body)
  - [JSON representation](https://docs.cloud.google.com/identity-platform/docs/reference/rest/v1/accounts/resetPassword#body.ResetPasswordResponse.SCHEMA_REPRESENTATION)
- [Authorization scopes](https://docs.cloud.google.com/identity-platform/docs/reference/rest/v1/accounts/resetPassword#body.aspect)
- [Try it!](https://docs.cloud.google.com/identity-platform/docs/reference/rest/v1/accounts/resetPassword#try-it)

Resets the password of an account either using an out-of-band code generated by [sendOobCode](https://docs.cloud.google.com/identity-platform/docs/reference/rest/v1/accounts/sendOobCode) or by specifying the email and password of the account to be modified. Can also check the purpose of an out-of-band code without consuming it.

### HTTP request

`POST https://identitytoolkit.googleapis.com/v1/accounts:resetPassword`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "oobCode": string, "newPassword": string, "oldPassword": string, "email": string, "tenantId": string } ``` |

| Fields ||
|---|---|
| `oobCode` | `string` An out-of-band (OOB) code generated by accounts.sendOobCode request. Specify only this parameter (or only this parameter and a tenant ID) to get the out-of-band code's type in the response without mutating the account's state. Only a PASSWORD_RESET out-of-band code can be consumed via this method. |
| `newPassword` | `string` The new password to be set for this account. Specifying this field will result in a change to the account and consume the out-of-band code if one was specified and it was of type PASSWORD_RESET. |
| `oldPassword` | `string` The current password of the account to be modified. Specify this and email to change an account's password without using an out-of-band code. |
| `email` | `string` Optional. The email of the account to be modified. Specify this and the old password in order to change an account's password without using an out-of-band code. |
| `tenantId` | `string` Optional. The tenant ID of the Identity Platform tenant the account belongs to. |

### Response body

Response message for accounts.resetPassword.

If successful, the response body contains data with the following structure:

| JSON representation |
|---|
| ``` { "kind": string, "email": string, "newEmail": string, "requestType": enum (`https://docs.cloud.google.com/identity-platform/docs/reference/rest/v1/OobReqType`), "mfaInfo": { object (`https://docs.cloud.google.com/identity-platform/docs/reference/rest/v1/MfaEnrollment`) } } ``` |

| Fields ||
|---|---|
| `kind (deprecated)` | `string` > [!WARNING] > This item is deprecated! |
| `email` | `string` The email associated with the out-of-band code that was used. |
| `newEmail` | `string` |
| `requestType` | ``enum (`https://docs.cloud.google.com/identity-platform/docs/reference/rest/v1/OobReqType`)`` |
| `mfaInfo` | ``object (`https://docs.cloud.google.com/identity-platform/docs/reference/rest/v1/MfaEnrollment`)`` |

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/identitytoolkit`
- `
  https://www.googleapis.com/auth/cloud-platform`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).