Google Workspace
Google Workspace is Google's comprehensive cloud-based productivity and collaboration platform that includes Gmail, Google Calendar, Google Drive, Google Docs, Google Sheets, Google Slides, Google Meet, and other business applications. This integration provides access to query and analyze data across multiple Google Workspace services including email communications, calendar scheduling, file storage, and account settings.
| Category | Collaboration |
| Direction | Query source |
| Sign-in | Service Account (Domain-Wide Delegation), OAuth 2.0 Client |
| Query languages | SQLite |
| Tables | 15 |
| Query templates | 61 |
| Website | google.com |
Before you start
Huntbase can sign in to Google Workspace with any of these methods: Service Account (Domain-Wide Delegation), OAuth 2.0 Client. Pick one, create the credential in Google Workspace, then keep it to hand for the Connect step.
Service Account (Domain-Wide Delegation)
Service-account credentials JSON (file path or contents) with domain-wide delegation, impersonating an admin user.
- In the Google Cloud console, select your project, click Enable APIs and Services, and enable the Google Calendar API, Google Drive API, Gmail API, Google People API and Google Admin SDK API.
- Go to Menu › IAM & Admin › Service Accounts, click Create service account, enter a name, and click Done.
- Click the service account's email, open the Keys tab, choose Add key › Create new key, select JSON, and click Create. The JSON key file downloads.
- On the service account's details, click Show advanced settings and copy the Client ID under Domain-wide delegation.
- In the Google Admin console, go to Menu › Security › Access and data control › API controls, click Manage Domain Wide Delegation, then Add new. Paste the Client ID, enter the read-only scopes below as a comma-separated list, and click Authorize.
Permissions:
https://www.googleapis.com/auth/admin.reports.audit.readonlyhttps://www.googleapis.com/auth/calendar.readonlyhttps://www.googleapis.com/auth/contacts.readonlyhttps://www.googleapis.com/auth/contacts.other.readonlyhttps://www.googleapis.com/auth/directory.readonlyhttps://www.googleapis.com/auth/drive.readonlyhttps://www.googleapis.com/auth/gmail.readonly
OAuth 2.0 Client
OAuth 2.0 client secret credential file used to authenticate as a user.
- In the Google Cloud console, enable the same APIs as for the service account method and configure the OAuth consent screen.
- Go to Menu › Google Auth platform › Clients, click Create Client, choose Application type › Desktop app, and click Create. Download the client secret JSON file.
- Run
gcloud auth application-default login --client-id-file=client_secret.jsonwith the same read-only scopes as the service account method, and sign in as the user whose access Huntbase should use. - Note the file path printed after
Credentials saved to file:. That file is your credential.
- Domain-wide delegation changes can take up to 24 hours to apply, but usually take effect sooner.
For the vendor's own instructions, see Google Workspace credentials documentation.
Use a dedicated, read-only credential for Huntbase where the product allows it. Huntbase only needs to read.
Connect Google Workspace
- Go to Connections and click New connection, or click New connection on the Google Workspace product page.
- On Product, pick Google Workspace and choose the Owner.
- On Details, give the connection a Name and, optionally, a Description.
- On Connect, fill in the settings and credentials described below.
- On Verify, review the summary and click Create & check.
For everything else on the setup page — saving a draft, I'll do this later, and what each check result means — see Connections.
Settings
Where your Google Workspace lives:
| Field | Required | Notes |
|---|---|---|
| Impersonated User Email | No | Required for the service account method. The email of a Workspace user with permission to use the Admin APIs, such as a Workspace admin. |
Credentials
Choose a Method, enter a Credential label (for example Production), then fill in the fields for that method.
Service Account (Domain-Wide Delegation)
| Field | Required | Notes |
|---|---|---|
| Service Account Credentials | Yes | Secret — not shown again after you save it. |
OAuth 2.0 Client
| Field | Required | Notes |
|---|---|---|
| OAuth Token Path | Yes | The Application Default Credentials file that gcloud saves after you sign in, not the client secret JSON you downloaded. Secret — not shown again after you save it. |
Query it
Once connected, Google Workspace can serve these languages in a query tab, and Scout can use it when you ask in Auto:
| Language | Use it for |
|---|---|
| SQLite | SQL over the 15 tables listed below, alongside every other connected source. |
Example: SQLite
Gmail settings basic info — Explore the language settings and delegation details associated with your Google Workspace Gmail account.
select
user_email,
display_language,
delegates
from
googleworkspace_gmail_my_settings;
Google Workspace ships with 61 query templates. Find them in Library › Queries — see Query templates.
Tables
Google Workspace adds 15 tables. Browse their columns from Schema in the query bar's ⋯ menu.
All 15 tables
| Table | Contains |
|---|---|
googleworkspace_activity_report | Google Workspace Activity Report |
googleworkspace_calendar | Metadata of the specified calendar. |
googleworkspace_calendar_event | Events scheduled on the specified calendar. |
googleworkspace_calendar_my_event | Events scheduled on the specified calendar. |
googleworkspace_drive | Drives defined user's shared drives in the Google Drive. |
googleworkspace_drive_my_file | Retrieves file's metadata or content owned by an user. |
googleworkspace_gmail_draft | Retrieves draft messages in the specified user's mailbox. |
googleworkspace_gmail_message | Retrieves messages in the specified user's mailbox. |
googleworkspace_gmail_my_draft | Retrieves draft messages in the current authenticated user's mailbox. |
googleworkspace_gmail_my_message | Retrieves messages in the current authenticated user's mailbox. |
googleworkspace_gmail_my_settings | Retrieves settings for the current authenticated user account. |
googleworkspace_gmail_settings | Retrieves settings for the specified account. |
googleworkspace_people_contact | Contacts owned by the authenticated user. |
googleworkspace_people_contact_group | Contact groups owned by the authenticated user |
googleworkspace_people_directory_people | Domain contacts in the authenticated user's domain directory. |
Next steps
- Connections — health, credentials and settings after you connect
- Query languages — syntax, parameters and time ranges
- Chatting with Scout — ask questions without writing a query
- All integrations — the rest of the catalog