Notifications
The Notifications API enables multi-channel communication with patients and providers. Send appointment reminders, lab result alerts, prescription notifications, and more via SMS, Email, Push, and WhatsApp.
Trigger Endpoints
Use these pre-built trigger endpoints for common notification types:
/api/v1/triggers/appointment-reminder/Send appointment reminder/api/v1/triggers/lab-result/Notify lab results ready/api/v1/triggers/critical-alert/Critical lab value alert/api/v1/triggers/prescription-ready/Prescription ready notification/api/v1/triggers/delivery-status/Delivery status update/api/v1/triggers/care-plan-update/Care plan update notification/api/v1/triggers/payment-reminder/Payment reminderAppointment Reminder
Send an appointment reminder to a patient via their preferred channels.
/api/v1/triggers/appointment-reminder/Request Body
patient_uhidstringrequiredPatient UHID
appointment_idstringrequiredAppointment ID
provider_namestringrequiredHealthcare provider name
facility_namestringrequiredFacility name
appointment_datedatetimerequiredAppointment date/time (ISO 8601)
appointment_typestringoptionalType of appointment
notesstringoptionalAdditional notes for patient
curl -X POST https://api.mediloop.co/api/v1/triggers/appointment-reminder/ \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-d '{
"patient_uhid": "UG123456789A",
"appointment_id": "apt-123-456",
"provider_name": "Dr. Sarah Nakamya",
"facility_name": "Mulago Hospital",
"appointment_date": "2024-01-20T10:00:00Z",
"appointment_type": "General Consultation",
"notes": "Please bring previous test results"
}'{
"success": true,
"notification_id": "notif-550e8400-e29b-41d4",
"notification_number": "NOTIF-20240115-0001"
}Lab Result Ready
Notify a patient that their lab results are ready for viewing.
/api/v1/triggers/lab-result/Request Body
patient_uhidstringrequiredPatient UHID
observation_idstringrequiredLab observation ID
test_namestringrequiredName of the test
ordered_bystringrequiredOrdering provider name
facility_namestringrequiredLab facility name
curl -X POST https://api.mediloop.co/api/v1/triggers/lab-result/ \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-d '{
"patient_uhid": "UG123456789A",
"observation_id": "obs-789-012",
"test_name": "Complete Blood Count",
"ordered_by": "Dr. James Okello",
"facility_name": "Lancet Laboratories"
}'{
"success": true,
"notification_id": "notif-660f9500-f30c-52e5",
"notification_number": "NOTIF-20240115-0002"
}Critical Lab Value Alert
Send urgent notification for critical lab values. This notifies BOTH the patient and their provider. Critical alerts bypass quiet hours and consent preferences.
/api/v1/triggers/critical-alert/Request Body
patient_uhidstringrequiredPatient UHID
provider_idstringrequiredProvider ID to notify
observation_idstringrequiredLab observation ID
test_namestringrequiredName of the test
valuestringrequiredCritical value
unitstringrequiredUnit of measurement
reference_rangestringrequiredNormal reference range
patient_namestringrequiredPatient name (for provider notification)
curl -X POST https://api.mediloop.co/api/v1/triggers/critical-alert/ \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-d '{
"patient_uhid": "UG123456789A",
"provider_id": "prov-abc-123",
"observation_id": "obs-critical-001",
"test_name": "Blood Glucose",
"value": "350",
"unit": "mg/dL",
"reference_range": "70-100 mg/dL",
"patient_name": "John Doe"
}'{
"success": true,
"notifications_created": 2,
"notification_ids": [
"notif-patient-001",
"notif-provider-001"
]
}Prescription Ready
Notify a patient that their prescription is ready. Note: MediLoop is a marketplace - patients can purchase from any participating pharmacy.
/api/v1/triggers/prescription-ready/Request Body
patient_uhidstringrequiredPatient UHID
prescription_idstringrequiredPrescription ID
medication_namestringrequiredMedication name
prescriber_namestringrequiredPrescribing provider
facility_namestringrequiredPrescribing facility
instructionsstringoptionalDosage instructions
curl -X POST https://api.mediloop.co/api/v1/triggers/prescription-ready/ \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-d '{
"patient_uhid": "UG123456789A",
"prescription_id": "rx-456-789",
"medication_name": "Amoxicillin 500mg",
"prescriber_name": "Dr. Sarah Nakamya",
"facility_name": "Mulago Hospital",
"instructions": "Take 3 times daily with food for 7 days"
}'{
"success": true,
"notification_id": "notif-rx-001",
"notification_number": "NOTIF-20240115-0003"
}Delivery Status Update
Notify a patient about their delivery status (medication delivery, specimen collection, etc.).
/api/v1/triggers/delivery-status/Request Body
patient_uhidstringrequiredPatient UHID
delivery_idstringrequiredDelivery order ID
statusstringrequiredDelivery status
delivery_typestringrequiredType: medication, specimen, equipment
estimated_timestringoptionalEstimated delivery time
courier_namestringoptionalCourier name
courier_phonestringoptionalCourier phone
curl -X POST https://api.mediloop.co/api/v1/triggers/delivery-status/ \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-d '{
"patient_uhid": "UG123456789A",
"delivery_id": "del-123-456",
"status": "out_for_delivery",
"delivery_type": "medication",
"estimated_time": "30 minutes",
"courier_name": "James",
"courier_phone": "+256700555666"
}'{
"success": true,
"notification_id": "notif-del-001",
"notification_number": "NOTIF-20240115-0004"
}Notification Channels
Notifications are sent via the patient's preferred channels:
| Channel | Description | Cost (UGX) |
|---|---|---|
SMS | Text message via Africa's Talking | 80 |
EMAIL | Email via AWS SES | 20 |
PUSH | Mobile push notification | Free |
WHATSAPP | WhatsApp message | 200 |
Notification Status
| Status | Description |
|---|---|
PENDING | Queued for processing |
PROCESSING | Currently being sent |
SENT | Sent to provider |
DELIVERED | Confirmed delivered |
FAILED | Delivery failed |
CANCELLED | Cancelled before sending |