---
title: "Create patient health metrics"
method: POST
path: "/patient_health_metric"
tags: ["metric"]
---

# Create patient health metrics

`POST /patient_health_metric`

## Request

- Base URL: `https://api.twinehealth.com/pub`
- URL: `https://api.twinehealth.com/pub/patient_health_metric`
- Auth: none declared

Create one or more patient health metrics.

Example for creating a patient health result with a patient specified using `meta.query` instead of `id`:

```JSON
  {
    "data": {
      "type": "patient_health_metric",
       "attributes": {
         "code": {
           "system": "LOINC",
           "value": "13457-7"
         },
         "type": "ldl_cholesterol",
         "occurred_at": "2017-03-14T11:00:57.000Z",
         "value": 121,
         "unit": "mg/dl"
      },
      "relationships": {
        "patient": {
          "data": {
            "type": "patient",
            "meta": {
              "query": {
                "identifier": {
                  "system": "medical-record-number",
                  "value": "121212"
                },
                "organization": "58c4554710123c5c40dbab81"
              }
            }
          }
        }
      }
    }
  }
```

## Request body

- CreatePatientHealthMetricRequest
  - `meta` object
    - `ignore_duplicates` boolean: If `true`, the patient health metric will be ignored if there is an existing patient health metric for the same patient, with the same `type` and same `occurred_at`.
  - `data` PatientHealthMetricCreateResource, required: Note that `data` can either be a single object or an array of objects matching the schema specified here (bulk create).
    - `type` string, required
    - `id` string, required
    - `attributes` object
      - `type` 'blood_pressure_systolic' | 'blood_pressure_diastolic' | 'hemoglobin_a1c' | 'hdl_cholesterol' | 'ldl_cholesterol' | 'total_cholesterol' | 'triglycerides' | 'blood_urea_nitrogen' | 'creatinine' | 'hemoglobin' | 'hematocrit' | 'total_serum_iron' | 'thyroid_stimulating_hormone' | 'free_thyroxine' | 'free_triiodothyronine' | 'total_triiodothyronine' | 'cd4_cell_count' | 'hiv_viral_load' | 'inr' | 'free_testosterone' | 'total_testosterone' | 'c_reactive_protein' | 'prostate_specific_antigen' | 'cotinine' | 'c_peptide' | 'blood_pressure' | 'blood_glucose' | 'weight' | 'heart_rate' | 'body_fat_percentage' | 'body_mass_index' | 'body_temperature' | 'forced_expiratory_volume1' | 'forced_vital_capacity' | 'lean_body_mass' | 'nausea_level' | 'oxygen_saturation' | 'pain_level' | 'peak_expiratory_flow_rate' | 'peripheral_perfusion_index' | 'respiratory_rate' | 'inhaler_usage'
      - `code` object
        - `system` string, required
        - `value` string, required
      - `value` unknown
      - `systolic` number
      - `diastolic` number
      - `unit` string
      - `occurred_at` string, dateTime
    - `relationships` object
      - `patient` object
        - `data` object
          - `type` string
          - `id` string: Required if the `meta.query` is not defined.
          - `meta` object: Allows the specification of a query for a patient rather than providing a patient id directly
            - `query` object, required: The query must return one and only one patient.
              - …
        - `links` object

## Response `200`

OK

- CreatePatientHealthMetricResponse
  - `meta` CreateOrUpdateMetaResponse
    - `req_id` string
    - `ignored` string[]
  - `data` PatientHealthMetricResource, required
    - `type` string, required
    - `id` string, required
    - `attributes` object
      - `type` 'blood_pressure_systolic' | 'blood_pressure_diastolic' | 'hemoglobin_a1c' | 'hdl_cholesterol' | 'ldl_cholesterol' | 'total_cholesterol' | 'triglycerides' | 'blood_urea_nitrogen' | 'creatinine' | 'hemoglobin' | 'hematocrit' | 'total_serum_iron' | 'thyroid_stimulating_hormone' | 'free_thyroxine' | 'free_triiodothyronine' | 'total_triiodothyronine' | 'cd4_cell_count' | 'hiv_viral_load' | 'inr' | 'free_testosterone' | 'total_testosterone' | 'c_reactive_protein' | 'prostate_specific_antigen' | 'cotinine' | 'c_peptide' | 'blood_pressure' | 'blood_glucose' | 'weight' | 'heart_rate' | 'body_fat_percentage' | 'body_mass_index' | 'body_temperature' | 'forced_expiratory_volume1' | 'forced_vital_capacity' | 'lean_body_mass' | 'nausea_level' | 'oxygen_saturation' | 'pain_level' | 'peak_expiratory_flow_rate' | 'peripheral_perfusion_index' | 'respiratory_rate' | 'inhaler_usage'
      - `code` object
        - `system` string, required
        - `value` string, required
      - `value` unknown
      - `systolic` number
      - `diastolic` number
      - `unit` string
      - `occurred_at` string, dateTime
    - `relationships` object
      - `patient` object
        - `data` object
          - `type` string
          - `id` string: Required if the `meta.query` is not defined.
          - `meta` object: Allows the specification of a query for a patient rather than providing a patient id directly
            - `query` object, required: The query must return one and only one patient.
              - …
        - `links` object

## Other responses

- `401`: Unauthorized
- `403`: Forbidden
- `409`: Invalid Request

---

[API](https://skmtc.dev/twinehealth/apis/fitbit-plus-api.md) - [All operations](https://skmtc.dev/twinehealth/apis/fitbit-plus-api/llms.txt) - [OpenAPI document](https://skmtc.dev/twinehealth/apis/fitbit-plus-api/revisions/1c92481b5836?raw)
