EN
Calendar API guide

Guide to Google Calendar API Integration: OAuth, Events and Sync

Set up a Google Cloud project, request the right OAuth scopes, read and write events, and keep your app in sync with push notifications and sync tokens. Then see how to connect your users' Google Calendar accounts through one hosted authentication link.

Google Calendar Google Calendarjane@acme.com
Synced
Mon19 Tue20 Wed21
Product sync9:00 to 10:30 Interview Standup Onboarding callCreated by your app Demo Quarterly review12:00 to 1:30 9 AM 10 AM 11 AM 12 PM 1 PM
POST /calendar/v3/calendars/primary/events 200 OK
Short answer

The Google Calendar API is Google's REST API for reading and writing calendars and events in a user's Google account. To integrate it, you enable the API in a Google Cloud project, send each user through OAuth 2.0 with a calendar scope, then call endpoints such as calendarList and events, and keep data fresh with push notifications and sync tokens.

This guide walks through each step with the native API, then shows how a Google Calendar API integration with Unipile replaces the OAuth app, token storage and sync loop with one hosted authentication link.

Part of the Calendar API series

Comparing Google Calendar with Outlook Calendar, or building availability and scheduling features across both? Start with the complete developer's guide to calendar API integration.

Definition

What is Google Calendar API?

The Google Calendar API is a RESTful API that gives your application access to the calendars, events and settings of a Google account, with the user's permission. It exposes most of what people do in the Google Calendar web interface: list calendars, create and edit events, invite attendees, check availability.

You call it with plain HTTPS requests to https://www.googleapis.com/calendar/v3, or through the Google client libraries, which wrap the same requests in methods for your language. Every request acts on behalf of one signed-in user and carries an OAuth 2.0 access token, so your app only sees the calendars that user can see.

The API works with personal Google accounts and Google Workspace accounts alike. Google documents every resource in the Calendar API overview.

Google Calendar Calendar API v3 resources
CalendarListThe calendars shown in the user's list: primary, secondary and subscribed.
CalendarsMetadata of one calendar: title, description, time zone.
EventsMeetings and appointments, with attendees, reminders and recurrence.
FreebusyBusy time ranges for a set of calendars, for availability checks.
AclAccess control rules: who can read or edit a calendar.
ChannelsPush notification channels that watch a resource for changes.
Benefits

Benefits of Integrating Google Calendar API in Your Application

A calendar integration lets users manage meetings without leaving your product: your app creates the event, Google sends the invitations, and the schedule stays the same in both places. For software publishers, it removes the copy and paste between tools that makes scheduling slow and error prone.

Scheduling automation

Create, reschedule and cancel events from your own workflow, with attendees, a video link and reminders. Google notifies the guests, so your app does not have to send invitations itself.

Availability checks

Query busy time ranges before you propose a slot. A booking page, an interview planner or an AI assistant can suggest only the times that are really free.

Unified calendar management

Bring the calendars of many users into one view inside your app: a team schedule, meetings logged on a CRM record, or interviews attached to a candidate.

Typical products: ATS interview scheduling, CRM meeting sync, booking tools and AI agents that plan meetings for their users.

Getting started

How to Set Up a Google Cloud Project for the Google Calendar API

Before your first request, you need a Google Cloud project with the API enabled, an OAuth consent screen and an OAuth client ID. The project is where Google tracks your credentials, your quotas and the verification status of your app.

1

Create a Google Cloud project

In the Google Cloud Console, create a project dedicated to your application. Keep production and testing in separate projects if you can.

2

Enable the Google Calendar API

Open APIs and Services, then Library, search for the Calendar API and click Enable. Requests to an API that is not enabled fail with a 403 error.

3

Configure the OAuth consent screen

Set the app name, support email, audience and the calendar scopes you will request. While the app is in testing, only the test users you add can sign in. Our guide to the OAuth consent screen covers each field.

4

Create an OAuth client ID

Under Credentials, create an OAuth client ID of type web application and add your authorized redirect URI. An API key alone only reads public calendars: private calendars always need OAuth.

5

Install a client library or call REST

