# Get the full CareConnect snapshot

Operation ID: `patient.commsGetState`

Return the caller's full CareConnect snapshot (presence, groups, conversations, messages, invites) for offline-first server-wins merge by id. Every collection is always present; one that could not be listed comes back empty rather than failing the whole snapshot. Requires a Bearer JWT (any authenticated pool type).

## Public method

`getCommunicationsState`

Signature: `patient.getCommunicationsState()`

Return type: `Promise<CommunicationsStateResponse>`

## Authentication

Classification: **AUTHENTICATED**

Schemes: `bearerAuth`

## Prerequisites

None documented.

## HTTP

`GET /communications/state`

## Path parameters

None.

## Query parameters

None.

## Body parameters

None.

Request model: None.

## Request example

None declared in canonical OpenAPI.

## Success responses

| Status | Shape | Content type | Description |
|---|---|---|---|
| `200` | [`CommsGetStateResponse`](../models/CommsGetStateResponse.md) | application/json | CareConnect communications snapshot |

## Success response examples

### 200

```json
{
  "conversations": [
    {
      "createdAt": "2026-08-10T23:37:16.021510Z",
      "groupId": "sdk-group-20260811-013559",
      "id": "sdk-conversation-20260811-013559",
      "kind": "group",
      "lastMessagePreview": "Your care plan is ready for review.",
      "participantIds": [
        "sdk-contact-20260811-013559"
      ],
      "title": "SDK Patient Test",
      "unreadCount": 0,
      "updatedAt": "2026-08-10T23:37:16.021516Z"
    }
  ],
  "groups": [
    {
      "callEnabled": false,
      "createdAt": "2026-08-10T23:37:14.884134Z",
      "createdBy": "sdk-contact-20260811-013559",
      "description": "Care team for the example patient",
      "groupKind": "team",
      "id": "sdk-group-20260811-013559",
      "memberIds": [
        "sdk-contact-20260811-013559"
      ],
      "name": "SDK Patient Test",
      "updatedAt": "2026-08-10T23:37:14.884142Z"
    }
  ],
  "invites": [
    {
      "channel": "email",
      "createdAt": "2026-08-10T23:37:17Z",
      "destination": "test.user@example.com",
      "id": "invite-example-001",
      "inviteCode": "INVITE-EXAMPLE-001",
      "name": "Test User",
      "role": "patient",
      "status": "sent"
    }
  ],
  "messages": [
    {
      "body": "SDK live test",
      "conversationId": "sdk-conversation-20260811-013559",
      "createdAt": "2026-08-10T23:37:16.608014Z",
      "id": "sdk-message-20260811-013559",
      "kind": "text",
      "senderId": "sdk-contact-20260811-013559",
      "status": "sent"
    }
  ],
  "presence": [
    {
      "contactId": "sdk-contact-20260811-013559",
      "id": "sdk-contact-20260811-013559",
      "lastActiveAt": "2026-08-10T23:37:14.293893Z",
      "presence": "online"
    }
  ]
}
```

## Common errors

| Status | Shape | Content type | Description |
|---|---|---|---|
| `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

### 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 result = await patient.getCommunicationsState();
```

## cURL

```bash
curl -X GET \
  -H 'Authorization: Bearer <ACCESS_TOKEN>' \
  'https://dev-api-patient.health.cloud/communications/state'
```

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