Connect Gmail to Definable AI
Gmail is Google’s email service, featuring spam protection, search functions, and seamless integration with other G Suite apps for productivity
About Gmail
Gmail is a productivity tool. Connect it to Definable AI with one-click OAuth2 — no API keys or custom code required.
What you can automate with Gmail
Use Definable AI's agent platform to trigger workflows from Gmail, process results with 50+ AI models, and sync data across 900+ connected apps.
Tools & Actions (40 available)
- Batch delete Gmail messages: Tool to permanently delete multiple Gmail messages in bulk. Use when you need to efficiently remove large numbers of emails (e.g., retention enforcement, mailbox hygiene).
- Batch modify Gmail messages: Modify labels on multiple Gmail messages in one efficient API call. Supports up to 1,000 messages per request for bulk operations like archiving, marking as read/unread, or applying custom labels.
- Create email draft: Creates a Gmail email draft. All fields are optional per the Gmail API - drafts can be created with minimal content and edited later before sending. Supports To/Cc/Bcc recipients, subject, plain/HTML body (ensure `is_html=True` for HTML), attachments, and threading. When creating a draft reply to an existing thread (thread_id provided), leave subject empty to stay in the same thread; setting a subject will create a NEW thread instead.
- Create label: Creates a new label with a unique name in the specified user's Gmail account.
- Delete Draft: Permanently deletes a specific Gmail draft using its ID; ensure the draft exists and the user has necessary permissions for the given `user_id`.
- Delete label from account (permanent): Permanently DELETES a user-created Gmail label from the account (not from a message). WARNING: This action DELETES the label definition itself, removing it from all messages. System labels (INBOX, SENT, UNREAD, etc.) cannot be deleted. To add/remove labels from specific messages, use GMAIL_ADD_LABEL_TO_EMAIL action instead.
- Delete message: Permanently deletes a specific email message by its ID from a Gmail mailbox; for `user_id`, use 'me' for the authenticated user or an email address to which the authenticated user has delegated access.
- Fetch Message by Thread ID: Retrieves messages from a Gmail thread using its `thread_id`, where the thread must be accessible by the specified `user_id`.
- Fetch emails: Fetches a list of email messages from a Gmail account, supporting filtering, pagination, and optional full content retrieval.
- Fetch message by message ID: Fetches a specific email message by its ID, provided the `message_id` exists and is accessible to the authenticated `user_id`.
- Forward email message: Forward an existing Gmail message to specified recipients, preserving original body and attachments.
- Get Auto-Forwarding Settings: Tool to get the auto-forwarding setting for the specified account. Use when you need to retrieve the current auto-forwarding configuration including enabled status, forwarding email address, and message disposition.
- Get Draft: Retrieves a single Gmail draft by its ID. Use this to fetch and inspect draft content before sending via GMAIL_SEND_DRAFT. The format parameter controls the level of detail returned.
- Get Gmail attachment: Retrieves a specific attachment by ID from a message in a user's Gmail mailbox, requiring valid message and attachment IDs.
- Get IMAP Settings: Retrieves the IMAP settings for a Gmail user account, including whether IMAP is enabled, auto-expunge behavior, expunge behavior, and maximum folder size.
- Get Language Settings: Tool to retrieve the language settings for a Gmail user. Use when you need to determine the display language preference for the authenticated user or a specific Gmail account.
- Get POP settings: Tool to retrieve POP settings for a Gmail account. Use when you need to check the current POP configuration including access window and message disposition.
- Get People: Retrieves either a specific person's details (using `resource_name`) or lists 'Other Contacts' (if `other_contacts` is true), with `person_fields` specifying the data to return.
- Get Profile: Retrieves key Gmail profile information (email address, message/thread totals, history ID) for a user.
- Get Vacation Settings: Tool to retrieve vacation responder settings for a Gmail user. Use when you need to check if out-of-office auto-replies are configured and view their content.
- Get contacts: Fetches contacts (connections) for the authenticated Google account, allowing selection of specific data fields and pagination.
- Get send-as alias: Tool to retrieve a specific send-as alias configuration for a Gmail user. Use when you need to get details about a send-as email address including display name, signature, SMTP settings, and verification status. Fails with HTTP 404 if the specified address is not a member of the send-as collection.
- List CSE identities: Tool to list client-side encrypted identities for an authenticated user. Use when you need to retrieve CSE identity configurations including key pair associations.
- List CSE key pairs: Tool to list client-side encryption key pairs for an authenticated user. Use when you need to retrieve CSE keypair configurations including public keys and enablement states. Supports pagination for large result sets.
- List Drafts: Retrieves a paginated list of email drafts from a user's Gmail account. Use verbose=true to get full draft details including subject, body, sender, and timestamp.
- List Gmail filters: Tool to list all Gmail filters (rules) in the mailbox. Use for security audits to detect malicious filter rules or before creating new filters to avoid duplicates.
- List Gmail history: Tool to list Gmail mailbox change history since a known startHistoryId. Use when performing incremental mailbox syncs to fetch only new changes.
- List Gmail labels: Retrieves a list of all system and user-created labels for the specified Gmail account.
- List S/MIME configs: Lists S/MIME configs for the specified send-as alias. Use when you need to retrieve all S/MIME certificate configurations associated with a specific send-as email address.
- List send-as aliases: Lists the send-as aliases for a Gmail account, including the primary address and custom 'from' aliases. Use when you need to retrieve available sending addresses for composing emails.
- List threads: Retrieves a list of email threads from a Gmail account, identified by `user_id` (email address or 'me'), supporting filtering and pagination.
- Modify email labels: Adds and/or removes specified Gmail labels for a message; ensure `message_id` and all `label_ids` are valid (use 'listLabels' for custom label IDs).
- Modify thread labels: Adds or removes specified existing label IDs from a Gmail thread, affecting all its messages; ensure the thread ID is valid.
- Move to Trash: Moves an existing, non-deleted email message to the trash for the specified user.
- Patch Label: Patches the specified label.
- Reply to email thread: Sends a reply within a specific Gmail thread using the original thread's subject, requiring a valid `thread_id` and at least one of recipient_email, cc, or bcc must be provided. Supports attachments via the `attachment` parameter with valid `s3key`, `mimetype`, and `name`.
- Search People: Searches contacts by matching the query against names, nicknames, emails, phone numbers, and organizations, optionally including 'Other Contacts'.
- Send Draft: Sends an existing draft email AS-IS to recipients already defined within the draft. IMPORTANT: This action does NOT accept recipient parameters (to, cc, bcc). The Gmail API's drafts/send endpoint sends drafts to whatever recipients are already set in the draft's To, Cc, and Bcc headers - it cannot add or override recipients. If the draft has no recipients, you must either: 1. Create a new draft with recipients using GMAIL_CREATE_EMAIL_DRAFT, then send it 2. Use GMAIL_SEND_EMAIL to send a new email directly with recipients This action only requires the draft_id parameter.
- Send Email: Sends an email via Gmail API using the authenticated user's Google profile display name. At least one of 'to' (or 'recipient_email'), 'cc', or 'bcc' must be provided. At least one of subject or body must be provided. Requires `is_html=True` if the body contains HTML. For attachments, you must provide a FileUploadable object with valid `s3key` (obtained from a previous file download action like GMAIL_GET_ATTACHMENT), `mimetype` (e.g., 'image/png', 'application/pdf'), and `name` (filename). All common file types including PNG, JPG, PDF, MP4, etc. are supported. Gmail API limits total message size to ~25 MB after base64 encoding.
- Update draft: Updates (replaces) an existing Gmail draft's content in-place by draft ID. This action replaces the entire draft content with the new message - it does not patch individual fields. All fields are optional; if not provided, you should provide complete draft content to avoid data loss.
How to connect Gmail
- Sign in to Definable AI and go to Apps
- Search for Gmail and click Connect
- Authorize via OAuth2 — takes under 30 seconds
- Use Gmail actions in your AI agents and workflows