Skip to content

Patients

A Patient is the core entity. Each patient belongs to a user (patient.userId) and has glucose readings, custom thresholds, LibreLinkUp connections and treatments.

Dashboard vs public API: patient management (POST/PUT/DELETE /api/v1/patients) requires a session cookie. Programmatic access with an API key uses the public equivalents below — see the API reference.

Public API (API key)

Terminal window
curl "https://api.levelcast.org/api/v1/public/patients" -H "X-API-KEY: lc_your_key_here"
# → [{ "id": "…", "name": "…", "surname": "…" }]
curl "https://api.levelcast.org/api/v1/public/patients/summary" -H "X-API-KEY: lc_your_key_here"
# → per-patient latest glucose + units, paginated

Deeper per-patient data: …/readings, …/readings/latest, …/readings/resampled, …/treatments, …/custom-levels, …/insights, …/stats, …/events, …/daily/:date, plus …/connections and …/shared-links. All are GET (read scope) under /api/v1/public/patients/:patientId/.

Patient object

{
"id": "uuid",
"name": "John",
"surname": "Doe",
"diabetesType": "type1",
"unit": "mmol/L",
"storeReadings": true,
"treatments": [
{
"startDate": "2024-01-01",
"endDate": null,
"medications": [{ "name": "Metformin", "activePrinciples": [{ "name": "Metformin", "dose": "500", "unit": "mg" }] }]
}
],
"createdAt": "2024-01-01T00:00:00Z"
}
FieldNotes
diabetesTypetype1 / type2 / gestational / other / LADA
storeReadingstrue = persist to glucose_reading, false = tunnel mode (forward only)
treatmentsSorted newest first, endDate:null = active

Limits

patients: 4 (Free), 20 (Pro), ∞ (Clinic/Founder). Enforced at POST /api/v1/patients (canCreatePatient → 402). UI shows ApiStatCard X/4 + PremiumUpsellModal.

  • Treatments — see Treatments concept for patientTreatment + patientMedication tables and MedicationAnalytics.
  • Organizations — patients can be assigned to orgs via patientAssignment and appear in ViewOrganizationPatients with TIR sparkline.