Gmail
Gmail is Google's email service, providing secure, reliable email communication with powerful search, organization, and filtering capabilities. The Gmail API enables programmatic access to Gmail mailbox data, including messages, labels, drafts, and attachments, allowing applications to read, send, and manage email on behalf of users.

Power end-to-end data operations for your Gmail API with Nexla. Our bi-directional Gmail connector is purpose-built for Gmail, making it simple to ingest data, sync it across systems, and deliver it anywhere — all with no coding required. Nexla turns API-sourced data into ready-to-use, reusable data products and makes it easy to send data to Gmail or any other destination. With comprehensive monitoring, lineage tracking, and access controls, Nexla keeps your Gmail workflows fast, secure, and fully governed.
Features
Type: API
- Seamless API Integration: Connect to any endpoint as source or destination without coding, with automatic data product creation
- Visual Composition & Chaining: Build complex integrations using visual templates, chain API calls, and compose workflows with data validation and filtering
- API Proxy: Expose curated slices of your data securely with a secure and customizable API proxy that validates and transforms data on the fly
- Request optimization with intelligent batching, retry, and caching to minimize API calls and costs
Prerequisites
Before creating a Gmail credential in Nexla, ensure the following requirements are met:
Google Account
An active Google account with access to the Gmail mailbox you want to connect is required. The account must have Gmail enabled and accessible.
Required Permissions
The Nexla Gmail connector uses OAuth 2.0 to authenticate with the Gmail API. During the authorization process, you will be prompted to grant the following access scopes:
- gmail.readonly -- Allows Nexla to read messages, labels, and attachments from your Gmail account.
- gmail.send -- Allows Nexla to send messages and drafts on your behalf.
- gmail.modify -- Allows Nexla to modify message labels (such as marking messages as read or archiving them) and manage drafts.
These scopes are requested together during the OAuth authorization flow. You must approve all requested scopes for full connector functionality. If you only need to read data from Gmail, the connector will still function with limited permissions, but destination endpoints (such as sending messages or modifying labels) may not be available.
Google Workspace Considerations
If you are using a Google Workspace (formerly G Suite) account, your organization's administrator may need to approve third-party application access. If you encounter an authorization error during the OAuth flow, contact your Google Workspace administrator to ensure that the Nexla application is permitted to access Gmail data. For additional details, refer to Google's documentation on controlling third-party app access.
Authenticate
Create a credential in Nexla
-
After selecting the data source/destination type, click the Add Credential tile to open the Add New Credential overlay.
-
Enter a name for the credential in the Credential Name field and a short, meaningful description in the Credential Description field.
-
Click the Authorize button to initiate the OAuth 2.0 authorization flow. A new browser window will open, directing you to the Google sign-in page.
-
Sign in with the Google account that has access to the Gmail mailbox you want to connect. If you are already signed in, select the appropriate account from the list.
-
Review the permissions that Nexla is requesting, and click Allow to grant access. Google will redirect you back to Nexla once authorization is complete.
The OAuth authorization flow is managed entirely by Google. Nexla does not have access to your Google account password. The authorization grants Nexla a secure token that allows it to access Gmail data on your behalf, and this access can be revoked at any time from your Google Account permissions page.
-
Click the Save button at the bottom of the overlay. The newly added credential will now appear in a tile on the Authenticate screen during data source/destination creation and can be selected for use with a new data source or destination.
Use as a data source
To create a new data flow, navigate to the Integrate section, and click the New Data Flow button. Select the Gmail connector tile, then select the credential that will be used to connect to the Gmail instance, and click Next; or, create a new Gmail credential for use in this flow.
Endpoint templates
Nexla provides pre-built templates that can be used to rapidly configure data sources to ingest data from common Gmail endpoints. Select the endpoint from which this source will fetch data from the Endpoint pulldown menu. Available endpoint templates are listed in the expandable boxes below.
Once the selected endpoint template has been configured, click the Test button to the right of the endpoint selection menu to retrieve a sample of the data that will be fetched. Sample data will be displayed in the Endpoint Test Result panel on the right, allowing you to verify that the source is configured correctly before saving.
Manual configuration
Gmail data sources can also be manually configured to ingest data from any valid Gmail API endpoint, including endpoints not covered by the pre-built templates, chained API calls, or custom request parameters. Select the Advanced tab at the top of the configuration screen, and follow the instructions in Connect to Any API to configure the API method, endpoint URL, date/time and lookup macros, path to data, metadata, and request headers.
Gmail API endpoints follow the base URL pattern https://gmail.googleapis.com/gmail/v1/users/{userId}/{resource}, where userId is typically me for the authenticated user. Date/time macros are useful for filtering messages by date using the q parameter with Gmail search operators such as after: and before:. For the List Messages endpoint, the messages array is located at $.messages[*] in the JSON response; for endpoints that return a single message object, use $ to capture the entire response. For a complete list of available endpoints, refer to the Gmail API REST reference.
Once all of the relevant settings have been configured, click the Create button in the upper right corner of the screen to save and create the new Gmail data source. Nexla will now begin ingesting data from the configured endpoint and will organize any data that it finds into one or more Nexsets.
Use as a destination
Click the + icon on the Nexset that will be sent to the Gmail destination, and select the Send to Destination option from the menu. Select the Gmail connector from the list of available destination connectors, then select the credential that will be used to connect to the Gmail organization, and click Next; or, create a new Gmail credential for use in this flow.
Endpoint templates
Nexla provides pre-built templates that can be used to rapidly configure destinations to send data to common Gmail endpoints. Select the endpoint to which data will be sent from the Endpoint pulldown menu. Then, click on the template in the list below to expand it, and follow the instructions to configure additional endpoint settings.
Manual configuration
Gmail destinations can also be manually configured to send data to any valid Gmail API endpoint. Using manual configuration, you can also configure Nexla to automatically send the response received from the Gmail API after each call to a new Nexla webhook data source. Select the Advanced tab at the top of the configuration screen, and follow the instructions in Connect to Any API to configure the API method, data format, endpoint URL, request headers, attribute exclusions, record batching, and response webhooks.
Gmail API endpoints follow the base URL pattern https://gmail.googleapis.com/gmail/v1/users/{userId}/{resource}. For update/upsert operations, include the ID of the object to be updated at the end of the URL.
Save & activate
Once all endpoint settings have been configured, click the Done button in the upper right corner of the screen to save and create the destination. To send the data to the configured Gmail endpoint, open the destination resource menu, and select Activate.
The Nexset data will not be sent to Gmail until the destination is activated. Destinations can be activated immediately or at a later time, providing full control over data movement.