Google Workspace Integration Guide
Last updated: September 3, 2026
This guide explains how to integrate Google Workspace with Matters.ai to monitor sensitive data across Google Drive and Gmail. It covers service account setup, domain-wide delegation, required API permissions, integration configuration, scan setup, user-level scope selection, and reviewing detected sensitive entities. It also outlines how Monitor & Remediate mode can be used to perform authorised remediation actions on Google Drive files and permissions
The integration with Google Workspace can only be performed by the Google Workspace Administrator, as it requires pan-organisational permissions to execute successfully.
Step 1: Create and Configure the Service Account in GCP
Log in to your GCP console

Select the GCP project where you want to configure the integration, and navigate to IAM & Admin → Service Accounts.

Create a new service account and name it, for example,gcp-integration-new

In the permissions, add viewer role:

Post creation:
Fetch the
unique IDfor the service account

Click on Keys in the menu.

Choose Create New Key from the dropdown.Use this key when integrating GWS with the Matters.ai Dashboard.

Store the Service Account Secret Key File as a JSON in a secure environment

Step 2: Configure Domain-Wide Delegation in Google Workspace Admin Console
Login to your Google Workspace Admin Console,

Navigate to:
⇒ Security>Access and Data Control > API Controls > Domain Wide Delegation

Once in Domain Wide Delegation, click on Add a new Client ID

Over here, add the following:
1. Client ID: Enter the Service Account Unique ID
2. Under OAuth Scopes, Add the Required Scopes
To integrate Google Workspace with Matters.ai, add the OAuth scopes for Google Drive and Gmail listed below. The required scopes depend on the services you want to monitor and the selected connection mode.
Google Drive and Gmail Monitoring
For the Monitor connection mode, add the following scopes under the same Domain-Wide Delegation Client ID.
Google Drive scopes:
https://www.googleapis.com/auth/drive.readonly,
https://www.googleapis.com/auth/drive.activity.readonly,
https://www.googleapis.com/auth/admin.directory.user.readonly,
https://www.googleapis.com/auth/userinfo.email,
https://www.googleapis.com/auth/admin.directory.domain.readonly,
https://www.googleapis.com/auth/admin.reports.usage.readonly
These scopes allow Matters.ai to discover Google Workspace users, scan Google Drive files and metadata, access Drive activity, verify Workspace domains, and retrieve usage information.
Gmail scopes:
https://www.googleapis.com/auth/gmail.settings.sharing,
https://www.googleapis.com/auth/gmail.settings.basic,
https://www.googleapis.com/auth/gmail.readonly
These scopes allow Matters.ai to monitor Gmail messages, attachments, forwarding rules, send-as aliases, and other sharing configurations.
For integrating GWS, add all the Google Drive and Gmail scopes listed above under the same Domain-Wide Delegation Client ID.
Google Drive Remediation
To perform authorised remediation actions on Google Drive files, select Monitor & Remediate as the connection mode while configuring the Google Workspace integration.
In addition to the monitoring scopes listed above, add the following OAuth scope:
https://www.googleapis.com/auth/drive
This scope allows Matters.ai to perform remediation actions such as modifying file-sharing permissions, restricting access, and removing unsafe sharing configurations.
The
drive.readonlyscope supports monitoring and data classification only. Thedrivescope is required to perform remediation actions on Google Drive files.
Scope | Type | Connection Mode | Permission Scope | Reason for Requirement |
|---|---|---|---|---|
| GDrive | Monitor and Remediate | Provides read and write access to Google Drive files and metadata, including the ability to modify file-sharing permissions and access settings. | Required when Monitor & Remediate mode is enabled so Matters.ai can perform authorised remediation actions, such as restricting public or external sharing, removing unauthorised access, and updating file permissions. |
| GDrive | Monitor | Provides read-only access to Google Drive files and metadata, enabling retrieval of data without modification. | Fetching the GDrive Files for Data Classification |
| GDrive | Monitor | Grants read-only access to Drive activity logs, allowing tracking of file interactions and usage. | For real-time incremental scans, we require activity logs to gauge the user activity post the previous classification scan window |
| GDrive | Monitor | Allows read-only access to user information in Google Workspace, necessary for administrative purposes without modifying user data. | Post Integration, we populate all the users that are present in the organisation via this scope. Clients can select a smaller scope of users from the GWS dashboard incase they wish to limit the scope of data classification to a smaller subset of users. |
| GDrive | Monitor | Provides access to the user's email address for authentication and identification purposes. | Required to fetch the user email from the Google native |
| GDrive | Monitor | This OAuth scope allows the application/service account to view domain-related information in a Google Workspace tenant. Google lists this as a Directory API scope used to define what level of Admin SDK access an app receives. | Required to read Google Workspace domain information, including primary domain, secondary domains, and aliases, for tenant verification and domain-based configuration. |
| GDrive | Monitor | Allows read-only access to Google Workspace usage reports for the domain via the Admin SDK Reports API. It enables the application/service account to view user-level and service-level Workspace usage metrics without modifying any data. | Required to fetch Google Workspace usage data for the tenant, such as user/service usage metrics, to understand SaaS usage patterns, enrich inventory analytics, identify active/inactive users, and support usage-based reporting without making changes to Workspace data. |
| Gmail | Monitor | Allows the application to access and manage sensitive Gmail sharing settings, including mailbox delegation and settings that determine who can access or manage a user’s mailbox. This scope is available only for administrative use through a service account with domain-wide delegation. | Required to identify potentially risky mailbox-sharing configurations, such as unauthorized delegates or external forwarding addresses, which could expose organisational email data. |
| Gmail | Monitor | Allows the application to view and manage general Gmail settings, including email filters, auto-forwarding, POP/IMAP configuration, send-as aliases and other mailbox preferences. | Required to inspect Gmail configurations and detect risky settings, such as suspicious forwarding rules, filters that redirect or delete emails, unsafe POP/IMAP configurations and unauthorised send-as aliases. |
| Gmail | Monitor | Provides read-only access to Gmail messages and mailbox settings, including emails, threads, headers, labels and attachments, without allowing modification or deletion. | Required to retrieve email content and metadata for sensitive-data discovery and classification. This enables Matters to identify sensitive information within emails and attachments without modifying, sending or deleting any mailbox data. |
Step 3: Enable Required Google Cloud APIs
Enable the APIs in the same Google Cloud project where the service account was created:
For Google Drive integration, enable:
Google Drive API
Google Drive Activity API
People API
Google Cloud Resource Manager API
Admin SDK API
For Gmail integration, enable:
Gmail API
Refer to the links below to enable all the required APIs in the same Google Cloud project where the service account was created.
Google Drive API:
🔗 https://console.cloud.google.com/apis/library/drive.googleapis.com

