Skip to main content
PUT
/
variables
/
{variable_id}
cURL
curl --request PUT \
  --url https://backend.claros.health/variables/{variable_id} \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "name": "<string>",
  "units": "<string>",
  "description": "<string>"
}
'
{
  "id": 123,
  "name": "<string>",
  "units": "<string>",
  "description": "<string>",
  "patient_values_count": 123
}
This endpoint requires authentication. Include your API key in the request headers as X-API-Key.

Description

Updates an existing variable’s properties. You can modify the name, units, and description of a variable.

Path Parameters

variable_id
integer
required
The ID of the variable to update

Request Body

name
string
The new name of the variable. If not provided, the existing name will be kept.
units
string
The new units of measurement for the variable. If not provided, the existing units will be kept.
description
string
The new description of what the variable represents. If not provided, the existing description will be kept.
All fields in the request body are optional. Only the fields you want to update need to be included. Any fields not included in the request will retain their existing values.

Example Request

{
  "name": "Blood Pressure (Updated)",
  "units": "mmHg",
  "description": "Updated description for blood pressure measurements"
}

Example Response

{
  "id": 1,
  "name": "Blood Pressure (Updated)",
  "units": "mmHg",
  "description": "Updated description for blood pressure measurements",
  "patient_values_count": 150
}

Error Responses

400
object
Invalid request data. The response will include an error message explaining what went wrong.
401
object
Authentication required. Make sure you’ve included a valid API key in the request headers.
404
object
Variable not found. The specified variable ID does not exist.

Authorizations

X-API-Key
string
header
required

Path Parameters

variable_id
integer
required

ID of the variable to update

Body

application/json
name
string

Name of the variable

units
string

Units of measurement

description
string

Description of the variable

Response

Variable updated successfully

id
integer
name
string
units
string
description
string
patient_values_count
integer