Prompt
Google Calendar API not syncing events
Latest observation
Here’s a practical checklist to diagnose why the Google Calendar API isn’t syncing events.
1) Confirm the API is actually enabled
In Google Cloud Console:
- Go to APIs & Services → Library
- Make sure Google Calendar API is enabled for the correct project
2) Verify auth and scopes
Common issue: the app has credentials, but not the right permissions.
For reading/writing events, typical scopes:
- Read only:
https://www.googleapis.com/auth/calendar.readonly - Full access:
https://www.googleapis.com/auth/calendar
If using OAuth:
- Ensure the user granted the requested scopes
- If scopes changed, you may need to re-consent or clear stored tokens
If using a service account:
- It can only access calendars it’s been granted access to
- For Google Workspace, domain-wide delegation may be needed for user calendars
3) Check which calendar you’re syncing
Make sure you’re using the correct calendarId:
- Primary calendar: usually the user’s email or
"primary" - Shared calendars: need the exact calendar ID from the Calendar settings
A wrong calendarId often looks like “no events found.”
4) Confirm event insertion vs. list retrieval
If events were created but don’t appear:
- Check the
events.insertresponse - Verify the event is being written to the expected calendar
- Ensure you’re listing from the same calendar
If listing events:
- Use
events.list - Check query parameters like:
timeMintimeMaxsingleEventsorderBy=startTime
Example:
GET https://www.googleapis.com/calendar/v3/calendars/primary/events?singleEvents=true&orderBy=startTime
5) Watch out for time zone issues
A common reason events “don’t sync”:
- Event times are being saved in the wrong timezone
timeMin/timeMaxfilters exclude the event
Make sure:
- Times are ISO 8601
- Timezone is specified correctly
- Your local timezone matches the calendar/event timezone
6) Check incremental sync logic
If you’re doing sync with syncToken:
- A stale or invalid
syncTokencan break syncing - If you get a 410 Gone, you need to do a full sync again
For initial sync:
- Call
events.list - Store the returned
nextSyncToken - Use it later for incremental updates
7) Inspect API responses and errors
Look at the exact error message and HTTP status:
- 401 Unauthorized → token expired/invalid
- 403 Forbidden → missing scope, permission issue, or API quota problem
- 404 Not Found → wrong calendar ID
- 410 Gone → invalid sync token
- 429 Too Many Requests → rate limiting
- 5xx → temporary Google-side issue
8) Check quotas and rate limits
In Cloud Console:
- APIs & Services → Quotas
- See if you’re hitting request limits
If yes:
- Add backoff/retry
- Reduce polling frequency
- Use push notifications where possible
9) Make sure push notifications are set up correctly
If using watch channels:
- The channel must be renewed before expiration
- Webhook endpoint must be publicly reachable and return the expected validation
- You still need to fetch changes after receiving a notification
10) Test with a minimal request
Try a simple events.list with a known calendar to isolate the issue.
Example with curl:
curl -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
"https://www.googleapis.com/calendar/v3/calendars/primary/events?singleEvents=true&orderBy=startTime"
If this works, the issue is likely in your app logic rather than the API setup.
Fastest way to pinpoint the issue
If you share:
- The exact API call you’re making
- The HTTP status code / error message
- Whether you’re using OAuth or service accounts
- Whether the issue is with insert, list, or incremental sync
…I can help you narrow it down quickly.