Skip to content

Commit 3067520

Browse files
authored
Merge branch 'main' into update-openapi-spec-2025-08-27T00-26-20-343Z
2 parents 70d9b74 + f36d019 commit 3067520

25 files changed

+1258
-151
lines changed

fern/apis/api/openapi.json

Lines changed: 66 additions & 60 deletions
Large diffs are not rendered by default.

fern/assets/styles.css

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,13 @@
3131
border: 1px solid #C7D2FE;
3232
}
3333

34+
/* Optional: Squad badge (reuse assistant palette for now) */
35+
.vapi-badge-squad {
36+
background-color: #EEF2FF;
37+
color: #4338CA;
38+
border: 1px solid #C7D2FE;
39+
}
40+
3441
/* Dark mode adjustments */
3542
:is(.dark) .vapi-badge-assistant {
3643
background-color: #134E4A;
@@ -44,6 +51,12 @@
4451
border: 1px solid #6366F1;
4552
}
4653

54+
:is(.dark) .vapi-badge-squad {
55+
background-color: #312E81;
56+
color: #C7D2FE;
57+
border: 1px solid #6366F1;
58+
}
59+
4760
/* for a grid of videos */
4861

4962
.video-grid {
@@ -220,4 +233,4 @@ html.dark button[data-highlighted] .fern-api-property-meta {
220233

221234
.light .fern-theme-default.fern-container {
222235
background-color: #fff !important;
223-
}
236+
}
Lines changed: 277 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,277 @@
1+
---
2+
title: Appointment scheduling assistant
3+
subtitle: Build an AI receptionist that books, reschedules, and cancels appointments using Assistants and tools
4+
slug: assistants/examples/appointment-scheduling
5+
description: Build a voice AI appointment scheduling assistant with Google Calendar integration, availability checking, and automated confirmations using Vapi Assistants.
6+
---
7+
8+
## Overview
9+
10+
Build an AI-powered appointment scheduling assistant that handles inbound calls for booking, rescheduling, and canceling appointments. This approach uses a single Assistant with tools for calendar availability, customer lookups, and confirmations.
11+
12+
**Assistant Capabilities:**
13+
* Real-time availability checks and booking
14+
* Reschedule and cancel with confirmation
15+
* Customer verification and data lookups
16+
* SMS/email confirmations via tools
17+
18+
**What You'll Build:**
19+
* An assistant with a focused prompt for scheduling flows
20+
* Tools for calendar availability and booking
21+
* Optional CSV knowledge bases for customers/services
22+
* A phone number attached to your assistant
23+
24+
## Prerequisites
25+
26+
* A [Vapi account](https://dashboard.vapi.ai/)
27+
* Google Calendar or a scheduling backend
28+
29+
## 1. Prepare data (optional)
30+
31+
Use sample CSVs for customers, services, and appointments during development.
32+
33+
<Steps>
34+
<Step title="Download sample spreadsheets">
35+
<div className="flex gap-2">
36+
<Download src="../../static/spreadsheets/appointment-scheduling/services.csv">
37+
<Button intent="primary">Download services.csv</Button>
38+
</Download>
39+
<Download src="../../static/spreadsheets/appointment-scheduling/customers.csv">
40+
<Button intent="primary">Download customers.csv</Button>
41+
</Download>
42+
<Download src="../../static/spreadsheets/appointment-scheduling/appointments.csv">
43+
<Button intent="primary">Download appointments.csv</Button>
44+
</Download>
45+
</div>
46+
</Step>
47+
<Step title="Upload files (optional)">
48+
<Tabs>
49+
<Tab title="Dashboard">
50+
1. Open your [Vapi Dashboard](https://dashboard.vapi.ai) → Files
51+
2. Upload the three CSVs and note their file IDs
52+
53+
<video autoPlay loop muted src="../../static/videos/upload-files.mp4" type="video/mp4" style={{ aspectRatio: '16 / 9', width: '100%' }} />
54+
</Tab>
55+
<Tab title="TypeScript (Server SDK)">
56+
```typescript
57+
import { VapiClient } from "@vapi-ai/server-sdk";
58+
import fs from "fs";
59+
60+
const vapi = new VapiClient({ token: process.env.VAPI_API_KEY! });
61+
62+
async function upload(file: string) {
63+
const res = await vapi.files.create({ file: fs.createReadStream(file) });
64+
console.log(file, res.id);
65+
return res.id;
66+
}
67+
68+
const servicesFileId = await upload("services.csv");
69+
const customersFileId = await upload("customers.csv");
70+
const appointmentsFileId = await upload("appointments.csv");
71+
```
72+
</Tab>
73+
<Tab title="Python (Server SDK)">
74+
```python
75+
import requests, os
76+
77+
def upload(path: str):
78+
r = requests.post(
79+
"https://api.vapi.ai/file",
80+
headers={"Authorization": f"Bearer {os.getenv('VAPI_API_KEY')}"},
81+
files={"file": open(path, "rb")},
82+
)
83+
r.raise_for_status()
84+
print(path, r.json()["id"])
85+
return r.json()["id"]
86+
87+
services_file_id = upload("services.csv")
88+
customers_file_id = upload("customers.csv")
89+
appointments_file_id = upload("appointments.csv")
90+
```
91+
</Tab>
92+
</Tabs>
93+
</Step>
94+
</Steps>
95+
96+
---
97+
98+
## 2. Create calendar tools
99+
100+
Use the Google Calendar integration for availability and booking, or your own API via a custom tool.
101+
102+
<Tabs>
103+
<Tab title="Use Google Calendar (recommended)">
104+
See: [Google Calendar Integration](/tools/google-calendar)
105+
106+
Configure tools for:
107+
- `check_availability(service, date)`
108+
- `book_appointment(customer, service, time)`
109+
- `reschedule_appointment(appointmentId, time)`
110+
- `cancel_appointment(appointmentId)`
111+
</Tab>
112+
<Tab title="Custom tools (HTTP)">
113+
See: [Custom Tools](/tools/custom-tools)
114+
115+
Define function tools that call your scheduling backend. Attach CSV knowledge bases (customers/services) if using the sample data above.
116+
</Tab>
117+
</Tabs>
118+
119+
---
120+
121+
## 3. Create the assistant
122+
123+
<Tabs>
124+
<Tab title="Dashboard">
125+
<Steps>
126+
<Step title="Create assistant">
127+
- Go to Assistants → Create Assistant → Blank template
128+
- Name it `Receptionist`
129+
</Step>
130+
<Step title="Configure system prompt">
131+
```txt title="System Prompt" maxLines=12
132+
You are an AI receptionist for a barbershop. Your goals:
133+
1) Verify the customer
134+
2) Offer booking, rescheduling, or cancellation
135+
3) Confirm details and send a confirmation
136+
137+
When needed, call tools: check_availability, book_appointment, reschedule_appointment, cancel_appointment.
138+
Keep replies under 30 words. Confirm date/time clearly.
139+
```
140+
</Step>
141+
<Step title="Attach tools">
142+
Add your scheduling tools to the assistant and publish.
143+
</Step>
144+
</Steps>
145+
</Tab>
146+
<Tab title="TypeScript (Server SDK)">
147+
```typescript
148+
import { VapiClient } from "@vapi-ai/server-sdk";
149+
150+
const vapi = new VapiClient({ token: process.env.VAPI_API_KEY! });
151+
152+
const systemPrompt = `You are an AI receptionist for a barbershop. Verify the customer, then offer booking, rescheduling, or cancellation. Use scheduling tools when needed. Keep replies under 30 words.`;
153+
154+
const assistant = await vapi.assistants.create({
155+
name: "Receptionist",
156+
firstMessage: "Welcome to Tony's Barbershop! How can I help you today?",
157+
model: {
158+
provider: "openai",
159+
model: "gpt-4o",
160+
messages: [{ role: "system", content: systemPrompt }],
161+
// toolIds: [ "CHECK_AVAILABILITY_ID", "BOOK_ID", "RESCHEDULE_ID", "CANCEL_ID" ]
162+
}
163+
});
164+
```
165+
</Tab>
166+
<Tab title="Python (Server SDK)">
167+
```python
168+
from vapi import Vapi
169+
import os
170+
171+
client = Vapi(token=os.getenv("VAPI_API_KEY"))
172+
173+
assistant = client.assistants.create(
174+
name="Receptionist",
175+
first_message="Welcome to Tony's Barbershop! How can I help you today?",
176+
model={
177+
"provider": "openai",
178+
"model": "gpt-4o",
179+
"messages": [{"role": "system", "content": "You are an AI receptionist for a barbershop. Verify the customer, then handle booking/rescheduling/cancel."}]
180+
}
181+
)
182+
```
183+
</Tab>
184+
</Tabs>
185+
186+
---
187+
188+
## 4. Make calls
189+
190+
<Tabs>
191+
<Tab title="TypeScript (Server SDK)">
192+
```typescript title="create web call"
193+
import { VapiClient } from "@vapi-ai/server-sdk";
194+
195+
const vapi = new VapiClient({ token: process.env.VAPI_API_KEY! });
196+
197+
await vapi.calls.create({
198+
transport: { type: "web" },
199+
assistant: { assistantId: "your-assistant-id" }
200+
});
201+
```
202+
203+
```typescript title="create phone call"
204+
await vapi.calls.create({
205+
phoneNumberId: "your-phone-number-id",
206+
customer: { number: "+15551234567" },
207+
assistant: { assistantId: "your-assistant-id" }
208+
});
209+
```
210+
</Tab>
211+
212+
<Tab title="Python (Server SDK)">
213+
```python title="create web call"
214+
import os
215+
from vapi import Vapi
216+
217+
client = Vapi(token=os.getenv("VAPI_API_KEY"))
218+
219+
client.calls.create(
220+
transport={"type": "web"},
221+
assistant_id="your-assistant-id",
222+
)
223+
```
224+
225+
```python title="create phone call"
226+
client.calls.create(
227+
phone_number_id="your-phone-number-id",
228+
customer={"number": "+15551234567"},
229+
assistant_id="your-assistant-id",
230+
)
231+
```
232+
</Tab>
233+
234+
<Tab title="cURL (web)">
235+
```bash
236+
curl -X POST "https://api.vapi.ai/call/web" \
237+
-H "Authorization: Bearer $VAPI_API_KEY" \
238+
-H "Content-Type: application/json" \
239+
-d '{
240+
"assistant": { "assistantId": "your-assistant-id" }
241+
}'
242+
```
243+
</Tab>
244+
245+
<Tab title="cURL (phone)">
246+
```bash
247+
curl -X POST "https://api.vapi.ai/call" \
248+
-H "Authorization: Bearer $VAPI_API_KEY" \
249+
-H "Content-Type: application/json" \
250+
-d '{
251+
"assistant": { "assistantId": "your-assistant-id" },
252+
"phoneNumberId": "your-phone-number-id",
253+
"customer": { "number": "+15551234567" }
254+
}'
255+
```
256+
</Tab>
257+
</Tabs>
258+
259+
## 5. Test and validate
260+
261+
<Steps>
262+
<Step title="Attach a phone number">
263+
Create a phone number and assign your assistant. See [Phone calls quickstart](/quickstart/phone).
264+
</Step>
265+
<Step title="Test scenarios">
266+
- New booking → check availability → book → confirm
267+
- Reschedule existing appointment → confirm
268+
- Cancel appointment → confirm
269+
</Step>
270+
</Steps>
271+
272+
## Next steps
273+
274+
- **Tools**: [Google Calendar](/tools/google-calendar), [Custom Tools](/tools/custom-tools)
275+
- **Structured outputs**: [Extract structured data](/assistants/structured-outputs)
276+
- **Multichannel**: [Web integration](/quickstart/web)
277+

fern/assistants/examples/inbound-support.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1146,7 +1146,7 @@ Consider the reading the following guides to further enhance your assistant:
11461146

11471147
* [**Knowledge Bases**](../knowledge-base/) - Learn more about knowledge bases to build knowledge-based agents.
11481148
* [**External Integrations**](../tools/) - Configure integrations with [Google Calendar](../tools/google-calendar), [Google Sheets](../tools/google-sheets), [Slack](../tools/slack), etc.
1149-
* [**Workflows**](../workflows/) - Learn about workflows to build voice agents for more complex use cases.
1149+
* [**Squads**](../squads) - Learn how to compose multiple assistants and transfer seamlessly for complex use cases.
11501150

11511151
<Callout>
11521152
Need help? Chat with the team on our [Discord](https://discord.com/invite/pUFNcf2WmH) or mention us on [X/Twitter](https://x.com/Vapi_AI).

0 commit comments

Comments
 (0)