# Update demographics

Operation ID: `patient.updateDemographics`

Update the authenticated patient's DOB, sex_at_birth, gender_identity, ethnicity, marital_status, nationality, and/or preferred_language. Requires a patient Bearer JWT; the patient is always resolved from the token.

## Public method

`updateDemographics`

Signature: `patient.updateDemographics(request)`

Return type: `Promise<UpdatedResponse>`

## Authentication

Classification: **AUTHENTICATED**

Schemes: `bearerAuth`

## Prerequisites

None documented.

## HTTP

`PUT /patients/demographics`

## Path parameters

None.

## Query parameters

None.

## Body parameters

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

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

## Request example

```json
{
  "communications": [
    {
      "language": "string",
      "preferred": false
    }
  ],
  "date_of_birth": "2026-01-01",
  "ethnicity": "hispanic_or_latino",
  "gender_identity": "man",
  "marital_status": "single",
  "nationality": "st",
  "preferred_language": "string",
  "sex_at_birth": "male"
}
```

## Success responses

| Status | Shape | Content type | Description |
|---|---|---|---|
| `200` | [`UpdateDemographicsResponse`](../models/UpdateDemographicsResponse.md) | application/json | Demographics updated |

## Success response examples

### 200

```json
{
  "athena_status": "string",
  "athena_status_detail": "string",
  "openloop_status": "string",
  "steadymd_status": "string",
  "updated": true
}
```

## Common errors

| Status | Shape | Content type | Description |
|---|---|---|---|
| `400` | [`patient.ErrorResponse`](../models/patient.ErrorResponse.md) | application/json | Bad request — the body is empty or failed validation |
| `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 — Request body is required

```json
{
  "error": "Request body is required"
}
```

### 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 { DemographicsUpdateRequest } from "@healthcloudai/hc-sdk";
```

```ts
const request = {
  "communications": [
    {
      "language": "string",
      "preferred": false
    }
  ],
  "date_of_birth": "2026-01-01",
  "ethnicity": "hispanic_or_latino",
  "gender_identity": "man",
  "marital_status": "single",
  "nationality": "st",
  "preferred_language": "string",
  "sex_at_birth": "male"
};

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

## cURL

```bash
curl -X PUT \
  -H 'Authorization: Bearer <ACCESS_TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{"communications":[{"language":"string","preferred":false}],"date_of_birth":"2026-01-01","ethnicity":"hispanic_or_latino","gender_identity":"man","marital_status":"single","nationality":"st","preferred_language":"string","sex_at_birth":"male"}' \
  'https://dev-api-patient.health.cloud/patients/demographics'
```

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