# Verify phone via SMS OTP

Operation ID: `patient.verifySms`

Confirm the SMS OTP sent by `patient.updatePhone`, marking the phone number verified in Cognito. Requires a patient Bearer JWT.

## Public method

`verifySms`

Signature: `patient.verifySms(request)`

Return type: `Promise<VerifiedResponse>`

## Authentication

Classification: **AUTHENTICATED**

Schemes: `bearerAuth`

## Prerequisites

None documented.

## HTTP

`POST /patients/verify-sms`

## Path parameters

None.

## Query parameters

None.

## Body parameters

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

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

## Request example

```json
{
  "otp": "123456"
}
```

## Success responses

| Status | Shape | Content type | Description |
|---|---|---|---|
| `200` | [`patient.VerifySmsResponse`](../models/patient.VerifySmsResponse.md) | application/json | Phone verified |

## Success response examples

### 200

```json
{
  "verified": true
}
```

## Common errors

| Status | Shape | Content type | Description |
|---|---|---|---|
| `400` | [`patient.ErrorResponse`](../models/patient.ErrorResponse.md) | application/json | Bad request — otp is missing, or the OTP is invalid/expired |
| `401` | [`patient.ErrorResponse`](../models/patient.ErrorResponse.md) | application/json | Authorization required — missing, invalid, expired, or non-patient Bearer JWT |

## Error examples

### 400 — The OTP is invalid or expired

```json
{
  "error": "Invalid or expired verification code"
}
```

### 400 — otp is required

```json
{
  "error": "otp is required"
}
```

### 401 — Missing or invalid access token

```json
{
  "error": "Authorization required"
}
```

## NodeJS / TypeScript implementation

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

```ts
const request = {
  "otp": "123456"
};

const result = await patient.verifySms(request);
```

## cURL

```bash
curl -X POST \
  -H 'Authorization: Bearer <ACCESS_TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{"otp":"123456"}' \
  'https://dev-api-patient.health.cloud/patients/verify-sms'
```

## 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.
