Skip to Content
General APIPatients

General Patients API

General endpoints for patient management and information.

List Patients

Get a list of patients.

Endpoint: GET /v1/patients
Authentication: Required

Query Parameters

ParameterTypeRequiredDescription
pageintegerNoPage number for pagination
page_sizeintegerNoNumber of items per page
searchstringNoSearch term

Example Request

GET /v1/patients?page=1&page_size=25 HTTP/1.1 Content-Type: application/json X-User-Token: your_token_here

Create Patient

Endpoint: POST /v1/patients
Authentication: Required

Request Body Parameters

ParameterTypeRequiredDescription
patientobjectYesPatient data object
patient.first_namestringYesPatient’s first name
patient.last_namestringYesPatient’s last name
patient.date_of_birthstringYesDate of birth (YYYY-MM-DD)
patient.genderstringNoPatient’s gender
patient.phonestringNoPatient’s phone number
patient.emailstringNoPatient’s email address
patient.addressobjectNoPatient’s address

Example Request

POST /v1/patients HTTP/1.1 Content-Type: application/json X-User-Token: your_token_here { "patient": { "first_name": "John", "last_name": "Doe", "date_of_birth": "2010-05-15", "gender": "male", "phone": "+1-555-123-4567", "email": "[email protected]", "address": { "street": "123 Main St", "city": "Anytown", "state": "CA", "zip_code": "12345" } } }

Update Patient

Endpoint: PUT /v1/patients/{id}
Authentication: Required

Path Parameters

ParameterTypeRequiredDescription
idintegerYesPatient ID

Request Body Parameters

Same as Create Patient endpoint, but all fields are optional.

Get Patient Details

Endpoint: GET /v1/patients/{id}
Authentication: Required

Path Parameters

ParameterTypeRequiredDescription
idintegerYesPatient ID

Patient Gauges

List Patient Gauges

Get measurement gauges for a patient.

Endpoint: GET /v1/patients/{patient_id}/gauges
Authentication: Required

Path Parameters

ParameterTypeRequiredDescription
patient_idintegerYesPatient ID

Query Parameters

ParameterTypeRequiredDescription
gauge_typestringNoFilter by gauge type
start_datestringNoStart date filter (YYYY-MM-DD)
end_datestringNoEnd date filter (YYYY-MM-DD)

Example Request

GET /v1/patients/1049/gauges?gauge_type=mood&start_date=2023-10-01 HTTP/1.1 Content-Type: application/json X-User-Token: your_token_here

Response Format

Patient Response

{ "id": 1049, "first_name": "John", "last_name": "Doe", "date_of_birth": "2010-05-15", "age": 13, "gender": "male", "phone": "+1-555-123-4567", "email": "[email protected]", "address": { "street": "123 Main St", "city": "Anytown", "state": "CA", "zip_code": "12345" }, "active": true, "created_at": "2023-10-20T10:00:00.000Z", "updated_at": "2023-10-20T15:30:00.000Z" }

Patient Gauge Response

{ "id": 456, "patient_id": 1049, "gauge_type": "mood", "value": 7, "scale_min": 1, "scale_max": 10, "recorded_at": "2023-10-27T14:30:00.000Z", "notes": "Feeling better today", "created_at": "2023-10-27T14:30:00.000Z" }

Gauge Types

Common gauge types include:

  • mood - Mood rating scale
  • anxiety - Anxiety level scale
  • energy - Energy level scale
  • sleep_quality - Sleep quality rating
  • pain - Pain level scale
  • medication_adherence - Medication compliance
  • social_interaction - Social interaction level

Error Responses

422 Unprocessable Entity

{ "errors": { "first_name": ["can't be blank"], "last_name": ["can't be blank"], "date_of_birth": ["can't be blank", "must be a valid date"] } }

404 Not Found

{ "errors": "Patient not found" }

403 Forbidden

{ "errors": "You are not authorized to access this patient" }

Notes

  • Patient creation requires basic demographic information
  • Age is automatically calculated from date of birth
  • Gauges provide a way to track patient progress over time
  • Address information is optional but helpful for billing and communication
  • Patient access is controlled based on user permissions and relationships
  • All patient data is handled with appropriate privacy protections