Use cases → Reporting and data
Report mailbox usage for all users via delegation
Aggregate mailbox sizes and activity across every user in a domain by impersonating them with a service account, avoiding manual exports or per-user scripts.
| Who it is for | IT administrators and operations teams responsible for monitoring mailbox growth and usage trends across a Workspace domain. |
|---|---|
| APIs | Gmail API |
| Typical scopes | gmail.readonly |
The problem
Understanding mailbox utilisation across hundreds or thousands of users is painful. The Admin console shows only rough totals, and per-user inspection is manual and slow. Automated scripts are needed for actionable, up-to-date data.
How it works
- Use a service account with domain-wide delegation to impersonate each user.
- Fetch mailbox size and message counts via the Gmail API's users.getProfile and users.messages.list endpoints.
- Aggregate the data centrally for analysis and alerting.
- Schedule regular runs to track trends over time.
What changes
Mailbox usage data becomes available in a structured, exportable format, making it possible to spot growth, anomalies, or dormant accounts before they become operational issues.
Questions people ask
Can I get exact storage usage per label or folder?
No, the Gmail API only exposes overall message and thread counts per user, not storage size breakdowns by label.
Does this require individual user consent?
No, with domain-wide delegation properly configured, user consent is not needed for reporting mailbox metadata.
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
Send a daily digest that catches problems early
One scheduled email that checks the things that fail quietly and reports only what changed.
Reconcile records between two systems automatically
Compare what your tracking sheet says against what the source system says, and report the differences.
Work out which sources actually produce customers
Join enquiry records to outcomes so spend goes where the revenue is.