# Confirm a password reset

Operation ID: `patient.confirmResetPassword`

Complete a password reset using the confirmation code sent by `patient.resetPassword`. No authentication is required. `new_password` must be at least 8 characters.

## Public method

`confirmPassword`

Signature: `auth.confirmPassword(request)`

Return type: `Promise<ResetPatientPasswordResponse>`

## Authentication

Classification: **PUBLIC**

## Prerequisites

None documented.

## HTTP

`POST /auth/confirm-reset-password`

## Path parameters

None.

## Query parameters

None.

## Body parameters

| Name | Type | Required | Format | Allowed values | Default | Nullable | Description |
|---|---|---:|---|---|---|---:|---|
| `body` | [`patient.ConfirmResetPasswordRequest`](../models/patient.ConfirmResetPasswordRequest.md) | No |  |  |  | No |  |

Request model: [`patient.ConfirmResetPasswordRequest`](../models/patient.ConfirmResetPasswordRequest.md)

## Request example

```json
{
  "confirmation_code": "123456",
  "email": "jordan.patient@yopmail.com",
  "new_password": "PasswordTest1234$",
  "tenant_id": "tenant-example-001"
}
```

## Success responses

| Status | Shape | Content type | Description |
|---|---|---|---|
| `200` | [`patient.ConfirmResetPasswordResponse`](../models/patient.ConfirmResetPasswordResponse.md) | application/json | Password reset |

## Success response examples

### 200

```json
{
  "message": "Password reset code sent to email"
}
```

## Common errors

| Status | Shape | Content type | Description |
|---|---|---|---|
| `400` | [`patient.ErrorResponse`](../models/patient.ErrorResponse.md) | application/json | Bad request — missing/short fields, or Cognito rejected the confirmation code |

## Error examples

### 400 — The confirmation code is invalid or expired

```json
{
  "error": "Invalid verification code provided, please try again."
}
```

### 400 — Required fields are missing

```json
{
  "error": "email, tenant_id, confirmation_code and new_password are required"
}
```

### 400 — The new password is too short

```json
{
  "error": "password must be at least 8 characters"
}
```

## NodeJS / TypeScript implementation

```ts
import { HCSDK } from "@healthcloudai/hc-sdk";
import type { ConfirmPatientPasswordRequest } from "@healthcloudai/hc-sdk";
```

```ts
const request = {
  "confirmation_code": "123456",
  "email": "jordan.patient@yopmail.com",
  "new_password": "PasswordTest1234$",
  "tenant_id": "tenant-example-001"
};

const result = await auth.confirmPassword(request);
```

## cURL

```bash
curl -X POST \
  -H 'Content-Type: application/json' \
  -d '{"confirmation_code":"123456","email":"jordan.patient@yopmail.com","new_password":"PasswordTest1234$","tenant_id":"tenant-example-001"}' \
  'https://dev-api-patient.health.cloud/auth/confirm-reset-password'
```

## Notes

None.

## Prepared Test Console scenario

No canonical scenario is currently associated.

## Real response

No approved real integration response is currently published. Unapproved candidates are never rendered as examples.
