Workspace Admin SDK Guide
The Google Workspace Admin SDK provides programmatic access to powerful admin-level functions. Admins can use REST APIs to manage users, groups, domains, devices, reports, and more — enabling automation, audit tracking, and custom tooling.
🧩 What Can You Do With Admin SDK?
- Provision, suspend, or delete users
- Manage organizational units and roles
- Fetch domain-level audit reports
- Track login activity and suspicious sign-ins
- Register and manage Chrome & mobile devices
- Query usage reports and license counts
🔧 Core API Components
Directory API: Manage users, groups, OUs
Reports API: Audit logins, activity, usage
Chrome Management: Monitor enrolled Chrome devices
Tokens API: View third-party app access
📦 Example: Create a New User via API
POST https://admin.googleapis.com/admin/directory/v1/users
Authorization: Bearer {access_token}
Content-Type: application/json
{
"name": {
"givenName": "Jane",
"familyName": "Doe"
},
"password": "AutoGenPassword2025!",
"primaryEmail": "jane.doe@shivcloud.com"
}
🔐 Authentication & Access
Admin SDK requires OAuth 2.0 authorization. You must:
- Enable Admin SDK API in Google Cloud Console
- Create a service account with domain-wide delegation
- Grant client access from the Admin Console:
Security > API Controls > Domain-wide Delegation
🛠 Tools to Use With Admin SDK
- Google Admin SDK Explorer – test APIs live
- Python, Node.js, Java SDKs – client libraries
- Apps Script – connect Workspace to internal dashboards
- BigQuery + Reports API – workspace-wide insights
✅ Use Cases for Admins
- 👤 Bulk User Import: Automate onboarding via CSV scripts or HR sync.
- 📨 License Audit: Generate monthly license usage reports.
- 📱 Mobile Device Wipe: Revoke access for lost/stolen phones.
- 📊 Login Reports: Track suspicious IPs or failed sign-ins.
- 📤 App Access Logs: See what third-party apps are connected via OAuth.
📚 Useful Resources
Last updated: July 2025