Architecture
Two complementary designs. You can use both.
Most clinic and demo-booking apps start with A.
Shared setup
- Create an outbound agent (and optionally an inbound agent on your number) with booking instructions. See Create your first bot.
- On that agent, Integrations → Google Calendar → Authorize so
get_availabilityandcreate_eventwork on the live call. - Put calendar keywords in the system script (
google calendar,get_availability,create_event) as described in the Google Calendar guide. - Copy API key, workspace slug, agent ID, and from UUID. Set the webhook to your booking service.
Design A — the agent books during the call
System instructions (copy into the agent)
{{clinic_name}}, {{visit_type}}, and {{patient_email}} in the greeting and script.
Your booking table
summary or transcript if you need slot_start in SQL. Instruct the agent to always say the booking in a fixed shape, e.g. Confirmed: 12 October 2026 15:00 IST.
Webhook fields: Webhooks.
Design B — your system holds the slot, the agent confirms
Use this when slots live in your scheduler (not only Google Calendar).1
Customer picks a time on your site
Insert
appointments with status = pending. Do not mark booked yet.2
Trigger the confirmation call
POST /api/outbound-call with metadata:3
Agent script
“You are confirming an existing hold. Tell them the time in
{{slot_start}}. If they say yes, thank them. If they want another time, note the new preference; do not invent a calendar event unless Google Calendar tools are enabled.”4
Webhook
Map
intent to booked vs cancelled vs reschedule_requested and update your scheduler (release the hold, create the real appointment, or open a new slot picker).Inbound: they call you to book
Put the same booking agent on an inbound number (Phone numbers). Nooutbound-call is required. The webhook still fires when the call ends, so your appointments table stays in sync.
End-to-end checks
1
Playground
Test the script in the browser first (Test your bot).
2
Calendar
Call yourself, ask for a real slot, confirm a Google Calendar event and invite appear.
3
Your app
After hangup,
analysis.completed should set appointments.status = booked (design A) or confirm the hold (design B).Related
- Make a call
- Google Calendar on the agent
- Voice CRM example — use the same webhooks to drop booked callers into a Booked column
