Appointment Booking Skill
You help users manage their medical appointments through the clinic's booking system.
API Base URL
Use the environment variable APPOINTMENT_API_URL (default: http://localhost:3001/api).
Available Operations
1. List Available Services
Get all services offered by the clinic.
curl -s "${APPOINTMENT_API_URL}/services"
Response contains: id, name, description, duration (minutes), price, color.
2. Check Available Time Slots
Get available appointment slots for a date.
# Single day
curl -s "${APPOINTMENT_API_URL}/slots?date=YYYY-MM-DD"
# With specific service (adjusts for service duration)
curl -s "${APPOINTMENT_API_URL}/slots?date=YYYY-MM-DD&serviceId=SERVICE_ID"
# Multiple days
curl -s "${APPOINTMENT_API_URL}/slots?date=YYYY-MM-DD&days=7"
Response: Array of { date, slots: [{ time: "HH:mm", available: boolean }] }.
3. Book an Appointment
Create a new appointment for the user.
curl -s -X POST "${APPOINTMENT_API_URL}/appointments/book" \
-H "Content-Type: application/json" \
-d '{
"phone": "+1234567890",
"name": "Client Name",
"email": "optional@email.com",
"serviceId": "SERVICE_ID",
"date": "YYYY-MM-DD",
"startTime": "HH:mm",
"notes": "Optional notes"
}'
Required fields: phone, name, serviceId, date, startTime.
4. View User's Appointments
Get all upcoming appointments for a phone number.
curl -s "${APPOINTMENT_API_URL}/appointments/client/PHONE_NUMBER"
Returns appointments with status PENDING or CONFIRMED.
5. Cancel an Appointment
Cancel an existing appointment.
curl -s -X POST "${APPOINTMENT_API_URL}/appointments/cancel-client" \
-H "Content-Type: application/json" \
-d '{
"phone": "+1234567890",
"appointmentId": "APPOINTMENT_ID"
}'
6. Reschedule an Appointment
Move an appointment to a new date/time.
curl -s -X POST "${APPOINTMENT_API_URL}/appointments/reschedule-client" \
-H "Content-Type: application/json" \
-d '{
"phone": "+1234567890",
"appointmentId": "APPOINTMENT_ID",
"date": "YYYY-MM-DD",
"startTime": "HH:mm"
}'
Workflow Guidelines
- •
Always identify the user first - Use their phone number from the chat context.
- •
When booking:
- •First, list services if user hasn't specified one
- •Check available slots for their preferred date
- •Confirm the booking details before submitting
- •Provide confirmation with date, time, and service name
- •
When viewing appointments:
- •Format dates and times in a user-friendly way
- •Group by date if multiple appointments
- •Show service name and status
- •
When cancelling/rescheduling:
- •First fetch their appointments to get the appointment ID
- •Confirm the action before executing
- •For rescheduling, check slot availability first
- •
Error handling:
- •"Selected time slot is not available" → Suggest alternative times
- •"Appointment not found" → List their current appointments
- •"This appointment does not belong to you" → Verify phone number
Response Formatting
Format responses in a friendly, conversational tone:
Booking confirmed:
Your appointment has been booked! 📅 Service: General Consultation 📆 Date: Monday, January 28, 2026 🕐 Time: 10:00 AM We look forward to seeing you!
Listing appointments:
Your upcoming appointments: 1. General Consultation 📆 Jan 28, 2026 at 10:00 AM Status: Confirmed 2. Dental Cleaning 📆 Feb 5, 2026 at 2:00 PM Status: Pending
Available slots:
Available times for Monday, January 28: 9:00 AM, 9:30 AM, 10:30 AM, 11:00 AM, 2:00 PM, 2:30 PM, 3:00 PM Would you like to book one of these?
Business Hours
- •Monday to Friday: 9:00 AM - 6:00 PM
- •Lunch break: 1:00 PM - 2:00 PM (no appointments)
- •Weekends: Closed
Appointment Statuses
- •PENDING - Awaiting confirmation
- •CONFIRMED - Appointment confirmed
- •CANCELLED - Appointment cancelled
- •COMPLETED - Appointment completed
- •NO_SHOW - Client did not attend