Skip to content
Skip to main content

How Google Calendar webhooks work

Last updated:

Google Calendar push notifications use watch channels. You register a channel per watched resource, store channel IDs, renew them before they expire, and make follow-up API calls because the native notification tells you that something changed, not always what changed. That’s fine for a Google-only product, but it becomes brittle once you add Outlook or Exchange.

Nylas gives you one webhook destination for Google Calendar, Microsoft, iCloud, and Exchange. You subscribe to event triggers once, then your app receives the same payload shape whenever a Google event changes.

Subscribe to Google Calendar event changes

Section titled “Subscribe to Google Calendar event changes”

Create a webhook destination with the event triggers your sync pipeline needs. For most Google Calendar sync jobs, subscribe to all three event lifecycle triggers.

This subscription isn’t limited to Google. If the same Nylas application also has Microsoft or Exchange grants, the same destination can receive their calendar events too.

When you create or reactivate a webhook, Nylas sends a GET request to your webhook_url with a challenge query parameter. Return that exact value as plain text within 10 seconds.

After verification succeeds, Nylas stores a webhook_secret for the destination. Use it to verify the X-Nylas-Signature header on every notification.

A Google Calendar event notification identifies the changed grant, calendar, event ID, and trigger type. Respond with 200 OK, then process the event in a queue or background job.

For created and updated events, fetch the full event if your local copy needs fields that aren’t in the notification payload. For deleted events, mark the local row deleted by ID instead of trying to read the event again.

ConcernGoogle Calendar watch channelsNylas webhooks
SetupRegister a watch channel for the resource you monitorCreate one webhook destination with event triggers
RenewalChannels expire and need renewalManaged by Nylas
ProvidersGoogle onlyGoogle, Microsoft, iCloud, and Exchange
Payload modelNotification that a resource changedUnified event notification with object identifiers
SecurityCheck Google channel headersVerify X-Nylas-Signature with the webhook secret

If you only support Google Calendar and already own the native sync pipeline, watch channels work. If your product needs multiple calendar providers, a unified webhook removes the renewal and provider-branching code from your app.

Things to know about Google Calendar webhooks

Section titled “Things to know about Google Calendar webhooks”

Webhooks start after the grant exists. Nylas doesn’t send notifications for events that happened before the user connected their Google account.

Use grant.expired too. Calendar sync stops if the grant expires. Add the grant.expired trigger to your webhook destination or create a separate destination for auth health.

Expect duplicate or out-of-order delivery. Network retries can deliver the same notification more than once. Key your sync work by grant_id, calendar_id, event_id, and trigger type, then apply the latest provider state.

Recurring events need special handling. Moving one occurrence can send an update for the parent and occurrence metadata. Store master_event_id from expanded instances so your app can connect the change to the series.

Google Pub/Sub is for Gmail sync, not calendar webhooks. Calendar events use standard Nylas webhook destinations. You don’t need to create a Google Cloud Pub/Sub topic to receive event.updated notifications.