Integrations / Email

Gmail

Search messages, read their sender, subject and snippet, list and apply labels, create drafts in Gmail, and trigger workflows when new mail arrives.

7 tools 1 trigger event Connect with OAuth

Tools

gmail.search_messages

Search messages with Gmail search syntax, e.g. from:ada@example.com is:unread newer_than:2d; returns message and thread IDs (hex strings like 18f2a3b4c5d6e7f8) to pass to get_message.

qlabel_idsmax_resultspage_tokeninclude_spam_trash

gmail.get_message

Get a message's sender, recipients, subject, date, labels and snippet by ID; the body itself is not returned.

message_id*format

gmail.list_labels

List the mailbox's labels with their IDs, e.g. INBOX, UNREAD, STARRED or Label_123 for user labels.

gmail.modify_labels writes

Add or remove labels on a message, e.g. remove UNREAD to mark it read or INBOX to archive it.

message_id*add_label_idsremove_label_ids

gmail.create_draft writes

Create a draft from a complete RFC 2822 email encoded as a base64url string.

raw*thread_id

gmail.api_get

Send a GET request to any Gmail API path under https://gmail.googleapis.com/gmail/v1/users/me and return the response. For endpoints the named tools don't cover.

path*params

gmail.api_request writes

Send a POST, PUT, PATCH or DELETE request to any Gmail API path under https://gmail.googleapis.com/gmail/v1/users/me.

method*path*paramsbody

Tick Allow raw writes on the connection to add api_request, which can send POST, PUT, PATCH and DELETE requests to any Gmail API path.

Connect

  1. In the Google Cloud console, create or pick a project and enable the Gmail API under APIs & Services → Library.
  2. Under Google Auth Platform, fill in Branding, choose the Audience (Internal for a Google Workspace organization, or External with yourself as a test user), and under Data Access add the scope https://www.googleapis.com/auth/gmail.modify, which covers reading messages, changing labels and creating drafts.
  3. gmail.modify is a restricted scope: an app offered to the public needs Google's restricted scope verification and a security assessment. It works without verification for an Internal app in your own Google Workspace organization, or for an External app in Testing used by its listed test users (whose refresh tokens Google expires after 7 days).
  4. Under Google Auth Platform → Clients, create a Web application client and add the redirect URL shown on the connection page (https://<this app>/oauth/callback) as an authorized redirect URI.
  5. Paste the client ID and client secret on the connection, save, and use Connect to sign in with Google.
  6. To trigger workflows on new mail, enable the Cloud Pub/Sub API in the same project, create a topic, and grant gmail-api-push@system.gserviceaccount.com the Pub/Sub Publisher role on it. Add a push subscription to the topic whose endpoint is the request URL shown on the connection page, token included. Then paste the topic name on the connection, tick Watch the inbox and save.

Press Connect on the connection to approve access at Gmail. Tokens renew automatically. How OAuth connections work

Credentials

OAuth client secret

Gmail API docs

Triggers

Add a Pub/Sub push subscription whose endpoint is this URL, token included, on the topic set on this connection, then tick Watch the inbox and save. Murmurator asks Gmail to watch the inbox and renews the watch every day. A notification carries decoded.emailAddress and decoded.historyId, not the message: follow it with search_messages, e.g. is:unread newer_than:1h.

Events

mailbox.changed
trigger
kind: gmail connection: gmail events: [mailbox.changed]

Your next automation is one sentence away.

14-day free trial with $5 of built-in AI included. Cancel anytime.