Google publishes client libraries for Node.js, Python, Java, Go, PHP, .NET and more. You can also call the REST endpoints directly with any HTTP client, as in the examples below.

my-calendar-app
APIs and Services / Library / Google Calendar API
Google Calendar
Google Calendar API Google Enterprise API Integrates with Google Calendar to read and change calendars and events.
Enable
Plan for Google verification

A public app that requests calendar scopes must go through Google's verification before the unverified app screen goes away. Until then, the app is limited to 100 users, see how the 100 user limit works, and in testing mode refresh tokens expire after 7 days. Details in our Google OAuth verification guide.

Security and compliance

Which OAuth Scopes Does the Google Calendar API Need?

Request the narrowest scope that covers your feature: calendar.events to read and write events, calendar.readonly to only read, and the full calendar scope only if you manage calendars themselves. Users accept limited, clearly described access more easily, and a smaller scope set is simpler to justify during Google's review.

Google Calendar uses OAuth 2.0 for authentication and authorization. Your app redirects the user to Google, the user approves the scopes on the consent screen, and Google returns an authorization code that your backend exchanges for an access token and a refresh token. Only that user's calendars become reachable, and the user can revoke access at any time from their Google account.

Access inside Google Calendar is then governed by access control rules (the Acl resource): a user or a group gets a role such as reader, writer or owner on a calendar, and the API returns only what that role allows. All traffic goes over HTTPS.

On your side, store refresh tokens encrypted, never in the browser, and plan for the day a token stops working: our article on the Google OAuth refresh token explains when that happens.

POST oauth2.googleapis.com/token access_token + refresh_token

Calendar scopes compared

All scopes start with https://www.googleapis.com/auth/. The full list is in Google's Calendar API scopes reference.

ScopeWhat it allowsUse it for
calendarFull access to every calendar the user can reach, including sharing settings and permanent deletionApps that create calendars or manage sharing
calendar.eventsView and edit events on all the user's calendarsScheduling, booking and meeting sync
calendar.readonlyRead calendars and events, no changesDashboards, reporting, activity logging
calendar.freebusySee availability only, not event detailsSlot pickers and availability checks
calendar
What it allowsFull access to every calendar the user can reach, including sharing settings and permanent deletion
Use it forApps that create calendars or manage sharing
calendar.events
What it allowsView and edit events on all the user's calendars
Use it forScheduling, booking and meeting sync
calendar.readonly
What it allowsRead calendars and events, no changes
Use it forDashboards, reporting, activity logging
calendar.freebusy
What it allowsSee availability only, not event details
Use it forSlot pickers and availability checks
Endpoints

Key Features of Google Calendar API

The core features of the API are listing the user's calendars, reading events in a time range, creating, updating and deleting events, checking availability and watching for changes. Each one maps to a small set of REST endpoints under the same base URL.

Base URL https://www.googleapis.com/calendar/v3
GET/users/me/calendarListList the calendars in the user's calendar list
GET/calendars/{calendarId}/eventsList events, filtered by time range or changes
POST/calendars/{calendarId}/eventsCreate an event with attendees and reminders
PATCH/calendars/{calendarId}/events/{eventId}Change some fields of an event
DELETE/calendars/{calendarId}/events/{eventId}Delete an event, optionally notifying guests
POST/freeBusyGet busy time ranges for a set of calendars
POST/calendars/{calendarId}/events/watchOpen a push notification channel on events

Listing and creating events

Use primary as the calendar ID for the user's main calendar. To read a time window, pass timeMin and timeMax in RFC 3339 format; add singleEvents=true to expand recurring events into individual occurrences, which also lets you sort with orderBy=startTime.

google-calendar-events.sh
# List this week's events, recurring events expanded
curl --request GET \
  --url "https://www.googleapis.com/calendar/v3/calendars/primary/events?timeMin=2026-10-19T00:00:00Z&timeMax=2026-10-26T00:00:00Z&singleEvents=true&orderBy=startTime" \
  --header "Authorization: Bearer {ACCESS_TOKEN}"

