Skip to main content
POST
/
variables
/
create
cURL
curl --request POST \
  --url https://backend.claros.health/variables/create/ \
  --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>",
  "user_id": 123
}
This endpoint requires authentication. Include your API key in the request headers as X-API-Key.

Description

Creates a new variable in the system. Variables are used to track specific measurements or data points for patients.

Request Body

name
string
required
The name of the variable (e.g., “Blood Pressure”, “Heart Rate”)
units
string
The units of measurement for the variable (e.g., “mmHg”, “bpm”)
description
string
A description of what the variable represents

Response

id
integer
The unique identifier of the created variable
name
string
The name of the variable
units
string
The units of measurement for the variable
description
string
A description of what the variable represents
patient_values_count
integer
The number of patients that have values for this variable (initially 0)

Example Request

{
  "name": "Systolic Blood Pressure",
  "units": "mmHg",
  "description": "Systolic and diastolic blood pressure measurements"
}

Example Response

{
  "id": 1,
  "name": "Systolic Blood Pressure",
  "units": "mmHg",
  "description": "Systolic and diastolic blood pressure measurements",
  "user_id": 123
}

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.

Authorizations

X-API-Key
string
header
required

Body

application/json
name
string
required

The name of the variable (e.g., "Blood Pressure", "Heart Rate")

units
string

The units of measurement for the variable (e.g., "mmHg", "bpm")

description
string

A description of what the variable represents

Response

Variable created successfully

id
integer

The unique identifier of the created variable

name
string

The name of the variable

units
string

The units of measurement for the variable

description
string

A description of what the variable represents

user_id
integer

The ID of the user who created the variable