Skip to main content
PUT
/
patients
/
{patient_id}
/
date_variables
/
{date_variable_id}
cURL
curl --request PUT \
  --url https://backend.claros.health/patients/{patient_id}/date_variables/{date_variable_id} \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "value": "2023-12-25",
  "note": "<string>",
  "pdf_page": 123,
  "highlight": {
    "x1": 123,
    "y1": 123,
    "x2": 123,
    "y2": 123
  }
}
'
{
  "id": 123,
  "patient_id": 123,
  "patient_name": "<string>",
  "date_variable_id": 123,
  "date_variable_name": "<string>",
  "value": "2023-12-25",
  "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 date variable value for a specific patient. This endpoint can be used to both create new patient date variable values and update existing ones.

Path Parameters

patient_id
integer
required
The ID of the patient
date_variable_id
integer
required
The ID of the date variable to update

Request Body

value
string
required
The date value in ISO 8601 format (YYYY-MM-DD)
note
string
An optional note about the date value. If not provided, any existing note will be kept.
pdf_page
integer
The page number in the patient’s PDF where this date 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": "2024-03-15",
  "note": "Scheduled during morning checkup",
  "pdf_page": 2,
  "highlight": {
    "x1": 100,
    "y1": 200,
    "x2": 300,
    "y2": 250
  }
}

Example Response

{
  "id": 1,
  "name": "Next Appointment",
  "value": "2024-03-15",
  "note": "Scheduled 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 date variable not found. The specified patient ID or date variable ID does not exist.

Authorizations

X-API-Key
string
header
required

Path Parameters

patient_id
integer
required

ID of the patient

date_variable_id
integer
required

ID of the date variable

Body

application/json
value
string<date>
required

Date value in ISO 8601 format (YYYY-MM-DD)

note
string

Optional note about the date value

pdf_page
integer

Page number in the patient's PDF where this date was found

highlight
object

Response

Patient date variable updated successfully

id
integer

The unique identifier of the patient date variable

patient_id
integer

The ID of the patient

patient_name
string

The name of the patient

date_variable_id
integer

The ID of the date variable

date_variable_name
string

The name of the date variable

value
string<date>

The date value in ISO 8601 format (YYYY-MM-DD)

note
string

Any additional notes about the date value

pdf_page
integer

The page number in the patient's PDF where this date was found

highlight
object