# Create an event and email the invitation to the attendee
curl --request POST \
  --url "https://www.googleapis.com/calendar/v3/calendars/primary/events?sendUpdates=all" \
  --header "Authorization: Bearer {ACCESS_TOKEN}" \
  --header "Content-Type: application/json" \
  --data '{
    "summary": "Onboarding call",
    "start": { "dateTime": "2026-10-20T11:00:00+02:00", "timeZone": "Europe/Paris" },
    "end":   { "dateTime": "2026-10-20T12:00:00+02:00", "timeZone": "Europe/Paris" },
    "attendees": [{ "email": "client@example.com" }]
  }'
200 OK · kind: calendar#event · id, htmlLink, status: confirmed

The response is the created event, with its id. Store it with your own record: you need it to update or delete the event later.

Update and delete events

Use PATCH to change only the fields you send, such as a new time, a location or an extra attendee, and PUT to replace the whole event. Both accept sendUpdates (all, externalOnly or none) to decide who gets notified. DELETE removes a canceled event and takes the same parameter, so guests learn about the cancellation.

Only the organizer's copy of an event can change shared properties such as guest permissions: an update from an attendee's calendar on those fields returns a 403 error, covered in the errors section below.

Integration architecture

Integrating Google Calendar API with Your Application: Sync and Push Notifications

A production Google Calendar integration keeps a local copy of each user's events and updates it in two ways: a full sync once, then incremental syncs driven by push notifications. This avoids polling every calendar every few minutes, which wastes quota and still shows stale data between two polls.

1Full sync

List all events once and save them. The last page of results returns a nextSyncToken: store it per calendar.

GET /calendars/primary/events
2Watch

Open a notification channel on the calendar with your HTTPS callback address and a unique channel ID.

POST /calendars/primary/events/watch
3Notification

Google calls your endpoint when something changes. The request has no body: the headers only say that the calendar changed.

X-Goog-Resource-State: exists
4Incremental sync

List events again with the stored token. You get only what changed, deleted events included, plus a new token.

GET /calendars/primary/events?syncToken=...

If Google answers 410 Gone with the reason fullSyncRequired, the sync token is no longer valid: clear the local copy of that calendar and go back to step 1.

Webhooks and push notifications

Google Calendar push notifications are the API's webhooks. You create a channel with events.watch, and Google sends a POST to your address each time the watched calendar changes. The address must be HTTPS with a valid certificate, and your endpoint answers with a 2xx status code. Use the optional token field to check that a notification really comes from your channel.

watch-events.sh
curl --request POST \
  --url "https://www.googleapis.com/calendar/v3/calendars/primary/events/watch" \
  --header "Authorization: Bearer {ACCESS_TOKEN}" \
  --header "Content-Type: application/json" \
  --data '{
    "id": "channel-user-42-primary",
    "type": "web_hook",
    "address": "https://yourapp.com/webhooks/google-calendar",
    "token": "user=42"
  }'

# Notification sent to your address (headers only, no body)
# X-Goog-Channel-ID: channel-user-42-primary
# X-Goog-Resource-State: exists
# X-Goog-Channel-Token: user=42

Channels expire and are not renewed automatically: create a new channel with a new id before the old one ends, and stop old ones with POST /channels/stop. Google does not guarantee delivery of every message, so keep a periodic incremental sync as a safety net.

Creating custom calendar views

Once events live in your database, you can show them the way your users need, instead of embedding the Google Calendar interface. Filter by event type, attendee or calendar, combine the calendars of a whole team, or attach meetings to the record they belong to: a deal, a candidate, a support ticket. Users stay in your app, and every change they make there is written back to Google Calendar through the same events endpoints.

Build it with Unipile

Google Calendar and Outlook Calendar, one Calendar API

Skip the Cloud project, the token storage and the watch channels. Link a user's calendar through hosted authentication and receive event changes on one webhook. See the Calendar API for both providers.

Build Now
Errors and limits

Handling Common Errors and Best Practices

Most Google Calendar API errors in production come from three causes: too many requests in a short window (403 or 429), an expired token (401), and a sync token that is no longer valid (410). Each one has a known fix, and only some of them should be retried.

