API Referenceapipatient-graphPOST /v1/patients/{patient_id}/metrics

POST /v1/patients/\{patient_id\}/metrics

Service: patient-graph · operationId: (none)

Required scopes

(no scope declared — review service config)

Path parameters

  • patient_id (string) required

Request body

{
  "type": "object",
  "properties": {
    "metric_key": {
      "type": "string",
      "minLength": 1
    },
    "value_numeric": {
      "type": "string"
    },
    "value_text": {
      "type": "string"
    },
    "unit": {
      "type": "string"
    },
    "source": {
      "type": "string",
      "enum": [
        "manual",
        "api",
        "upload"
      ]
    },
    "is_phi": {
      "type": "boolean"
    },
    "recorded_at": {
      "type": "string",
      "format": "date-time"
    }
  },
  "required": [
    "metric_key",
    "source",
    "recorded_at"
  ]
}

Responses

201 Metric entry created

{
  "type": "object",
  "properties": {
    "id": {
      "type": "string"
    },
    "patient_id": {
      "type": "string"
    },
    "brand_id": {
      "type": "string"
    },
    "metric_key": {
      "type": "string"
    },
    "value_numeric": {
      "type": [
        "string",
        "null"
      ]
    },
    "value_text": {
      "type": [
        "string",
        "null"
      ]
    },
    "unit": {
      "type": [
        "string",
        "null"
      ]
    },
    "source": {
      "type": "string"
    },
    "is_phi": {
      "type": "boolean"
    },
    "recorded_at": {
      "type": "string"
    },
    "created_at": {
      "type": "string"
    }
  },
  "required": [
    "id",
    "patient_id",
    "brand_id",
    "metric_key",
    "value_numeric",
    "value_text",
    "unit",
    "source",
    "is_phi",
    "recorded_at",
    "created_at"
  ]
}

404 Patient not found

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

500 Internal error

{
  "type": "object",
  "properties": {
    "error": {
      "type": "string"
    },
    "message": {
      "type": "string"
    }
  },
  "required": [
    "error",
    "message"
  ]
}

Example

curl -X POST https://patient-graph.platform.loop.health/v1/patients/{patient_id}/metrics \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{ ... }'