Gmail
Integrate your application with the Gmail API
🚀 Quickstart
Connect to Gmail with Tenklo and see data flow in 2 minutes.
In Tenklo (free signup), go to Integrations -> Configure New Integration -> Gmail.
Tenklo has credentials you can use for testing. Activate them in the dashboard.
Go to Connections -> Add Test Connection -> Authorize, then log in to Gmail. Later, you'll let your users do the same directly from your app.
Let's make your first request to the Gmail API (fetch the profile of the currently signed-in user). This request will return basic details about the authenticated user, such as their email address and message/thread counts. Replace the placeholders below with your Environment API key, integration ID, and connection ID:
curl "https://api.tenklo.dev/proxy/gmail/v1/users/me/profile" \
-H "Authorization: Bearer <NANGO-API-KEY>" \
-H "Provider-Config-Key: <INTEGRATION-ID>" \
-H "Connection-Id: <CONNECTION-ID>"Or fetch credentials dynamically via the Node SDK or API.
✅ You're connected! Check the Logs tab in Tenklo to inspect requests.
Follow our Auth implementation guide to integrate Tenklo in your app.
To obtain your own production credentials, follow the setup guide linked below.
📚 Gmail Integration Guides
Tenklo maintained guides for common use cases.
-
How to register your own Gmail OAuth app
Register an OAuth app with Gmail and obtain credentials to connect it to Tenklo -
How to setup webhooks with Gmail on Tenklo Set up Gmail push notifications using Google Pub/Sub to receive real-time inbox updates
-
Google App & Security Review Pass Google's OAuth app verification and CASA security assessment to go to production
Official docs: Gmail API docs
🧩 Pre-built syncs & actions for Gmail
Explore Nango-provided actions in your dashboard. Extend and customize them to fit your needs.
Others
| Function name | Description | Type | Source code |
|---|---|---|---|
batch-delete-messages | Permanently delete multiple Gmail messages by ID | Action | 🔗 Github |
batch-modify-messages | Add and remove labels on multiple Gmail messages at once. | Action | 🔗 Github |
create-draft | Create a Gmail draft message from RFC 2822 MIME content. | Action | 🔗 Github |
create-filter | Create a mailbox filter with match criteria and label actions. | Action | 🔗 Github |
create-label | Create a new user label with visibility settings. | Action | 🔗 Github |
create-send-as-alias | Create a custom send-as alias for the mailbox | Action | 🔗 Github |
delete-draft | Delete an existing draft by draft ID | Action | 🔗 Github |
delete-filter | Delete a mailbox filter by filter ID | Action | 🔗 Github |
delete-forwarding-address | Delete a forwarding address from Gmail settings. | Action | 🔗 Github |
delete-label | Delete a user-created label | Action | 🔗 Github |
delete-message | Permanently delete a Gmail message by ID. | Action | 🔗 Github |
delete-send-as-alias | Delete a custom send-as alias from the mailbox. | Action | 🔗 Github |
delete-thread | Permanently delete a Gmail thread and its messages. | Action | 🔗 Github |
get-attachment | Retrieve a specific message attachment payload by attachment ID. | Action | 🔗 Github |
get-auto-forwarding-settings | Retrieve the mailbox auto-forwarding configuration. | Action | 🔗 Github |
get-draft | Retrieve a draft and its embedded message payload. | Action | 🔗 Github |
get-filter | Retrieve a mailbox filter by filter ID. | Action | 🔗 Github |
get-forwarding-address | Retrieve a forwarding address configured for the mailbox. | Action | 🔗 Github |
get-imap-settings | Retrieve IMAP settings for the mailbox | Action | 🔗 Github |
get-label | Retrieve a single Gmail label by label ID. | Action | 🔗 Github |
get-language-settings | Retrieve Gmail language settings for the mailbox. | Action | 🔗 Github |
get-message | Retrieve a specific Gmail message with optional format selection. | Action | 🔗 Github |
get-pop-settings | Retrieve POP settings for the mailbox. | Action | 🔗 Github |
get-send-as-alias | Retrieve a configured send-as alias | Action | 🔗 Github |
get-thread | Retrieve a Gmail thread and its messages. | Action | 🔗 Github |
get-vacation-settings | Retrieve the mailbox vacation responder settings. | Action | 🔗 Github |
list-drafts | List drafts in the mailbox with pagination support. | Action | 🔗 Github |
list-filters | List mailbox filters configured for the authenticated user | Action | 🔗 Github |
list-forwarding-addresses | List forwarding addresses configured for the mailbox. | Action | 🔗 Github |
list-labels | List built-in and user-created mailbox labels. | Action | 🔗 Github |
list-messages | List messages matching Gmail query and label filters. | Action | 🔗 Github |
list-send-as-aliases | List send-as aliases available for the mailbox. | Action | 🔗 Github |
list-threads | List conversation threads matching Gmail query and label filters. | Action | 🔗 Github |
list-watch-history | List mailbox history records after a given history ID | Action | 🔗 Github |
modify-message | Add and remove labels on a Gmail message | Action | 🔗 Github |
modify-thread | Add and remove labels across a Gmail thread. | Action | 🔗 Github |
send-draft | Send an existing draft message | Action | 🔗 Github |
send-message | Send an email message through Gmail using raw MIME content. | Action | 🔗 Github |
stop-watch | Stop Gmail push notification watch state for the mailbox. | Action | 🔗 Github |
trash-message | Move a Gmail message to trash | Action | 🔗 Github |
trash-thread | Move a Gmail thread to trash. | Action | 🔗 Github |
untrash-message | Restore a trashed Gmail message to the mailbox. | Action | 🔗 Github |
untrash-thread | Restore a trashed Gmail thread to the mailbox. | Action | 🔗 Github |
update-auto-forwarding-settings | Update Gmail auto-forwarding behavior and disposition | Action | 🔗 Github |
update-draft | Replace an existing draft with new MIME content. | Action | 🔗 Github |
update-imap-settings | Update IMAP enablement and visibility settings. | Action | 🔗 Github |
update-label | Update a user-created label's name or visibility settings. | Action | 🔗 Github |
update-language-settings | Update the mailbox display language | Action | 🔗 Github |
update-pop-settings | Update POP access settings for the mailbox | Action | 🔗 Github |
update-send-as-alias | Update send-as alias settings such as display name or reply-to. | Action | 🔗 Github |
update-send-as-smtp-msa | Update the SMTP MSA settings for a send-as alias. | Action | 🔗 Github |
update-vacation-settings | Update the mailbox vacation responder configuration. | Action | 🔗 Github |
verify-send-as-alias | Trigger verification for a custom send-as alias | Action | 🔗 Github |
watch-mailbox | Start Gmail push notifications for mailbox changes. | Action | 🔗 Github |
filters | Sync Gmail mailbox filters and their criteria or actions. | Sync | 🔗 Github |
labels | Sync built-in and user-created Gmail labels. | Sync | 🔗 Github |
messages | Sync Gmail messages with an initial backfill followed by history-based incremental updates. | Sync | 🔗 Github |
send-as-aliases | Sync configured Gmail send-as aliases and alias settings | Sync | 🔗 Github |
threads | Sync Gmail conversation threads with full message hydration | Sync | 🔗 Github |