Managing rate limits and quotas

Google measures Calendar API quotas per minute, on a sliding window, at two levels: your whole Cloud project, and each user inside your project. A burst above the limit in one minute can still slow you down in the next one.

Per project 10,000 requests per minute All the requests your Google Cloud project sends, across every user.
Per user, per project 600 requests per minute The requests made on behalf of one user, so one heavy account cannot use the whole quota.
  • Retry with truncated exponential backoff: wait 1, 2, 4, 8 seconds and so on, plus a random delay of up to one second, and stop at a maximum of 32 or 64 seconds.
  • Spread recurring jobs: do not start every user's sync at the same minute; randomize the start time and vary the interval.
  • Prefer push notifications to polling: one notification plus one incremental sync costs far fewer requests than a poll every few minutes.

Values from Google's Calendar API usage limits. Not all projects have the same quotas; check the Quotas page of your Cloud project. Last verified: October 2026.

Error codes and troubleshooting

The response body gives a reason next to the HTTP status. Read it before you decide to retry: a 403 can mean a rate limit (retry later) or a permission problem (retrying never helps).

Status and reasonWhat it meansWhat to do
401 authErrorThe access token is expired or invalidRefresh the token; if that fails, send the user through OAuth again
403 or 429 rateLimitExceeded, 403 userRateLimitExceededToo many requests for the calendar, the user or the project in a short windowRetry with exponential backoff and reduce request volume
403 quotaExceededA Google Calendar usage limit, for example on invitations, was reachedDo not retry in a loop; review the Calendar usage limits for the account
403 forbiddenForNonOrganizerAn attendee's copy tried to change shared properties of an eventPatch only non shared fields, or update the organizer's copy
404 notFoundThe event or calendar does not exist, or the user cannot access itCheck the IDs and the user's access; retry with backoff if it was just created
410 fullSyncRequiredThe sync token is no longer validClear the local copy and run a full sync
401 authError
What it meansThe access token is expired or invalid
What to doRefresh the token; if that fails, send the user through OAuth again
403 or 429 rateLimitExceeded, 403 userRateLimitExceeded
What it meansToo many requests for the calendar, the user or the project in a short window
What to doRetry with exponential backoff and reduce request volume
403 quotaExceeded
What it meansA Google Calendar usage limit, for example on invitations, was reached
What to doDo not retry in a loop; review the Calendar usage limits for the account
403 forbiddenForNonOrganizer
What it meansAn attendee's copy tried to change shared properties of an event
What to doPatch only non shared fields, or update the organizer's copy
404 notFound
What it meansThe event or calendar does not exist, or the user cannot access it
What to doCheck the IDs and the user's access; retry with backoff if it was just created
410 fullSyncRequired
What it meansThe sync token is no longer valid
What to doClear the local copy and run a full sync

Source: Google's Calendar API error reference. For errors raised during the OAuth flow itself, such as invalid_grant, see our guide to Google OAuth errors. Last verified: October 2026.

With Unipile

Unipile Google Calendar Integration Made Effortless

With Unipile, your users link their Google Calendar through a hosted authentication page, and your app reads and writes their events with a few REST calls, on behalf of each authenticated user. Unipile handles the Google OAuth app, token refresh and change detection, and sends calendar changes to your webhook.

1Redirect

Send the user to Hosted Auth

Your backend requests a one time link, and your app redirects the user to the Unipile hosted authentication page.

2Consent

The user signs in with Google

The user picks Google, goes through the Google OAuth consent screen and grants calendar access.

3Callback

Your app gets an account ID

Unipile redirects the user back to your app and calls your notify_url with the new account_id.

4Use

Call the Calendar endpoints

Pass that account_id to list calendars, read and create events, or edit them for the user.

Google verification

Start without verifying your own Google app

By default, users connect through Unipile's Google OAuth app, which is CASA Tier 2 certified. You do not need your own Cloud project, consent screen review or security assessment to start.

