Appointments
The Appointments API allows you to book, manage, and track patient appointments with healthcare providers. Appointments are linked to patients via UHID and support various service types, specialties, and scheduling workflows.
Endpoints
/api/v1/appointments/Book an appointment/api/v1/appointments/List appointments/api/v1/appointments/{id}/Get appointment details/api/v1/appointments/availability/Search available slots/api/v1/appointments/by-patient/Get patient appointments/api/v1/appointments/by-practitioner/Get practitioner appointments/api/v1/appointments/{id}/cancel/Cancel appointment/api/v1/appointments/{id}/reschedule/Reschedule appointment/api/v1/appointments/{id}/check-in/Check in patient/api/v1/appointments/{id}/arrived/Mark patient arrived/api/v1/appointments/{id}/fulfilled/Mark appointment complete/api/v1/appointments/{id}/noshow/Mark no-showThe Appointment Object
Attributes
iduuidUnique identifier for the appointment.
appointment_numberstringHuman-readable appointment reference.
patient_uhidstringUHID of the patient.
patient_namestringPatient full name.
practitioner_iduuidID of the healthcare provider.
practitioner_namestringProvider full name.
facility_iduuidnullableID of the facility.
facility_namestringnullableFacility name.
statusstringAppointment status (see status values below).
service_type_codestringType of service (e.g., consultation).
specialty_codestringnullableMedical specialty code.
appointment_type_codestringROUTINE, WALKIN, CHECKUP, FOLLOWUP, EMERGENCY.
start_timedatetimeScheduled start time (ISO 8601).
end_timedatetimeScheduled end time (ISO 8601).
duration_minutesintegerDuration in minutes.
reason_textstringnullableReason for the appointment.
priorityintegerPriority (1-10, lower is higher priority).
patient_instructionstringnullableInstructions for the patient.
notesstringnullableInternal notes.
created_atdatetimeWhen the appointment was created.
{
"id": "apt-123-456-789",
"appointment_number": "APT-2024-001234",
"patient_uhid": "UG123456789A",
"patient_name": "John Doe",
"practitioner_id": "prov-abc-123",
"practitioner_name": "Dr. Sarah Nakamya",
"facility_id": "fac-xyz-789",
"facility_name": "Mulago Hospital",
"status": "booked",
"service_type_code": "consultation",
"specialty_code": "general-practice",
"appointment_type_code": "ROUTINE",
"start_time": "2024-01-20T10:00:00Z",
"end_time": "2024-01-20T10:30:00Z",
"duration_minutes": 30,
"reason_text": "General checkup",
"priority": 5,
"patient_instruction": "Please bring previous test results",
"created_at": "2024-01-15T10:00:00Z"
}Book an Appointment
Creates a new appointment for a patient with a healthcare provider.
/api/v1/appointments/Request Body
patient_uhidstringrequiredUHID of the patient
practitioner_iduuidrequiredID of the healthcare provider
service_type_codestringrequiredType of service
start_timedatetimerequiredStart time (ISO 8601)
end_timedatetimeoptionalEnd time (calculated from duration if not provided)
duration_minutesintegeroptionalDuration in minutes
Default: 30
slot_iduuidoptionalPre-selected slot ID
facility_iduuidoptionalFacility ID
specialty_codestringoptionalMedical specialty
appointment_type_codestringoptionalAppointment type
Default: ROUTINE
reason_textstringoptionalReason for visit
priorityintegeroptionalPriority (1-10)
Default: 5
patient_instructionstringoptionalInstructions for patient
notesstringoptionalInternal notes
curl -X POST https://api.mediloop.co/api/v1/appointments/ \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-d '{
"patient_uhid": "UG123456789A",
"practitioner_id": "prov-abc-123",
"service_type_code": "consultation",
"start_time": "2024-01-20T10:00:00Z",
"duration_minutes": 30,
"facility_id": "fac-xyz-789",
"reason_text": "General checkup"
}'{
"id": "apt-123-456-789",
"appointment_number": "APT-2024-001234",
"patient_uhid": "UG123456789A",
"status": "booked",
"start_time": "2024-01-20T10:00:00Z",
"end_time": "2024-01-20T10:30:00Z",
"created_at": "2024-01-15T10:00:00Z"
}List Appointments
Returns a filtered list of appointments.
/api/v1/appointments/Query Parameters
statusstringoptionalFilter by status
patient_uhidstringoptionalFilter by patient UHID
practitioner_iduuidoptionalFilter by practitioner
facility_iduuidoptionalFilter by facility
date_fromdateoptionalFilter from date
date_todateoptionalFilter to date
upcoming_onlybooleanoptionalOnly show upcoming appointments
curl "https://api.mediloop.co/api/v1/appointments/?patient_uhid=UG123456789A&upcoming_only=true" \
-H "Authorization: Bearer sk_test_..."{
"count": 1,
"results": [
{
"id": "apt-123-456-789",
"appointment_number": "APT-2024-001234",
"patient_uhid": "UG123456789A",
"status": "booked",
"start_time": "2024-01-20T10:00:00Z"
}
]
}Check Availability
Search for available appointment slots based on criteria.
/api/v1/appointments/availability/Query Parameters
date_fromdaterequiredStart date for search
date_todaterequiredEnd date for search
practitioner_iduuidoptionalFilter by practitioner
facility_iduuidoptionalFilter by facility
service_typestringoptionalFilter by service type
specialtystringoptionalFilter by specialty
duration_minutesintegeroptionalMinimum slot duration needed
curl "https://api.mediloop.co/api/v1/appointments/availability/?date_from=2024-01-20&date_to=2024-01-25&specialty=general-practice" \
-H "Authorization: Bearer sk_test_..."{
"count": 3,
"results": [
{
"id": "slot-001",
"practitioner_id": "prov-abc-123",
"practitioner_name": "Dr. Sarah Nakamya",
"facility_name": "Mulago Hospital",
"start_time": "2024-01-20T09:00:00Z",
"end_time": "2024-01-20T09:30:00Z",
"status": "free"
},
{
"id": "slot-002",
"practitioner_id": "prov-abc-123",
"practitioner_name": "Dr. Sarah Nakamya",
"facility_name": "Mulago Hospital",
"start_time": "2024-01-20T10:00:00Z",
"end_time": "2024-01-20T10:30:00Z",
"status": "free"
}
]
}Cancel Appointment
Cancels an existing appointment.
/api/v1/appointments/{id}/cancel/Request Body
cancellation_reason_codestringrequiredReason code for cancellation
cancellation_reason_textstringoptionalAdditional explanation
curl -X POST https://api.mediloop.co/api/v1/appointments/apt-123-456-789/cancel/ \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-d '{
"cancellation_reason_code": "patient-request",
"cancellation_reason_text": "Patient unable to attend"
}'{
"id": "apt-123-456-789",
"status": "cancelled",
"cancellation_reason_code": "patient-request",
"cancellation_reason_text": "Patient unable to attend",
"cancelled_at": "2024-01-18T14:00:00Z"
}Reschedule Appointment
Reschedules an appointment to a new time.
/api/v1/appointments/{id}/reschedule/Request Body
new_start_timedatetimerequiredNew start time
new_end_timedatetimeoptionalNew end time
new_slot_iduuidoptionalNew slot ID if using slots
reasonstringoptionalReason for rescheduling
curl -X POST https://api.mediloop.co/api/v1/appointments/apt-123-456-789/reschedule/ \
-H "Authorization: Bearer sk_test_..." \
-H "Content-Type: application/json" \
-d '{
"new_start_time": "2024-01-22T14:00:00Z",
"reason": "Provider schedule conflict"
}'{
"id": "apt-123-456-789",
"status": "booked",
"start_time": "2024-01-22T14:00:00Z",
"end_time": "2024-01-22T14:30:00Z",
"rescheduled_at": "2024-01-18T14:00:00Z"
}Appointment Status Values
| Status | Description |
|---|---|
proposed | Appointment has been proposed but not confirmed |
pending | Awaiting confirmation |
booked | Appointment is confirmed |
arrived | Patient has arrived at the facility |
checked-in | Patient has checked in |
fulfilled | Appointment completed successfully |
cancelled | Appointment was cancelled |
noshow | Patient did not show up |
Appointment Types
| Type | Description |
|---|---|
ROUTINE | Standard scheduled appointment |
WALKIN | Walk-in appointment |
CHECKUP | Regular health checkup |
FOLLOWUP | Follow-up from previous visit |
EMERGENCY | Emergency appointment |