Skip to main content
ByDoctor is an official Meta Business partner, which means every appointment action you take through the API can automatically send a WhatsApp message to the patient — no separate messaging infrastructure required. Confirmations, reminders, and cancellation notices arrive in the patient’s WhatsApp inbox moments after the corresponding event fires.

What triggers a WhatsApp message

Each stage of the appointment lifecycle maps to a specific notification type: Reminder messages are sent automatically by ByDoctor’s scheduling engine — you do not need to trigger them manually.

Controlling notifications with notify_patient

When you create an appointment via POST /appointments, the notify_patient flag controls whether ByDoctor sends the booking confirmation immediately.
Set notify_patient: true (or omit the field — it defaults to true) to send the WhatsApp confirmation as soon as the appointment is created. This is appropriate for any booking made in advance.

Checking notification delivery status

After an appointment is created, you can inspect the delivery history of all notifications sent for that appointment using GET /appointments/{id}/notifications.
Example response:
The possible status values are:

Patient phone number requirements

WhatsApp notifications are sent to the phone field stored on the patient record. The number must be in E.164 format — a leading +, followed by the country code, area code, and number, with no spaces or punctuation. To check and update a patient’s phone number:
If the phone field is missing or incorrectly formatted, update it with PATCH /patients/{id}:

Handling opt-outs

Patients can opt out of WhatsApp messages by replying with a stop keyword directly in WhatsApp. Once a patient has opted out, any attempt to send them a notification returns a whatsapp_opt_out error in the notification log:
When you encounter a whatsapp_opt_out error, consider falling back to an SMS or email notification flow in your integration. Do not attempt to re-enroll the patient programmatically — opt-out preferences must be managed by the patient directly.
You can preview the exact message template that will be sent for each notification type directly in the ByDoctor dashboard under Settings → WhatsApp Notifications. Previewing templates before going live is strongly recommended, particularly for clinics with branded language requirements.

Limitations

  • Sender number — Messages are sent from the ByDoctor official WhatsApp number. You cannot customise the sender number or use your clinic’s own WhatsApp Business number through this API.
  • Template content — Message templates are managed by ByDoctor and approved by Meta. Custom template text is not available via the API.
  • Timing — The 24-hour reminder is sent relative to starts_at in UTC. Confirm that appointment times are stored with the correct UTC offset to avoid reminders arriving at unexpected local times.
The ByDoctor Pro plan includes a monthly WhatsApp message quota. Confirmations, reminders, and cancellation notices each consume one message credit. Check your current usage and quota in the ByDoctor dashboard under Settings → Billing → WhatsApp Usage. Contact support if you expect to exceed your plan limit.