Google Drive Activity API:
🔗https://console.cloud.google.com/apis/library/driveactivity.googleapis.com

People API:
🔗https://console.cloud.google.com/apis/library/people.googleapis.com

Google Resource Manager API:
🔗https://console.cloud.google.com/marketplace/product/google/cloudresourcemanager.googleapis.com

Admin SDK API:
🔗https://console.cloud.google.com/marketplace/product/google/admin.googleapis.com

Gmail API
🔗https://console.cloud.google.com/apis/library/gmail.googleapis.com

Step 4: Open the SAAS Integrations Section
Login to the Matters.ai Dashboard, navigate to Integrations, select the SaaS tab to view the available integration options, and under Google Workspace Integration, click Connect.

Provide the required integration details:
Integration Name: Enter a descriptive name for easy identification.
Connection Mode:
Select Monitor & Remediate if you want Matters.ai to perform authorised remediation actions on Google Drive files.
The Google Workspace integration supports two connection modes:
Monitor: Scans and monitors Google Workspace data without modifying files, sharing links, or permissions.
Monitor & Remediate: Allows Matters.ai to perform approved remediation actions on Google Drive files and permissions.
Admin Email ID: Specify the email address of your
Google Workspace administrator.Upload the JSON key file by clicking the browse button and selecting the appropriate file from your local device
Once all required information is entered, click Connect to proceed:

Upon successful integration, a confirmation message will appear:“GWS Integrated Successfully”

Step 5: Configure SAAS Scan Settings
Once GWS Integration is Complete:
Navigate to SAAS.
The Automated Discovery will run automatically.
All the Gdrive and Gmail users will Automatically listed inside the SAAS Inventory

Step 6 : Manually Configure SAAS Scans
You have to configure scans manually. To do this, navigate to SAAS click on Scan Settings

Step 6.1: Select a Scan Type
Select Google Workspace, Choose the scanning mode that best suits your organization’s monitoring and data coverage requirements:
Real-Time Scan: Continuously monitors changes to user accounts, files, and sites, enabling immediate detection of newly added or modified data.
Backfilling Scan: Scans all existing data to establish comprehensive baseline coverage and identify sensitive entities across historical content.

Step 6.2 : Manage Google Drive user Scanning
Under the Google Drive section, you will see a list of users associated with your organization.
Add or remove users as needed to specify whose GDrive content should be scanned.
This granular control allows you to focus scanning resources on relevant accounts only.
After selecting the Gdrive users, click Save Google Workspace Config to apply the configuration and use it for subsequent scans.

Step 6.3 : Manage Gmail users Scanning
In the Gmail section, you can view the list of users associated with your organization.
Select or deselect users to define whose Gmail content should be included in the scan.
This user-level control helps you limit scanning to only the accounts that are relevant to your requirements.
Once you have selected the required Gmail users, click Save Google Workspace Config to apply the configuration and use it for subsequent scans.

Step 6.4: Confirm Configuration and Start Scan
Upon saving, a success message “SaaS configuration saved successfully” will appear.

Scans will automatically run based on your configured schedule and options.

Sensitive entities discovered through scanning will be displayed in the dashboard for review.

Step 7: Review Scanned Entities
To inspect the detailed list of sensitive entities found:
Click on the specific GDrive, Gmail accounts displayed on the Overview page to check for scanned data.

View File Details and Perform Remediation
Click the Information tab to view the datastore’s scan summary, file details, and properties.

Click a data element to view all files in which that sensitive entity was detected.

Click a specific file to view its details, detected sensitive entities, sharing information, and file activity.

Click on Take Action to perform the available remediation actions on the selected file.

By completing these steps, your Google Workspace integration with Matters.ai will be configured for secure monitoring of Google Drive and Gmail. You can define the required scan type, control which users are included, automatically discover sensitive data, and review detected entities from the dashboard. If Monitor & Remediate mode is enabled, authorised remediation actions can also be performed on Google Drive files and permissions.