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

Description

Creates a new date variable in the system. Date variables are used to track specific dates or time periods for patients.

Request Body

name
string
required
The name of the date variable (e.g., “Last Visit”, “Next Appointment”)
description
string
A description of what the date variable represents

Response

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

Example Request

{
  "name": "Last Visit",
  "description": "Date of the patient's last visit"
}

Example Response

{
  "id": 1,
  "name": "Last Visit",
  "description": "Date of the patient's last visit",
  "patient_values_count": 0
}

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

Name of the date variable

description
string

Description of the date variable

Response

Date variable created successfully

id
integer

The unique identifier of the date variable

name
string

The name of the date variable

description
string

A description of what the date variable represents

patient_values_count
integer

The number of patients that have values for this date variable