Clinical Master Portal
Exhaustive API specification for the GlucoCare clinical ecosystem.
🛑 ATTENTION: All routes requiring JWT must include "Authorization: Bearer <token>" in the header.
CONSULTANT MODE ENABLED
Doctors can monitor ALL patients via the /api/consultant gateway. All response
payloads mirror the standard patient API but are optimized for professional clinical dashboards.
GUARDIAN PROTOCOL ACTIVE
Next of Kin users can monitor patient data by adding ?userId={patientId} to retrieval
endpoints (Readings, Meals, Alerts, etc). Verified via Email/Phone credentials.
Gateways & Sessions
POST /api/auth/register
Payload Sample
{
"displayName": "John Doe",
"email": "john@gluco.care",
"phone": "09012345678",
"password": "securePass123",
"role": "patient"
}
NOTE
Supports 'patient', 'next_of_kin', and 'doctor' roles. Phone numbers are
automatically normalised to E.164.
POST /api/auth/login
Payload Sample
{
"identifier": "john@gluco.care",
"password": "securePass123"
}
UNIVERSAL LOGIN
Input 'identifier' can be either an Email address or a Phone number (in any
Nigerian format).
POST /api/auth/refresh
TOKEN ROTATION
Refresh your JWT before it expires. Requires the current token in the
Authorization header.
GET /api/auth/me
LIGHTWEIGHT IDENTITY
Returns basic ID card: uid, displayName, email, role. No clinical profile
data included.
POST /api/auth/logout
TERMINATE
Blacklists the current JWT.
Security Recovery (OTP)
2-STEP OTP FLOW
Step 1: Request OTP → sent to email + SMS. Step 2: Submit OTP to get a signed
reset token. Step 3: POST new password using the reset token. Each OTP expires in 10
minutes.
POST /api/auth/forgot-password
{ "email": "john@gluco.care" }
STEP 1
Generates a random 6-digit OTP and delivers it via Email +
SMS. OTP is valid for 10 minutes.
POST /api/auth/verify-otp
{ "email": "john@gluco.care", "otp": "482916" }
STEP 2
Validates the OTP. On success, returns a
reset_token (a signed
URL valid for 15 min). OTP is immediately invalidated after use — cannot be reused.POST /api/auth/reset-password/{id}
{ "password": "newSecurePassword123" }
🔒 SIGNED RESET TOKEN REQUIRED (from verify-otp response)
STEP 3
Use the full
reset_token URL returned by verify-otp as the
request URL. The token is a signed Laravel URL that contains the user ID and expires in 15
minutes.Email Verification
HOW IT WORKS
A "Verify My Email" button is embedded in the welcome email on registration.
Clicking it calls the endpoint below and sets
email_verified_at on the user record. The
emailVerified flag is returned on every login/register response.GET /api/auth/verify-email/{id}
🔒 SIGNED URL REQUIRED (embedded in welcome email)
EMAIL CONFIRMED
Called automatically when user clicks the link in the welcome email. Sets
email_verified_at = now(). Link is valid for 72 hours from registration.Doctor Portal: Credentials & Identity
GET /api/consultant/profile
🔒 DOCTOR ROLE REQUIRED
PATCH POST
/api/consultant/profile
Payload Sample
{
"displayName": "Dr. John Doe",
"organization": "Apex Medical Group",
"hospital_affiliation": "St. Jude Hospital",
"contact_email": "dr.john@apexmedical.com",
"specialization": "Endocrinologist",
"experience_years": 15,
"license_number": "MD-459021-AX",
"bio": "Specializing in Type 1 Diabetes management.",
"consultation_fee": "$150/hr",
"availability_status": "available"
}
🔒 DOCTOR ROLE REQUIRED
Doctor Portal: Discovery
GET /api/consultant/patients
🔒 DOCTOR ROLE REQUIRED
NOTE
Lists all metabolic patients. Supports ?search=... for name/email lookup.
Paginated by default.
GET /api/consultant/patients/{userId}
🔒 DOCTOR ROLE REQUIRED
NOTE
Gets full patient profile, including Bio-Targets and Next of Kin contact
records.
Doctor Portal: Clinical Oversight
GET /api/consultant/patients/{userId}/glucose
🔒 DOCTOR ROLE REQUIRED
GET /api/consultant/patients/{userId}/stats
🔒 DOCTOR ROLE REQUIRED
NOTE
Returns patient Tir (Time in Range), estimated HbA1c, and trend analytics.
GET /api/consultant/patients/{userId}/medications
🔒 DOCTOR ROLE REQUIRED
GET /api/consultant/patients/{userId}/activity
🔒 DOCTOR ROLE REQUIRED
GET /api/consultant/patients/{userId}/activity/stats
🔒 DOCTOR ROLE REQUIRED
GET /api/consultant/patients/{userId}/nutrition
🔒 DOCTOR ROLE REQUIRED
GET /api/consultant/patients/{userId}/nutrition/stats
🔒 DOCTOR ROLE REQUIRED
GET /api/consultant/patients/{userId}/alerts
🔒 DOCTOR ROLE REQUIRED
GET /api/consultant/patients/{userId}/report
🔒 DOCTOR ROLE REQUIRED
NOTE
Generates an exhaustive Unified Health Report for medical consultation.
Clinical Comms: Infinite Threads
The hyper-scale, zero-join continuous messaging ecosystem. Completely symmetric for both Doctors and Patients.
GET /api/chats
🔒 ROLE AGNOSTIC (Patient or Doctor)
CACHED INBOX
Returns the zero-join hyper-fast inbox counting badges and snippets natively
in milliseconds.
POST /api/chats/initiate
{ "targetUserId": "uuid-here" }
🔒 ROLE AGNOSTIC (Patient or Doctor)
NO DUPLICATES
Returns a brand new conversationId or instantly retrieves the existing
infinite thread container. Always run this before chatting a new person!
GET /api/chats/{conversationId}
🔒 ROLE AGNOSTIC (Patient or Doctor)
INFINITE SCROLLING
Returns chat bubbles (50 per page). Leverages B-Tree indexing to ensure
loading page 20 is just as fast as page 1.
POST /api/chats/{conversationId}/messages
{ "content": "Hello doctor, my glucose spiked." }
🔒 ROLE AGNOSTIC (Patient or Doctor)
PATCH /api/chats/{conversationId}/read
🔒 ROLE AGNOSTIC (Patient or Doctor)
BLUE TICKS
Fired when opening the chat screen. Marks other person's bubbles as read, and
wipes the unread inbox badge back to zero!
Role-Aware Profile Management
GET /api/me
🔒 JWT REQUIRED
AUTO-RESOLVE
Returns your central identity PLUS your role-specific profile (patient,
doctor, or next_of_kin) and baseline clinical vitals if applicable.
PUT /api/me
Update Generic & Patient Profile
{
"displayName": "John Updated Doe",
"phone": "09012345678",
"diabetes_type": "type2",
"baseline_weight_kg": 85.5,
"baseline_glucose_mg_dl": 110,
"theme": "dark",
"notification": true
}
🔒 JWT REQUIRED
DYNAMIC VALIDATION
The API intelligently maps shared fields (name/phone) to the user table while
routing clinical vitals to specialized profile tables.
GET /api/users/{userId}
🔒 JWT REQUIRED
PATCH /api/users/{userId}
🔒 JWT REQUIRED
DELETE /api/users/{userId}
🔒 JWT REQUIRED
GET /api/users/{userId}/export
🔒 JWT REQUIRED
DATA PORTABILITY
Generates a JSON dump of all user data.
GET /api/users/{userId}/next-of-kin
🔒 JWT REQUIRED
POST /api/users/{userId}/next-of-kin
Payload Sample
{
"displayName": "Jane Doe",
"relationship": "Spouse",
"phone": "09012345678",
"email": "jane@example.com",
"address": "123 Clinical St.",
"isEmergencyContact": true
}
🔒 JWT REQUIRED
GUARDIAN ACTIVATION
Adding a NOK with a valid email allows that person to register/login and
monitor your metabolic data.
DELETE /api/next-of-kin/{nokId}
🔒 JWT REQUIRED
App Preferences
User-level settings stored on the users table. All auth responses (login, register, /me) already include the current preference state.
PATCH /api/me/preferences
Payload Sample
{
"theme": "light",
"biometric": true,
"notification": true,
"notification_token": "fcm_or_apns_device_token_here"
}
🔒 JWT REQUIRED
FIELDS
theme —
biometric —
notification —
notification_token — FCM (Android) or APNS (iOS) push device token. Store on app start/login.
"light" or "dark" (default: dark)biometric —
true/false. Mobile app fingerprint /
face-id flag.notification —
true/false. Master toggle for all push
and in-app alerts.notification_token — FCM (Android) or APNS (iOS) push device token. Store on app start/login.
Glucose Tracking
POST /api/glucose/readings
{ "valueMgDl": 120, "context": "fasting", "recordedAt": "2026-04-03T07:00:00Z" }
🔒 JWT REQUIRED
GET /api/glucose/readings
🔒 JWT REQUIRED
NOTE
Accepts ?userId=... ?from=... ?to=... for guardian oversight.
DELETE /api/glucose/readings/{readingId}
🔒 JWT REQUIRED
Medication Matrix
POST /api/medications
Payload Sample
{
"name": "Metformin",
"doseMg": 500,
"doseUnit": "mg",
"type": "tablet",
"scheduleTimes": [{"hour": 8, "minute": 0}, {"hour": 20, "minute": 0}],
"mealTiming": "after_meal"
}
🔒 JWT REQUIRED
GET /api/medications
🔒 JWT REQUIRED
NOTE
Returns current active prescriptions. Supports ?activeOnly=true.
PATCH /api/medications/{medicationId}
🔒 JWT REQUIRED
DELETE /api/medications/{medicationId}
🔒 JWT REQUIRED
Adherence Logs
POST /api/medications/{medicationId}/logs
{ "scheduledTime": {"hour": 8, "minute": 0}, "skipped": false }
🔒 JWT REQUIRED
GET /api/medications/logs
🔒 JWT REQUIRED
GET /api/medications/schedule
🔒 JWT REQUIRED
DAILY AGENDA
Returns what doses are pending or completed for a specific date
(?date=2024-04-05).
Dietary Intelligence
POST /api/nutrition/meals
{ "name": "Oatmeal", "mealType": "breakfast", "carbsG": 45, "proteinG": 10, "fatG": 5, "calories": 300, "loggedAt": "2026-04-03T07:30:00Z" }
🔒 JWT REQUIRED
GET /api/nutrition/meals
🔒 JWT REQUIRED
DELETE /api/nutrition/meals/{mealId}
🔒 JWT REQUIRED
GET /api/nutrition/stats
🔒 JWT REQUIRED
NOTE
Returns summary totals and daily averages for the requested period.
GET /api/nutrition/meal-suggestions
🔒 JWT REQUIRED
WEEKLY PLAN
Returns the full 7-day Nigerian diabetic meal plan.
GET /api/nutrition/meal-suggestions/today
🔒 JWT REQUIRED
POST /api/nutrition/meal-suggestions
FORM-DATA PARAMETERS (Postman Matrix)
🔒 DOCTOR ROLE REQUIRED
STRICT VALIDATION
Permitted formats: jpeg, png, jpg, webp. Maximum size: 2,048 KB (2MB).
PATCH /api/nutrition/meal-suggestions/{id}
🔒 DOCTOR ROLE REQUIRED
Fitness Analytics
POST /api/activity/logs
{ "type": "walking", "durationMinutes": 30, "caloriesBurned": 150, "intensity": "moderate", "loggedAt": "2026-04-03T18:00:00Z" }
🔒 JWT REQUIRED
GET /api/activity/logs
🔒 JWT REQUIRED
GET /api/activity/stats
🔒 JWT REQUIRED
Health Notifications
POST /api/alerts
Payload Sample
{
"title": "Abnormal Glucose Detected",
"message": "Fasting glucose of 250 mg/dL is critically high.",
"severity": "critical"
}
🔒 JWT REQUIRED
GET /api/alerts/unread
🔒 JWT REQUIRED
NOTE
Accepts ?userId=... ?unreadOnly=true for guardian monitoring. Severity can be
filtered via ?severity=critical.
PATCH /api/alerts/{alertId}/read
🔒 JWT REQUIRED
PATCH /api/alerts/read-all
🔒 JWT REQUIRED
DELETE /api/alerts/{alertId}
🔒 JWT REQUIRED
POST /api/notifications/custom-push
Payload Sample
{ "title": "Meal Reminder", "message": "It's time for lunch!", "user_id": "(optional uuid)" }
🔒 JWT REQUIRED
CUSTOM PUSH API (MOBILE)
Allows the mobile app to trigger a custom Firebase push notification
instantly. If
user_id is omitted, it sends the push to the authenticated user.
Otherwise, it sends to the specified user. Respects the target user's notification
preference.GET /api/notifications/inbox
🔒 JWT REQUIRED
Retrieves a paginated list of all in-app database notifications stored via
web-alert.Knowledge & Reporting
GET /api/education/articles
🔒 JWT REQUIRED
GET /api/education/articles/{articleId}
🔒 JWT REQUIRED
GET /api/education/daily-tips/random
🔒 JWT REQUIRED
POST /api/education/articles
{ "title": "New Research", "category": "education", "content": "# Markdown Content" }
🔒 DOCTOR ROLE REQUIRED
POST /api/education/faqs
{ "question": "Why water?", "answer": "Hydration." }
🔒 DOCTOR ROLE REQUIRED
DELETE /api/education/{article|faq|daily-tips}/{id}
🔒 DOCTOR ROLE REQUIRED
ADMIN DISCARD
Permits removal of education/clinical resources.
GET /api/reports/health
🔒 JWT REQUIRED
NOTE
Supports ?userId=... for guardians to generate medical dossiers.
POST /api/sync
OFFLINE SYNC
Bulk upload offline readings, logs, and meal data.