# Get unread message count

Operation ID: `patient.commsGetUnreadCount`

Return the total unread message count across all of a participant's conversations. Requires a Bearer JWT (any authenticated pool type).

## Public method

`getUnreadCount`

Signature: `patient.getUnreadCount(participantId)`

Return type: `Promise<UnreadCountResponse>`

## Authentication

Classification: **AUTHENTICATED**

Schemes: `bearerAuth`

## Prerequisites

None documented.

## HTTP

`GET /communications/conversations/unread-count`

## Path parameters

None.

## Query parameters

| Name | Type | Required | Format | Allowed values | Default | Nullable | Description |
|---|---|---:|---|---|---|---:|---|
| `participantId` | `string` | Yes |  |  |  | No |  |

## Body parameters

None.

Request model: None.

## Request example

None declared in canonical OpenAPI.

## Success responses

| Status | Shape | Content type | Description |
|---|---|---|---|
| `200` | [`CommsGetUnreadCountResponse`](../models/CommsGetUnreadCountResponse.md) | application/json | Unread conversation count |

## Success response examples

### 200

```json
{
  "participantId": "sdk-contact-20260811-013559",
  "totalUnread": 0
}
```

## Common errors

| Status | Shape | Content type | Description |
|---|---|---|---|
| `400` | [`patient.ErrorResponse`](../models/patient.ErrorResponse.md) | application/json | participantId query parameter is missing |
| `401` | [`patient.ErrorResponse`](../models/patient.ErrorResponse.md) | application/json | Authorization required — missing or invalid Bearer JWT |
| `403` | [`patient.ErrorResponse`](../models/patient.ErrorResponse.md) | application/json | The caller's token carries no tenant context |

## Error examples

### 400 — participantId query parameter is required

```json
{
  "error": "participantId query parameter is required"
}
```

### 401 — Missing or invalid access token

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

### 403 — Tenant context unavailable

```json
{
  "error": "Tenant context unavailable"
}
```

## NodeJS / TypeScript implementation

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

```ts
const participantId = "<PARTICIPANT_ID>";

const result = await patient.getUnreadCount(participantId);
```

## cURL

```bash
curl -X GET \
  -H 'Authorization: Bearer <ACCESS_TOKEN>' \
  'https://dev-api-patient.health.cloud/communications/conversations/unread-count?participantId=%3CPARTICIPANT_ID%3E'
```

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