# Update patient attributes

Operation ID: `patient.updatePatientAttributes`

Partial merge-update of the authenticated patient's arbitrary JSON attributes. Keys in the request body are merged into the existing attributes dictionary; keys not named here are left unchanged. Requires a patient Bearer JWT; the patient is always resolved from the token.

## Public method

`updateAttributes`

Signature: `patient.updateAttributes(request)`

Return type: `Promise<PatientAttributes>`

## Authentication

Classification: **AUTHENTICATED**

Schemes: `bearerAuth`

## Prerequisites

None documented.

## HTTP

`PATCH /patients/attributes`

## Path parameters

None.

## Query parameters

None.

## Body parameters

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

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

## Request example

```json
{
  "production_testing": {
    "source": "documentation-example",
    "verified": true
  }
}
```

## Success responses

| Status | Shape | Content type | Description |
|---|---|---|---|
| `200` | [`UpdatePatientAttributesResponse`](../models/UpdatePatientAttributesResponse.md) | application/json | Complete patient attributes dictionary after merge |

## Success response examples

### 200

```json
{}
```

## Common errors

| Status | Shape | Content type | Description |
|---|---|---|---|
| `400` | [`patient.ErrorResponse`](../models/patient.ErrorResponse.md) | application/json | The attributes body failed validation (not an object, or a value JSON cannot represent) |
| `401` | [`patient.ErrorResponse`](../models/patient.ErrorResponse.md) | application/json | Authorization required — missing, invalid, expired, or non-patient Bearer JWT |
| `404` | [`patient.ErrorResponse`](../models/patient.ErrorResponse.md) | application/json | The authenticated patient has no FHIR Patient record |

## Error examples

### 400 — The attributes update failed validation

```json
{
  "error": "attributes must be an object"
}
```

### 401 — Missing or invalid access token

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

### 404 — Patient not found

```json
{
  "error": "Patient not found"
}
```

## NodeJS / TypeScript implementation

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

```ts
const request = {
  "production_testing": {
    "source": "documentation-example",
    "verified": true
  }
};

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

## cURL

```bash
curl -X PATCH \
  -H 'Authorization: Bearer <ACCESS_TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{"production_testing":{"source":"documentation-example","verified":true}}' \
  'https://dev-api-patient.health.cloud/patients/attributes'
```

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