# Create/update patient insurance policies via updateClient

Operation ID: `connectors.healthieUpdatePatientInsuranceBilling`

Create/update patient insurance policies via updateClient. Healthie's ``updateClientInput`` exposes policies under the ``policies`` key (a list of ``ClientPolicyInput``), not the legacy ``policies_attributes`` the old C# reference client used — Healthie removed that alias from the schema. Each entry creates a new policy when no ``id`` is supplied, or updates the named one when it is. ``ClientPolicyInput`` accepts ``insurance_plan_id``, ``num``, ``holder_relationship``, ``priority_type`` and more (introspected live 2026-09-03).

## Public method

`updatePatientInsuranceBilling`

Signature: `connectors.healthie.createClient(config).updatePatientInsuranceBilling(body)`

Return type: `Promise<HealthieInsuranceResponse>`

## Authentication

Classification: **AUTHENTICATED**

Schemes: `bearerAuth`

## Prerequisites

None documented.

## HTTP

`POST /connectors/healthie/update-patient-insurance-billing`

## Path parameters

None.

## Query parameters

None.

## Body parameters

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

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

## Request example

```json
{
  "api_url": "https://example.com/resource",
  "auth_context": {
    "vendorField": "vendor-defined value"
  },
  "mode": "sandbox",
  "open_loop_url": "https://example.com/resource",
  "patient_id": "12345",
  "policies": {
    "vendorField": "vendor-defined value"
  },
  "secret_key": "example-api-key",
  "shard_id": "12345"
}
```

## Success responses

| Status | Shape | Content type | Description |
|---|---|---|---|
| `200` | [`HealthieUpdatePatientInsuranceBillingResponse`](../models/HealthieUpdatePatientInsuranceBillingResponse.md) | application/json | Successful response |

## Success response examples

### 200

```json
{
  "active_status": "example-active-status",
  "active_tags": [],
  "additional_record_identifier": "example-additional-record-identifier",
  "diagnoses": [],
  "dietitian_id": "12345",
  "dob": "1985-04-12",
  "email": "patient@example.com",
  "first_name": "Ada",
  "full_name": "Example Name",
  "gender": "example-gender",
  "gender_identity": "example-gender-identity",
  "has_api_access": true,
  "height": "example-height",
  "id": "12345",
  "immunizations": [],
  "is_owner": true,
  "is_patient": true,
  "last_name": "Lovelace",
  "legal_name": "Example Name",
  "locations": [],
  "name": "Example Name",
  "next_appt_date": "example-next-appt-date",
  "phone_number": "+15555550123",
  "policies": [],
  "problems": [],
  "record_identifier": "example-record-identifier",
  "set_password_link": "https://example.com/resource",
  "sex": "example-sex",
  "skipped_email": true,
  "third_party_source": "example-third-party-source",
  "user_group_id": "12345"
}
```

## Common errors

| Status | Shape | Content type | Description |
|---|---|---|---|
| `400` | [`StandardErrorResponse`](../models/StandardErrorResponse.md) | application/json | Connector validation rejected the payload, or a required field was missing or of the wrong type. |
| `401` | [`StandardErrorResponse`](../models/StandardErrorResponse.md) | application/json | The HealthCloud bearer token is missing or invalid, or the vendor rejected the supplied connector credentials. |
| `500` | [`StandardErrorResponse`](../models/StandardErrorResponse.md) | application/json | The connector failed unexpectedly. |
| `502` | [`StandardErrorResponse`](../models/StandardErrorResponse.md) | application/json | The vendor returned an application or transport-level failure. |
| `504` | [`StandardErrorResponse`](../models/StandardErrorResponse.md) | application/json | The vendor did not respond within the connector timeout. |

## Error examples

### 400 — Invalid request

```json
{
  "error": "Invalid request"
}
```

### 401 — Authorization required

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

### 500 — Internal error

```json
{
  "error": "Internal error"
}
```

### 502 — Upstream vendor error

```json
{
  "error": "Upstream vendor error"
}
```

### 504 — Upstream timeout

```json
{
  "error": "Upstream timeout"
}
```

## NodeJS / TypeScript implementation

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

```ts
const body = {
  "api_url": "https://example.com/resource",
  "auth_context": {
    "vendorField": "vendor-defined value"
  },
  "mode": "sandbox",
  "open_loop_url": "https://example.com/resource",
  "patient_id": "12345",
  "policies": {
    "vendorField": "vendor-defined value"
  },
  "secret_key": "example-api-key",
  "shard_id": "12345"
};

const result = await connectors.healthie.createClient(config).updatePatientInsuranceBilling(body);
```

## cURL

```bash
curl -X POST \
  -H 'Authorization: Bearer <ACCESS_TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{"api_url":"https://example.com/resource","auth_context":{"vendorField":"vendor-defined value"},"mode":"sandbox","open_loop_url":"https://example.com/resource","patient_id":"12345","policies":{"vendorField":"vendor-defined value"},"secret_key":"example-api-key","shard_id":"12345"}' \
  'https://dev-api-connectors.health.cloud/connectors/healthie/update-patient-insurance-billing'
```

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