Use cases → Scheduling
Exporting calendar events and capacity domain-wide
How to reliably export all users' primary and secondary Google Calendar events for capacity analysis, with details on avoiding incomplete data and silent API omissions.
| Who it is for | Workspace automation engineers and admins tasked with reporting or resource capacity planning. |
|---|---|
| APIs | Calendar API, Admin SDK |
| Typical scopes | calendar.readonly, admin.directory.user.readonly |
The problem
Teams often need a full export of all calendar events across a domain to analyse meeting load, room usage, or resource utilisation. Manual exports are impractical at scale, and partial exports can give misleading results. Many organisations underestimate the complexity of collecting data from both primary and secondary calendars, and often miss changes to calendar sharing or API limits, resulting in incomplete exports.
How it works
- Use the Admin SDK Directory API to enumerate all active users in the domain.
- For each user, use the Calendar API to list all calendars, including both primary and secondary calendars.
- For every calendar, fetch all events within the relevant date range, handling pagination and recurring events.
- Implement rate limiting and exponential backoff to avoid exceeding Calendar API quotas, and log all API failures for post-run review.
- Aggregate and store the exported data in a structured format suitable for capacity analysis, tagging any incomplete or failed exports for follow-up.
What changes
You obtain a comprehensive, auditable dataset of all user and resource calendars, supporting accurate capacity or utilisation analysis. Failures and gaps are traceable, so you can rerun or address specific users/calendars as needed.
Watch it explained
“Google Workspace Tutorial For Small Businesses 🤩” — WPDev on YouTube. Third-party video, included because it covers this ground well. We are not affiliated with the channel.
Questions people ask
How do I handle users with suspended or recently deleted accounts?
The Admin SDK Directory API can return suspended or recently deleted users depending on your query. Exclude these proactively, or handle their calendars separately, as their data may be in a different state or subject to retention policies.
Are secondary calendars included by default in the Calendar API?
No. You must explicitly list all calendars for each user, as secondary calendars (including shared resources and delegated calendars) are not queried by default when accessing the primary calendar.
What should I do if I hit Calendar API quota limits?
Implement exponential backoff and rate limiting in your automation. If you hit hard daily limits, you may need to spread the export over several days or request a quota increase from Google support.
Want this built?
This is a pattern we run in production. We will set up the delegation and build this on top of it — $500 per hour, most of it working the same day.
Talk to us Or read the setup guideRelated use cases
Build a real picture of team availability
Read calendars across the domain to answer who is free, who is overloaded and where the week actually went.
Turn a finished meeting into follow-up automatically
Detect that a meeting happened, pull the notes, and draft the follow-up before anyone opens their laptop.
Turn a booking into a record everywhere it matters
When a meeting is booked, create the record, the folder and the confirmation in one pass.