Use cases → Admin and governance
Send automated suspicious login alerts to admins
Detect suspicious Workspace logins and automatically notify admins using a delegated service account and audit API polling.
| Who it is for | Security or IT operations teams responsible for monitoring account compromise and responding to threats. |
|---|---|
| APIs | Admin SDK |
| Typical scopes | admin.reports.audit.readonly, admin.directory.user.readonly |
The problem
Manual review of login anomalies is slow and error-prone, and admins often learn about incidents too late. Automated alerts reduce mean time to respond but require reliable detection and delivery.
How it works
- Configure a service account with domain-wide delegation and the reporting scopes.
- Poll the Admin SDK's Reports API for new suspicious login events at regular intervals.
- Deduplicate events by tracking event IDs or timestamps.
- Format and send a notification (email, webhook, etc.) to the admin group for each new event.
What changes
Admins receive near real-time alerts for risky logins, allowing faster investigation and containment.
Watch it explained
“Google Workspace accounts 101: google workspace sign in logs?” — HowtoFixDllExeErrors on YouTube. Third-party video, included because it covers this ground well. We are not affiliated with the channel.
Questions people ask
How often should I poll the Reports API?
Every 5–10 minutes is typical; polling more frequently risks hitting quota or seeing incomplete results due to API propagation delays.
Can I get real-time push notifications for suspicious logins?
Not directly—there’s no push for login events. Polling the audit API is the only supported pattern.
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
Audit which third-party apps can read your mail
List every OAuth grant across the domain and find the retired tools still holding access.
Automate joiners, movers and leavers
Create accounts, set group membership, provision Drive and hand over mailboxes without a manual checklist.
Continuously verify your delegation still works
A scheduled probe that proves every API still answers under every tenant, before a customer finds out otherwise.