# Import vitals

Operation ID: `patient.importVitals`

Import normalized wearable-device or FHIR vital-sign Observations for the authenticated patient. When `source` is set, `payload` is normalized via the matching wearable adapter; otherwise `observations`/`entries` is imported as-is. Requires a patient Bearer JWT.

## Public method

`importVitals`

Signature: `patient.importVitals(source, payload)`

Return type: `Promise<JsonValue>`

## Authentication

Classification: **AUTHENTICATED**

Schemes: `bearerAuth`

## Prerequisites

None documented.

## HTTP

`POST /patients/vitals/import`

## Path parameters

None.

## Query parameters

None.

## Body parameters

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

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

## Request example

```json
{
  "entries": [],
  "observations": [],
  "payload": [],
  "source": "apple_health"
}
```

## Success responses

| Status | Shape | Content type | Description |
|---|---|---|---|
| `200` | [`ImportVitalsResponse`](../models/ImportVitalsResponse.md) | application/json | Vitals import result |

## Success response examples

### 200

```json
{
  "athena_vitals": {
    "created": 0,
    "error": "string",
    "failed_readings": [
      {
        "clinicalelementid": "string",
        "error": "string",
        "loinc": "",
        "readingtaken": "string",
        "value": "string"
      }
    ],
    "skipped": 0,
    "status": "synced"
  },
  "imported": 0,
  "openloop_vitals": {
    "created": 0,
    "error": "string",
    "skipped": 0,
    "status": "synced"
  },
  "resource_ids": [
    {}
  ],
  "steadymd_vitals": {
    "created": 0,
    "error": "string",
    "skipped": 0,
    "status": "synced"
  }
}
```

## Common errors

| Status | Shape | Content type | Description |
|---|---|---|---|
| `400` | [`patient.ErrorResponse`](../models/patient.ErrorResponse.md) | application/json | The observations failed to normalize or import |
| `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 observations could not be imported

```json
{
  "error": "Invalid observation payload"
}
```

### 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";
```

```ts
const source = "<SOURCE>";

const payload = {
  "entries": [],
  "observations": [],
  "payload": [],
  "source": "apple_health"
};

const result = await patient.importVitals(source, payload);
```

## cURL

```bash
curl -X POST \
  -H 'Authorization: Bearer <ACCESS_TOKEN>' \
  -H 'Content-Type: application/json' \
  -d '{"entries":[],"observations":[],"payload":[],"source":"apple_health"}' \
  'https://dev-api-patient.health.cloud/patients/vitals/import'
```

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