Gmail

Integrate your application with the Gmail API

🚀 Quickstart

Connect to Gmail with Tenklo and see data flow in 2 minutes.

Create the integration

In Tenklo (free signup), go to Integrations -> Configure New Integration -> Gmail.

Tenklo has credentials you can use for testing. Activate them in the dashboard.

Authorize Gmail

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.

Call the Gmail API

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.

Implement Tenklo in your app

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.

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 nameDescriptionTypeSource code
batch-delete-messagesPermanently delete multiple Gmail messages by IDAction🔗 Github
batch-modify-messagesAdd and remove labels on multiple Gmail messages at once.Action🔗 Github
create-draftCreate a Gmail draft message from RFC 2822 MIME content.Action🔗 Github
create-filterCreate a mailbox filter with match criteria and label actions.Action🔗 Github
create-labelCreate a new user label with visibility settings.Action🔗 Github
create-send-as-aliasCreate a custom send-as alias for the mailboxAction🔗 Github
delete-draftDelete an existing draft by draft IDAction🔗 Github
delete-filterDelete a mailbox filter by filter IDAction🔗 Github
delete-forwarding-addressDelete a forwarding address from Gmail settings.Action🔗 Github
delete-labelDelete a user-created labelAction🔗 Github
delete-messagePermanently delete a Gmail message by ID.Action🔗 Github
delete-send-as-aliasDelete a custom send-as alias from the mailbox.Action🔗 Github
delete-threadPermanently delete a Gmail thread and its messages.Action🔗 Github
get-attachmentRetrieve a specific message attachment payload by attachment ID.Action🔗 Github
get-auto-forwarding-settingsRetrieve the mailbox auto-forwarding configuration.Action🔗 Github
get-draftRetrieve a draft and its embedded message payload.Action🔗 Github
get-filterRetrieve a mailbox filter by filter ID.Action🔗 Github
get-forwarding-addressRetrieve a forwarding address configured for the mailbox.Action🔗 Github
get-imap-settingsRetrieve IMAP settings for the mailboxAction🔗 Github
get-labelRetrieve a single Gmail label by label ID.Action🔗 Github
get-language-settingsRetrieve Gmail language settings for the mailbox.Action🔗 Github
get-messageRetrieve a specific Gmail message with optional format selection.Action🔗 Github
get-pop-settingsRetrieve POP settings for the mailbox.Action🔗 Github
get-send-as-aliasRetrieve a configured send-as aliasAction🔗 Github
get-threadRetrieve a Gmail thread and its messages.Action🔗 Github
get-vacation-settingsRetrieve the mailbox vacation responder settings.Action🔗 Github
list-draftsList drafts in the mailbox with pagination support.Action🔗 Github
list-filtersList mailbox filters configured for the authenticated userAction🔗 Github
list-forwarding-addressesList forwarding addresses configured for the mailbox.Action🔗 Github
list-labelsList built-in and user-created mailbox labels.Action🔗 Github
list-messagesList messages matching Gmail query and label filters.Action🔗 Github
list-send-as-aliasesList send-as aliases available for the mailbox.Action🔗 Github
list-threadsList conversation threads matching Gmail query and label filters.Action🔗 Github
list-watch-historyList mailbox history records after a given history IDAction🔗 Github
modify-messageAdd and remove labels on a Gmail messageAction🔗 Github
modify-threadAdd and remove labels across a Gmail thread.Action🔗 Github
send-draftSend an existing draft messageAction🔗 Github
send-messageSend an email message through Gmail using raw MIME content.Action🔗 Github
stop-watchStop Gmail push notification watch state for the mailbox.Action🔗 Github
trash-messageMove a Gmail message to trashAction🔗 Github
trash-threadMove a Gmail thread to trash.Action🔗 Github
untrash-messageRestore a trashed Gmail message to the mailbox.Action🔗 Github
untrash-threadRestore a trashed Gmail thread to the mailbox.Action🔗 Github
update-auto-forwarding-settingsUpdate Gmail auto-forwarding behavior and dispositionAction🔗 Github
update-draftReplace an existing draft with new MIME content.Action🔗 Github
update-imap-settingsUpdate IMAP enablement and visibility settings.Action🔗 Github
update-labelUpdate a user-created label's name or visibility settings.Action🔗 Github
update-language-settingsUpdate the mailbox display languageAction🔗 Github
update-pop-settingsUpdate POP access settings for the mailboxAction🔗 Github
update-send-as-aliasUpdate send-as alias settings such as display name or reply-to.Action🔗 Github
update-send-as-smtp-msaUpdate the SMTP MSA settings for a send-as alias.Action🔗 Github
update-vacation-settingsUpdate the mailbox vacation responder configuration.Action🔗 Github
verify-send-as-aliasTrigger verification for a custom send-as aliasAction🔗 Github
watch-mailboxStart Gmail push notifications for mailbox changes.Action🔗 Github
filtersSync Gmail mailbox filters and their criteria or actions.Sync🔗 Github
labelsSync built-in and user-created Gmail labels.Sync🔗 Github
messagesSync Gmail messages with an initial backfill followed by history-based incremental updates.Sync🔗 Github
send-as-aliasesSync configured Gmail send-as aliases and alias settingsSync🔗 Github
threadsSync Gmail conversation threads with full message hydrationSync🔗 Github

On this page