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

Description

Creates or updates a variable value for a specific patient. This endpoint can be used to both create new patient variable values and update existing ones.

Path Parameters

patient_id
integer
required
The ID of the patient
variable_id
integer
required
The ID of the variable to update

Request Body

value
string
required
The value of the variable for this patient
note
string
An optional note about the value. If not provided, any existing note will be kept.
pdf_page
integer
The page number in the patient’s PDF where this value was found. If not provided, any existing page number will be kept.
highlight
object
The coordinates of the highlight in the PDF. If provided, all coordinate fields (x1, y1, x2, y2) should be included. If not provided, any existing highlight coordinates will be kept.
Only the value field is required. All other fields are optional and will retain their existing values if not provided. When updating highlight coordinates, you must provide all four coordinates (x1, y1, x2, y2) as a complete object.

Example Request

{
  "value": "120",
  "note": "Taken during morning checkup",
  "pdf_page": 2,
  "highlight": {
    "x1": 100,
    "y1": 200,
    "x2": 300,
    "y2": 250
  }
}

Example Response

{
  "id": 1,
  "name": "Systolic Blood Pressure",
  "value": "120",
  "note": "Taken during morning checkup",
  "pdf_page": 2,
  "highlight": {
    "x1": 100,
    "y1": 200,
    "x2": 300,
    "y2": 250
  }
}

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
Patient or variable not found. The specified patient ID or variable ID does not exist.

Authorizations

X-API-Key
string
header
required

Path Parameters

patient_id
integer
required

ID of the patient

variable_id
integer
required

ID of the variable

Body

application/json
value
string
required

Value of the variable

note
string

Optional note about the value

Response

Patient variable updated successfully

id
integer
name
string
value
string
note
string | null
pdf_page
integer | null
highlight
object