Use Cases & Data Sync
Understanding the different booking scenarios and how Bot MD and your scheduling system stay synchronized through APIs and webhooks.
Booking Scenarios
There are three primary scenarios for appointment booking. Each follows a specific flow between Bot MD (downstream) and your scheduling system (upstream).
Use Case 1: Patient Books via Chat
Patient initiates booking through Bot MD (Messenger, Viber, SMS)
Patient requests appointment through chat interface
Bot MD calls POST /api/v1/appointments to create appointment
API Provider responds with appointmentId, temporaryPatientId, and/or patientId
API Provider sends webhook with appointment details to Bot MD
Bot MD stores IDs for future operations (reschedule/cancel)
Use Case 2: Patient Calls or Walks In to Book
Staff manually creates appointment in the scheduling system
Patient calls or visits hospital to book appointment
Staff creates appointment manually in the scheduling system
API Provider sends appointmentCreated webhook to Bot MD
Bot MD checks if patient is a new or existing contact and manages accordingly
Bot MD stores IDs for future operations (reschedule/cancel)
Use Case 3: Patient Walks In Without Appointment
Patient arrives without prior booking, staff creates on-the-spot appointment
Patient walks into the facility without a prior appointment
Staff creates appointment manually in the scheduling system
API Provider sends webhook with appointment details to Bot MD
Bot MD stores IDs for future communication and operations
Bot MD determines if patient is new or existing contact and manages accordingly
Data Synchronization
Bot MD and your scheduling system must stay synchronized to ensure patients receive accurate information. This is achieved through a combination of API calls and webhooks.
Bot MD → API Provider
When patients interact with Bot MD, we call your APIs to:
- Check availability and time slots
- Create new appointments
- Reschedule existing appointments
- Cancel appointments
- Look up patient records
API Provider → Bot MD
When events occur in your system, send webhooks to notify Bot MD:
- Appointment created (by staff)
- Appointment rescheduled
- Appointment canceled
- Patient checked in (Queued)
- Permanent patient ID assigned
What Bot MD Stores
Bot MD stores the following identifiers from your system to enable future operations:
appointmentIdUsed for reschedule/cancel operations
patientIdPermanent patient identifier
temporaryPatientIdUsed until permanent ID is assigned
Synchronization Best Practices
- 1
Always send webhooks when appointment status changes in your system, even for changes made by staff
- 2
Include all relevant IDs in webhook payloads (appointmentId, patientId, temporaryPatientId)
- 3
Send patientCreated webhook when a temporary patient ID is converted to a permanent patient ID
- 4
Include status field in all API responses and webhooks using the standardized status values
Appointment Status Values
The API Provider should include the appropriate status string in API responses and send the same status via webhooks whenever the status changes, so Bot MD stays in sync.
SCHEDULEDAppointment has been created/scheduled
RESCHEDULEDAppointment time has been changed
CANCELEDAppointment has been canceled
CONFIRMEDPatient confirms attendance (e.g., via reminder)
SHOWPatient physically checked in at the facility
NO SHOWPatient did not check in on the appointment date
Typical Status Flow
Alternative paths: SCHEDULED → RESCHEDULED → CONFIRMED, or SCHEDULED → CANCELED, or CONFIRMED → NO SHOW
API Reference
View detailed endpoint specifications
Integration Flows
Step-by-step user journeys
Getting Started
Integration overview