TestBuild a proof of concept with real Google accounts on the Unipile app.
Go liveStay on the Unipile app in production, with no verification on your side.
Switch laterMove to your own OAuth credentials when you want a white label consent screen, and have that app verified then.

Google Calendar API examples with Unipile

Every call uses your Unipile API key in the X-API-KEY header and your account's DSN as the base URL. Events are read with start and end filters in RFC 3339 format and paginated with a cursor.

unipile-google-calendar.sh
# 1. Create a hosted auth link for one of your users
curl --request POST \
  --url "https://{YOUR_DSN}/api/v1/hosted/accounts/link" \
  --header "X-API-KEY: {YOUR_ACCESS_TOKEN}" \
  --header "content-type: application/json" \
  --data '{
    "type": "create",
    "providers": ["GOOGLE"],
    "api_url": "https://{YOUR_DSN}",
    "expiresOn": "2026-10-20T12:00:00.000Z",
    "notify_url": "https://yourapp.com/unipile/accounts",
    "name": "user_42"
  }'

# 2. List the user's calendars
curl --request GET \
  --url "https://{YOUR_DSN}/api/v1/calendars?account_id={ACCOUNT_ID}" \
  --header "X-API-KEY: {YOUR_ACCESS_TOKEN}"

# 3. Read this week's events from one calendar
curl --request GET \
  --url "https://{YOUR_DSN}/api/v1/calendars/{CALENDAR_ID}/events?account_id={ACCOUNT_ID}&start=2026-10-19T00:00:00Z&end=2026-10-26T00:00:00Z" \
  --header "X-API-KEY: {YOUR_ACCESS_TOKEN}"

# 4. Create an event with a Google Meet link
curl --request POST \
  --url "https://{YOUR_DSN}/api/v1/calendars/{CALENDAR_ID}/events?account_id={ACCOUNT_ID}" \
  --header "X-API-KEY: {YOUR_ACCESS_TOKEN}" \
  --header "content-type: application/json" \
  --data '{
    "title": "Onboarding call",
    "start": { "date_time": "2026-10-20T09:00:00.000Z", "time_zone": "Europe/Paris" },
    "end": { "date_time": "2026-10-20T10:00:00.000Z", "time_zone": "Europe/Paris" },
    "attendees": [{ "email": "client@example.com" }],
    "conference": { "provider": "google_meet" },
    "notify": true
  }'

# 5. Receive calendar changes on your webhook
curl --request POST \
  --url "https://{YOUR_DSN}/api/v1/webhooks" \
  --header "X-API-KEY: {YOUR_ACCESS_TOKEN}" \
  --header "content-type: application/json" \
  --data '{
    "source": "calendar_event",
    "request_url": "https://yourapp.com/unipile/calendar",
    "events": ["calendar_event_created", "calendar_event_updated", "calendar_event_deleted"]
  }'
201 Created · object: CalendarEventCreated · event_id

The same calls work for an Outlook Calendar account: only the account_id changes. Each event comes back with title, start, end, attendees and organizer in one format for both providers.

Calendar endpoints reference

Build or connect

Unipile vs Self-Integration: Save Time and Gain Support

Integrating Google Calendar yourself gives you full control, at the cost of a Google Cloud project, an OAuth app to get verified, token storage and a sync engine to maintain. Unipile takes over that infrastructure and gives you one calendar contract for Google and Outlook.

TopicSelf-integrationUnipile
OAuth appYour Cloud project, consent screen and OAuth clientUnipile's Google OAuth app by default, your own credentials optional
Google verificationRequired before a public launch, 100 user cap until thenNot needed to start: the Unipile app is CASA Tier 2 certified
User connectionYour own OAuth flow, callback and consent handlingOne hosted authentication link
TokensStore, encrypt and refresh tokens per userHandled by Unipile, your app keeps an account_id
Change detectionWatch channels to renew, sync tokens, 410 recoveryOne calendar_event webhook for created, updated and deleted events
Outlook CalendarA second integration on Microsoft GraphSame endpoints and event format
OAuth app
Self-integrationYour Cloud project, consent screen and OAuth client
UnipileUnipile's Google OAuth app by default, your own credentials optional
Google verification
Self-integrationRequired before a public launch, 100 user cap until then
UnipileNot needed to start: the Unipile app is CASA Tier 2 certified
User connection
Self-integrationYour own OAuth flow, callback and consent handling
UnipileOne hosted authentication link
Tokens
Self-integrationStore, encrypt and refresh tokens per user
UnipileHandled by Unipile, your app keeps an account_id
Change detection
Self-integrationWatch channels to renew, sync tokens, 410 recovery
UnipileOne calendar_event webhook for created, updated and deleted events
Outlook Calendar
Self-integrationA second integration on Microsoft Graph
UnipileSame endpoints and event format

