Setting Up Google Workspace Domain-Wide Delegation
MonitorWorkspace requires domain-wide delegation to access your organization's data through Google's APIs. This guide walks you through the setup.
Prerequisites
- Google Workspace Super Admin account
- Access to Google Cloud Console
Step 1: Create a GCP Project
- Go to Google Cloud Console
- Create a new project (e.g.,
monitorworkspace-prod)
- Note the Project ID — you'll need it during onboarding
Step 2: Enable Required APIs
In your GCP project, enable these APIs:
- Admin SDK API — User and group management
- Gmail API — Email monitoring and transfers
- Google Chat API — Chat monitoring and exports
- Google Workspace License API — License tracking and user counting
Step 3: Create a Service Account
- Go to IAM & Admin > Service Accounts
- Click Create Service Account
- Name:
monitorworkspace-sa
- Grant no project-level roles (delegation handles permissions)
- Create a JSON key and download it securely
Step 4: Configure Domain-Wide Delegation
- In the service account details, click Show domain-wide delegation
- Check Enable Google Workspace Domain-wide Delegation
- Copy the Client ID (numeric)
- Go to Google Admin Console > Security > API Controls > Domain-wide Delegation
- Click Add new
- Paste the Client ID
- Add these OAuth scopes:
https://www.googleapis.com/auth/admin.directory.user.readonly
https://www.googleapis.com/auth/admin.directory.group.readonly
https://www.googleapis.com/auth/admin.directory.group.member.readonly
https://www.googleapis.com/auth/gmail.readonly
https://www.googleapis.com/auth/chat.messages.readonly
https://www.googleapis.com/auth/chat.spaces.readonly
https://www.googleapis.com/auth/apps.licensing
https://mail.google.com/
Step 5: Complete Onboarding
- Log in to MonitorWorkspace with your Super Admin account
- Enter your GCP Project ID and upload the service account key
- MonitorWorkspace will verify the delegation is working
- You're all set!
Troubleshooting
| Issue |
Solution |
| "Delegation denied" error |
Wait 5-10 minutes after adding scopes — propagation takes time |
| "API not enabled" |
Double-check all 4 APIs are enabled in your GCP project |
| Only seeing some users |
Ensure the service account is delegating as a Super Admin email |
| Chat data not appearing |
Google Chat API may need separate enablement in Admin Console |
Having trouble with setup? Post your question below and include any error messages you're seeing.
|