
Gmail
Email management and communication
✅ Ready📖 Documentation Available
Configuration Guide
Enterprise Setup
Enterprise Setup
Overview
The Gmail connector allows you to access, manage, and synchronize email data from Gmail, including attachments and embedded documents.Gmail is Google’s email service that provides access to emails, attachments, and related content. This connector enables synchronization of Gmail data including emails and their associated documents (Google Docs, Sheets, and Slides).Authentication
The Gmail connector uses OAuth 2.0 for authentication. This requires users to grant permission for the application to access their Gmail data within the scopes specified.How to configure and enable the Gmail Connector
Step 1: Create a Google Cloud Project & Set Up Admin Access
-
Sign in as Super Administrator:
Log in to the Google Cloud Console using an account with super administrator privileges. -
Create a New Project:
- Click on the project dropdown at the top of the console and select New Project
- Enter a project name and (optionally) assign it to a folder or organization
- Click Create

Only the project creator has full control by default. It is recommended to add at least one additional administrator (using the IAM settings) to ensure continued access even if the original creator leaves your organization.
Step 2: Enable Required APIs
- Navigate to APIs & Services > Library in the Cloud Console
-
Search for and enable the following APIs required for Gmail sync:
- Gmail API (required for email access)
- Google Drive API (required for attachments shared as Google Drive links)
- Admin SDK API (required to list the users and groups in your domain)

Step 3: Create a Service Account
- Navigate to IAM & Admin > Service Accounts in the Cloud Console
- Click Create Service Account

- Enter a Service Account Name and an optional Description
- Click Create and Continue, then Done

- Copy the Unique ID for use in the next step

Step 4: Delegate Domain-Wide Authority
- Sign in to the Google Admin Console with a super administrator account
- Navigate to Security > Access and data control > API controls
- Click Manage Domain Wide Delegation
- Click Add new and paste the service account’s client ID
- Add the following OAuth scopes required for Gmail sync:
The connector only reads, and asks for only these scopes:
gmail.readonly: read each user’s mail and attachmentsdrive.readonly: open attachments shared as Google Drive linksadmin.directory.user.readonly,admin.directory.group.readonly: list the users and groups in your organization, and each group’s membersadmin.directory.domain.readonly: requested with the other directory scopes, so grant it even though Gmail sync doesn’t list domainsadmin.reports.audit.readonly: read the admin audit log. The connector asks for it with the directory scopes, so grant it even though Gmail sync doesn’t read the log
- Click Authorize
Domain-wide delegation lets your service account impersonate users within your domain. Make sure that both the service account and the end user email belong to the same domain.
Step 5: Create a JSON Key for the Service Account
- In the Service Accounts list, select your newly created service account
- Click on the Keys tab
- Click Add Key and select Create new key
- Choose JSON as the key type and click Create
- Save the automatically downloaded JSON key file
It might be that while creating the key you get the error:
In this case, follow the steps given under the heading Enable Service Account Key Creation.
If your key was successfully created and downloaded, you can use that key in the enterprise search application.

If your key was successfully created and downloaded, you can use that key in the enterprise search application.
Configuring and enabling connector
- Navigate to Workspace settings > Under Workspace section in sidebar > Connectors in your application.


- Search for the Gmail Workspace connector and click on Set up to configure a connector instance.


- In the configuration dialog that opens:
- Enter an Instance name for your connector (e.g., “Company Gmail”)
- Enter the Admin Email (Admin user’s email with which you created the Google Cloud credentials)
- Under Service Account JSON, upload the JSON key file
- Click on the Next button to save the configuration and move to configure connector settings page. You can learn about the connector settings in the Connector Settings section.


- After configuring connector settings, you can click on Save configuration.

Enable Service Account Key Creation
If you encounter an error while creating the service account key due to organization policy constraints, follow these steps:1. Switch to the Organization Context
At the top of the Google Cloud Console (where the project name is shown), click the drop-down to see a list of organizations and projects.Select your organization rather than a specific project.If you don’t see an organization listed, make sure you’re signed in with an account that has access to the organization.2. Add Organisation Policy Administrator Role
Navigate to IAM & Admin > IAM in the Cloud ConsoleFind the current user and Click on the Pencil icon.Click on the Add another role button.Search for the Organisation Policy Administrator role.Click on the Add button.
3. Disable the Service Account Key Creation constraint
Navigate to IAM & Admin > Organization Policies in the Cloud ConsoleSearch for"iam.disableServiceAccountKeyCreation"Select the policyClick on the Manage Policy buttonIn Policy source, Select Override parent’s policy. Add a rule and set the enforcement to “Off”Click on the Save buttonAfter completing these steps, return to Step 5 and try creating the service account key again.Individual Setup
Individual Setup
Overview
The Gmail connector allows you to access, manage, and synchronize email data from Gmail, including attachments and embedded documents.Gmail is Google’s email service that provides access to emails, attachments, and related content. This connector enables synchronization of Gmail data including emails and their associated documents (Google Docs, Sheets, and Slides).Authentication
The Gmail connector uses OAuth 2.0 for authentication. This requires users to grant permission for the application to access their Gmail data within the scopes specified.Step 1: Create a Google Cloud Project
- Access the Google Cloud Console
- Create a project (if you don’t have one)
- Note your project ID for later use
Step 2: Enable Required APIs
- Navigate to APIs & Services > Library in the Cloud Console
- Search for and enable the following APIs required for Gmail sync:
- Gmail API (required for email access)

