Google Calendar Integration

Connect your assistant to Google Calendar for seamless appointment scheduling.

The Google Calendar integration allows your Vapi assistant to create calendar events through voice commands. This enables your assistant to schedule appointments, meetings, and other calendar events directly during phone calls.

Prerequisites

Before you can use the Google Calendar integration, you need to:

  1. Have a Google Calendar account
  2. Have access to the Vapi Dashboard
  3. Have an assistant created in Vapi

Setup Steps

1. Connect Google Calendar Account

First, you need to connect your Google Calendar account to Vapi:

  1. Navigate to the Vapi Dashboard
  2. Go to Providers Keys > Tools Provider > Google Calendar
  3. Click the Connect button
  4. A Google authorization popup will appear
  5. Follow the prompts to authorize Vapi to access your Google Calendar

The authorization process will request access to your Google Calendar to create and manage events.

Select files from your Assistant
Connect Google Calendar

2. Create Calendar Tool

After connecting your Google Calendar account, create a new tool:

  1. Go to Dashboard > Tools page
  2. Click the Create Tool button
  3. Select Google Calendar from the available options
  4. Provide a name for your tool
  5. Add a description explaining when this tool should be invoked (e.g., “Use this tool when the user wants to schedule an appointment or create a calendar event”)

The description field is crucial as it helps the AI model understand when and how to use the tool. Be specific about the scenarios and conditions when the tool should be invoked.

Create Calendar ToolTool Configuration
Create Calendar Tool

3. Add Tool to Assistant

Now, add the calendar tool to your assistant:

  1. Navigate to Dashboard > Assistants page
  2. Select your assistant
  3. Go to the Functions tab
  4. In the tools dropdown, select your newly created calendar tool
  5. Click Publish to save your changes
Add Tool to Assistant
Add Tool to Assistant

Tool Configuration

The Google Calendar tool uses the following fields to create events:

  • summary: The title or description of the calendar event
  • startDateTime: The start date and time of the event
  • endDateTime: The end date and time of the event
  • timeZone: The timezone for the event

All datetime fields should be provided in ISO 8601 format.

Example Usage

Here’s how the tool can be used in your assistant’s configuration:

1{
2 "model": {
3 "provider": "openai",
4 "model": "gpt-4o",
5 "messages": [
6 {
7 "role": "system",
8 "content": "You are a scheduling assistant. When users want to schedule an appointment, use the Google Calendar tool to create the event."
9 }
10 ],
11 "tools": [
12 {
13 "type": "google.calendar.event.create",
14 "name": "scheduleAppointment",
15 "description": "Use this tool to schedule appointments and create calendar events"
16 }
17 ]
18 }
19}

Best Practices

  1. Clear Instructions: Provide clear instructions in your assistant’s system message about when to use the calendar tool
  2. Error Handling: Include fallback responses for cases where the calendar tool fails
  3. Time Zone Awareness: Always specify the correct timezone for events
  4. Event Details: Ensure all required fields are properly filled when creating events