One link Hosted Auth vs. full OAuth flow

With a native integration, you build the authorization redirect, the callback, the code exchange, the encrypted token store and the reconnection flow when a token is revoked. With Unipile Hosted Auth, your backend requests one link and receives an account_id on your notify_url once the user is connected. When access is lost, the same link with "type": "reconnect" brings the user back. Your team spends its time on the calendar features users see, not on the plumbing.

Technical support and integration ease

You are not left alone with the documentation. Book an integration call with our founders (CTO and CEO) to align scopes, sync strategy and the choice of OAuth app before you build, and reach our live support team before, during and after the integration, at no extra cost. We keep the integration up to date when Google changes its API or its policies.

Second provider

Expanding Versatility: Unipile's Integration with Outlook Calendar API

Most B2B products need Outlook Calendar as soon as they support Google Calendar. With Unipile, an Outlook Calendar account uses the same endpoints, the same event format and the same webhook as a Google account, so your calendar code is written once.

On the Microsoft side, you register your application in Microsoft Entra ID (formerly Azure Active Directory) and add its credentials to Unipile; our team can help with that setup. The native route goes through Microsoft Graph, explained in our Outlook Calendar API guide. To keep both providers in sync in one product, read calendar sync for SaaS.

Google Calendar Google CalendarPersonal Google and Google Workspace accountsGET /api/v1/calendars/{calendar_id}/events
Outlook Calendar Outlook CalendarMicrosoft accounts, linked through your Entra ID appGET /api/v1/calendars/{calendar_id}/events

Same request, same response format. See the Outlook Calendar API page.

Connect your first Google Calendar account today

The Google Calendar API covers everything a scheduling feature needs, from events to availability and change notifications. Unipile gives you the same capabilities through one hosted authentication link and one webhook, without verifying your own Google app first.

Google Calendar API FAQ

Quick answers on scopes, quotas, webhooks and errors when you integrate Google Calendar.

Google's calendar API lets an application read and write the calendars and events of a Google account, with the user's permission. Developers use it to create meetings from their own product, check availability before proposing a slot, and show a user's schedule next to a CRM record, a candidate or a ticket.

Standard use of the API has no charge. Usage is capped by per-minute quotas, per project and per user, listed on Google's usage limits page, which also describes any billing beyond those limits. Check it before you size a large rollout.

Only for public calendars. An API key identifies your project but not a user, so it cannot open private calendars. To read or change a user's own events, your app needs OAuth 2.0 and a calendar scope approved by that user.

Request the narrowest scope that covers your feature. calendar.events reads and writes events, calendar.readonly only reads, calendar.freebusy only shows availability, and the full calendar scope is for apps that also manage calendars and sharing.

Yes, through push notifications. You open a channel with events.watch and an HTTPS address, and Google calls that address when the calendar changes. The notification has no body, so your app then runs an incremental sync with its stored sync token to get the changed events.

A 403 with rateLimitExceeded or userRateLimitExceeded means too many requests: retry with exponential backoff. Other 403 reasons, such as forbiddenForNonOrganizer, are permission problems that a retry will not fix. A 410 with fullSyncRequired means your sync token is no longer valid and you need a full sync.

No. By default your users connect through Unipile's Google OAuth app, which is CASA Tier 2 certified, so you can build and launch without your own verification. You can switch to your own OAuth credentials later for a white label consent screen, as explained in the Google OAuth documentation.

Still have questions? Our team is here to help.

Talk to an expert