Skip to main content
PUT
/
metrics
/
{metric_id}
Update a metric
curl --request PUT \
  --url https://backend.claros.health/metrics/{metric_id}/ \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "description": "<string>",
  "unit": "<string>",
  "calculation_formula": [
    "<string>"
  ],
  "filter_variable_id": 123,
  "low_quality_threshold": 123,
  "high_quality_threshold": 123,
  "is_ascending": true
}
'
{
  "id": 123,
  "name": "<string>",
  "calculation_formula": [
    "<string>"
  ],
  "patient_values_count": 123,
  "description": "<string>",
  "unit": "<string>",
  "filter_variable_id": 123,
  "low_quality_threshold": 123,
  "high_quality_threshold": 123,
  "is_ascending": true
}
This endpoint requires authentication. Include your API key in the request headers as X-API-Key.
This endpoint updates an existing metric.

Path Parameters

metric_id
integer
required
ID of the metric to update

Request Body

name
string
required
Name of the metric
description
string
Description of what the metric measures
unit
string
Unit of measurement for the metric
calculation_formula
array
required
Array of strings representing the formula used to calculate the metric
filter_variable_id
integer
ID of the variable used to filter patients for this metric
low_quality_threshold
number
The threshold below which quality is considered low
high_quality_threshold
number
The threshold above which quality is considered high
is_ascending
boolean
Whether higher values indicate better quality

Example Request

{
  "name": "Updated Blood Pressure Control",
  "description": "Updated percentage of patients with controlled blood pressure",
  "unit": "%",
  "calculation_formula": [
    "count(patients where bp < 140/90) / count(patients) * 100"
  ],
  "filter_variable_id": 1,
  "low_quality_threshold": 55.0,
  "high_quality_threshold": 90.0,
  "is_ascending": true
}

Response Fields

id
integer
required
Unique identifier of the updated metric
name
string
required
Name of the metric
description
string
Description of what the metric measures
unit
string
Unit of measurement for the metric
calculation_formula
array
required
Array of strings representing the formula used to calculate the metric
filter_variable_id
integer
ID of the variable used to filter patients for this metric
low_quality_threshold
number
The threshold below which quality is considered low
high_quality_threshold
number
The threshold above which quality is considered high
is_ascending
boolean
Whether higher values indicate better quality

Example Response

{
  "id": 1,
  "name": "Updated Blood Pressure Control",
  "description": "Updated percentage of patients with controlled blood pressure",
  "unit": "%",
  "calculation_formula": [
    "count(patients where bp < 140/90) / count(patients) * 100"
  ],
  "filter_variable_id": 1,
  "low_quality_threshold": 55.0,
  "high_quality_threshold": 90.0,
  "is_ascending": true
}

Error Responses

400
object
Invalid request data. Check the request body format and required fields.
401
object
Authentication failed. Invalid or missing API key.
404
object
Metric not found. The specified metric ID does not exist.

Path Parameters

metric_id
integer
required

Body

application/json
name
string

Name of the metric

description
string

Description of what the metric measures

unit
string

Unit of measurement for the metric

calculation_formula
string[]

Array of strings representing the formula used to calculate the metric

filter_variable_id
integer

ID of the variable used to filter patients for this metric

low_quality_threshold
number

The threshold below which quality is considered low

high_quality_threshold
number

The threshold above which quality is considered high

is_ascending
boolean

Whether higher values indicate better quality

Response

Metric updated successfully

id
integer
required

Unique identifier of the metric

name
string
required

Name of the metric

calculation_formula
string[]
required

Array of strings representing the formula used to calculate the metric

patient_values_count
integer
required

Number of patients with values for this metric

description
string

Description of what the metric measures

unit
string

Unit of measurement for the metric

filter_variable_id
integer

ID of the variable used to filter patients for this metric

low_quality_threshold
number

The threshold below which quality is considered low

high_quality_threshold
number

The threshold above which quality is considered high

is_ascending
boolean

Whether higher values indicate better quality