Step 3: Configure OAuth Consent Screen
- Navigate to APIs & Services > OAuth consent screen in the Cloud Console
- Configure the OAuth consent screen with your application details
- Add the required scopes (see Step 5)
Step 4: Create OAuth Client ID
- Navigate to APIs & Services > Credentials in the Cloud Console
- Click Create Credentials and select OAuth client ID
- Select Web application as the application type
- Set the Authorized redirect URI to:
or for HTTPS:
- Click Create and note your Client ID and Client Secret
Redirect URI must match exactly your frontend URL. For example: if your app is
running on https://f7f0-240.ngrok-free.app then redirect URI should be
https://f7f0-240.ngrok-free.app/connectors/oauth/callback/Gmail
in Google Cloud Console.
Step 5: Configure OAuth Scopes
- In the OAuth consent screen, navigate to the Scopes section
- Add the one OAuth scope the connector requests:
https://www.googleapis.com/auth/gmail.readonly- Read Gmail messages
This scope lets the connector read your messages and their attachments.
Configuring and enabling connector
- Navigate to Workspace settings > Under Personal section in sidebar > Your connectors in your application.


- You will see a list of connectors with Individual Setup.


- Search for the Gmail connector and click on Set up to configure a connector instance.
-
In the configuration dialog that opens:
- Enter an Instance name for your connector (e.g., “My Gmail”)
- Enter an OAuth app name (or pick an OAuth app your admin already saved)
- Enter the Client ID from your Google Cloud Console
- Enter the Client Secret from your Google Cloud Console
-
Click on the Next button to save the configuration and move to Authorize page.


-
In the Authorize page that opens:
- Click on Authenticate Gmail to proceed button
- You will be redirected to Google’s consent screen where you need to sign in and grant permission for Gmail and related document access

- After giving consent, you can click on Continue to configuration to configure connector settings. You can learn about the connector settings in the Connector Settings section.
- After configuring connector settings, you can click on Save configuration.

Connector Settings
Connector Settings
Sync Settings
Sync settings allow you to control how the connector syncs data from Gmail.Sync Strategy:- Scheduled - The connector will automatically sync data from Gmail at the scheduled interval.
- Manual - The connector will sync data from Gmail only when Admin manually triggers the sync from the connector settings page.
Sync Filters
Sync filters control which emails are fetched from Gmail. Emails that don’t satisfy the filters are skipped entirely.Received Date
Filters emails by when they were received. Accepts operators likeLast 365 days, Is after, Is before, or Is between for a specific range. By default it syncs the last 90 days.Indexing Filters
Indexing filters control which synced files are made searchable. Unlike sync filters, these don’t prevent files from being fetched: files are still recorded in the system but their indexing status is set to Manual Indexing.They can be manually indexed later from the All records section.Manual Indexing
When enabled, emails are synced but not automatically indexed. They won’t appear in search results until explicitly indexed.This can allow you to explicitly control which email messages and attachments are indexed for search, by going to the All records section and indexing the records manually.To index records manually go to the All records section, go to a record, click on the 3 dots > Start indexing.Index Emails
When disabled, synced email messages are not indexed for search by default. You can then go to the All records section and index the records manually.Index Attachments
When disabled, file attachments on synced messages are not indexed for search by default. You can then go to the All records section and index the records manually.Permissions
Access follows the mailbox a message was synced from. People are matched to PipesHub accounts by email.- Gmail Workspace connector: each user’s mailbox, with its messages and attachments, is visible only to that user. An admin who sets up the connector doesn’t get access to other people’s mail.
- A suspended or archived Google account loses access to its mailbox in PipesHub. The messages stay, and access comes back when the account is reinstated.
- A user deleted from the Workspace directory loses access to their mailbox. The messages stay until a full sync removes them.
- Gmail (individual connector): everything it syncs is visible only to the user who connected it.
FAQ
What's the difference between Gmail Connector and Gmail Action?
What's the difference between Gmail Connector and Gmail Action?
Example: Use Gmail Connector to search past email conversations. Use Gmail action to let agents send replies or forward messages.
Queries not returning results. What could be wrong?
Queries not returning results. What could be wrong?
There are three common causes:
-
Email mismatch - The email used during connector authentication doesn’t match your PipesHub account email. This causes permission issues preventing you from accessing synced data.
- Fix: Reconfigure the connector and authenticate using the same email as your PipesHub account.
-
Records show in “All records” but not in search - Documents display in the All records section but don’t appear in search query results.
- Fix: Verify sync filters in the connector settings and ensure indexing has completed. Check that the data matches your search query criteria.
-
Data not yet indexed - The connector is still syncing or hasn’t completed the initial indexing process.
- Fix: Go to Workspace settings > Connectors, check the sync status, and wait for indexing to complete.