OXYGENOXYGEN
← All integrations
Gmail logo

Gmail

Send, read, and search email.

CommunicationOAuth63 endpoints

Endpoints

OperationMethod & pathEffectLatencyRateCost
GMAIL_ADD_LABEL_TO_EMAIL
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).
POST /composio/gmail/gmail_add_label_to_emailexternal_sendmanaged
GMAIL_BATCH_DELETE_MESSAGES
Tool to permanently delete multiple Gmail messages in bulk, bypassing Trash with no recovery possible. Use when you need to efficiently remove large numbers of emails (e.g., retention enforcement, mailbox hygiene). Use GMAIL_MOVE_TO_TRASH instead when reversibility may be needed. Always obtain explicit user confirmation and verify a sample of message IDs before executing. High-volume calls may trigger 429 rateLimitExceeded or 403 userRateLimitExceeded errors; apply exponential backoff.
POST /composio/gmail/gmail_batch_delete_messagesexternal_sendmanaged
GMAIL_BATCH_MODIFY_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. High-volume calls may return 429 rateLimitExceeded or 403 userRateLimitExceeded; apply exponential backoff.
POST /composio/gmail/gmail_batch_modify_messagesexternal_sendmanaged
GMAIL_CREATE_EMAIL_DRAFT
Creates a Gmail email draft. While all fields are optional per the Gmail API, practical validation requires at least one of recipient_email, cc, or bcc and at least one of subject or body. Supports To/Cc/Bcc recipients, subject, plain/HTML body (ensure `is_html=True` for HTML), attachments, and threading. Returns a draft_id that must be used as-is with GMAIL_SEND_DRAFT — synthetic or stale IDs will fail. 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. HTTP 429 may occur on rapid creation/send sequences; apply exponential backoff.
POST /composio/gmail/gmail_create_email_draftexternal_sendmanaged
GMAIL_CREATE_FILTER
Tool to create a new Gmail filter with specified criteria and actions. Use when the user wants to automatically organize incoming messages based on sender, subject, size, or other criteria. Note: you can only create a maximum of 1,000 filters per account.
POST /composio/gmail/gmail_create_filterexternal_sendmanaged
GMAIL_CREATE_LABEL
Creates a new label with a unique name in the specified user's Gmail account. Returns a labelId (e.g., 'Label_123') required for downstream tools like GMAIL_ADD_LABEL_TO_EMAIL, GMAIL_BATCH_MODIFY_MESSAGES, and GMAIL_MODIFY_THREAD_LABELS — those tools do not accept display names.
POST /composio/gmail/gmail_create_labelexternal_sendmanaged
GMAIL_CREATE_PROMPT_POST
Send a one-shot prompt to the Sanity Content Agent. Stateless one-shot prompt endpoint. No thread management or message persistence. Ideal for simple, single-turn interactions. Use when you need to send a single prompt and receive a response without maintaining conversation context.
POST /composio/gmail/gmail_create_prompt_postexternal_sendmanaged
GMAIL_DELETE_DRAFT
Permanently deletes a specific Gmail draft using its ID with no recovery possible; verify the correct `draft_id` and obtain explicit user confirmation before calling. Ensure the draft exists and the user has necessary permissions for the given `user_id`.
POST /composio/gmail/gmail_delete_draftexternal_sendmanaged
GMAIL_DELETE_FILTER
Tool to permanently delete a Gmail filter by its ID. Use when you need to remove an existing email filtering rule.
POST /composio/gmail/gmail_delete_filterexternal_sendmanaged
GMAIL_DELETE_LABEL
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.
POST /composio/gmail/gmail_delete_labelexternal_sendmanaged
GMAIL_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.
POST /composio/gmail/gmail_delete_messageexternal_sendmanaged
GMAIL_DELETE_THREAD
Tool to immediately and permanently delete a specified thread and all its messages. This operation cannot be undone. Use threads.trash instead for reversible deletion.
POST /composio/gmail/gmail_delete_threadexternal_sendmanaged
GMAIL_FETCH_EMAILS
Fetches a list of email messages from a Gmail account, supporting filtering, pagination, and optional full content retrieval. Results are NOT sorted by recency; sort by internalDate client-side. The messages field may be absent or empty (valid no-results state); always null-check before accessing messageId or threadId. Null-check subject and header fields before string operations. For large result sets, prefer ids_only=true or metadata-only listing, then hydrate via GMAIL_FETCH_MESSAGE_BY_MESSAGE_ID.
GET /composio/gmail/gmail_fetch_emailsnonemanaged
GMAIL_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`. Spam/trash messages are excluded unless upstream list/search calls used `include_spam_trash=true`. Use `internalDate` (milliseconds since epoch) rather than header `Date` for recency checks.
GET /composio/gmail/gmail_fetch_message_by_message_idnonemanaged
GMAIL_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`. Returns a `messages` array; `thread_id` is not echoed in the response. Message order is not guaranteed — sort by `internalDate` to find oldest/newest. Check `labelIds` per message to filter drafts. Concurrent bulk calls may trigger 403 `userRateLimitExceeded` or 429; cap concurrency ~10 and use exponential backoff.
GET /composio/gmail/gmail_fetch_message_by_thread_idnonemanaged
GMAIL_FORWARD_MESSAGE
Forward an existing Gmail message to specified recipients, preserving original body and attachments. Verify recipients and content before forwarding to avoid unintended exposure. Bulk forwarding may trigger 429/5xx rate limits; keep concurrency to 5–10 and apply backoff. Messages near Gmail's size limits may fail; reconstruct a smaller draft if needed.
POST /composio/gmail/gmail_forward_messageexternal_sendmanaged
GMAIL_GET_ATTACHMENT
Retrieves a specific attachment by ID from a message in a user's Gmail mailbox, requiring valid message and attachment IDs. Returns the downloaded file with its MIME type and filename. Attachments exceeding ~25 MB may be exposed as Google Drive links — use GOOGLEDRIVE_DOWNLOAD_FILE when a Drive file_id is present instead.
GET /composio/gmail/gmail_get_attachmentnonemanaged
GMAIL_GET_AUTO_FORWARDING
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 /composio/gmail/gmail_get_auto_forwardingnonemanaged
GMAIL_GET_CONTACTS
Fetches contacts (connections) for the authenticated Google account, allowing selection of specific data fields and pagination. Only covers saved contacts and 'Other Contacts'; email-header-only senders are out of scope. Contact records may have sparse data — handle missing fields gracefully. People API shares a per-user QPS quota; HTTP 429 requires exponential backoff (1s, 2s, 4s).
GET /composio/gmail/gmail_get_contactsnonemanaged
GMAIL_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 /composio/gmail/gmail_get_draftnonemanaged
GMAIL_GET_FILTER
Tool to retrieve a specific Gmail filter by its ID. Use when you need to inspect the criteria and actions of an existing filter.
GET /composio/gmail/gmail_get_filternonemanaged
GMAIL_GET_LABEL
Gets details for a specified Gmail label. Use this to retrieve label information including name, type, visibility settings, message/thread counts, and color.
GET /composio/gmail/gmail_get_labelnonemanaged
GMAIL_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 /composio/gmail/gmail_get_language_settingsnonemanaged
GMAIL_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. Scope is limited to the authenticated user's own contacts and 'Other Contacts' history only.
GET /composio/gmail/gmail_get_peoplenonemanaged
GMAIL_GET_PROFILE
Retrieves Gmail profile information (email address, aggregate messagesTotal/threadsTotal, historyId) for a user. messagesTotal counts individual emails; threadsTotal counts conversations; neither is per-label — use GMAIL_FETCH_EMAILS with label filters for label-specific counts. The returned historyId seeds incremental sync via GMAIL_LIST_HISTORY; if historyIdTooOld is returned, rescan with GMAIL_FETCH_EMAILS before resuming. Response may be wrapped under a top-level data field; unwrap before reading fields. A successful call confirms mailbox connectivity but not full mailbox access if granted scopes are narrow. Use the returned email address to dynamically identify the authenticated account rather than hard-coding it.
GET /composio/gmail/gmail_get_profilenonemanaged
GMAIL_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 /composio/gmail/gmail_get_vacation_settingsnonemanaged
GMAIL_IMPORT_MESSAGE
Tool to import a message into the user's mailbox with standard email delivery scanning and classification. Use when you need to add an existing email to a Gmail account without sending it through SMTP. This method doesn't perform SPF checks, so it might not work for some spam messages.
POST /composio/gmail/gmail_import_messageexternal_sendmanaged
GMAIL_INSERT_MESSAGE
Tool to insert a message into the user's mailbox similar to IMAP APPEND. Use when you need to add an email directly to a mailbox bypassing most scanning and classification. This does not send a message.
POST /composio/gmail/gmail_insert_messageexternal_sendmanaged
GMAIL_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.
GET /composio/gmail/gmail_list_cse_identitiesnonemanaged
GMAIL_LIST_CSE_KEYPAIRS
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.
GET /composio/gmail/gmail_list_cse_keypairsnonemanaged
GMAIL_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. Draft ordering is non-guaranteed; iterate using page_token until it is absent to retrieve all drafts. Newly created drafts may not appear immediately. Rapid calls may trigger 403 userRateLimitExceeded or 429 errors; apply exponential backoff (1s, 2s, 4s) before retrying.
GET /composio/gmail/gmail_list_draftsnonemanaged
GMAIL_LIST_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.
GET /composio/gmail/gmail_list_filtersnonemanaged
GMAIL_LIST_FORWARDING_ADDRESSES
Tool to list all forwarding addresses for the specified Gmail account. Use when you need to retrieve the email addresses that are allowed to be used for forwarding messages.
GET /composio/gmail/gmail_list_forwarding_addressesnonemanaged
GMAIL_LIST_HISTORY
Tool to list Gmail mailbox change history since a known startHistoryId. Use for incremental mailbox syncs. Persist the latest historyId as a checkpoint across sessions; without it, incremental sync is unreliable. An empty history list in the response is valid and means no new changes occurred.
GET /composio/gmail/gmail_list_historynonemanaged
GMAIL_LIST_LABELS
Retrieves all system and user-created labels for a Gmail account in a single unpaginated response. Primary use: obtain internal label IDs (e.g., 'Label_123') required by other Gmail tools — display names cannot be used as label identifiers and cause silent failures or errors. System labels (INBOX, UNREAD, SPAM, TRASH, etc.) are case-sensitive and must be used exactly as returned; INBOX, SPAM, and TRASH are read-only and cannot be added/removed via label modification tools. The Gmail search 'label:' operator accepts display names, but label_ids parameters in tools like GMAIL_FETCH_EMAILS require internal IDs from this tool — mixing conventions yields zero results silently. Do not hardcode label IDs across sessions; refresh via this tool on conflict errors.
GET /composio/gmail/gmail_list_labelsnonemanaged
GMAIL_LIST_MESSAGES
DEPRECATED: Use GMAIL_FETCH_EMAILS instead. Lists the messages in the user's mailbox. Use when you need to retrieve a list of email messages with optional filtering by labels or search query.
GET /composio/gmail/gmail_list_messagesnonemanaged
GMAIL_LIST_SEND_AS
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.
GET /composio/gmail/gmail_list_send_asnonemanaged
GMAIL_LIST_SMIME_INFO
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.
GET /composio/gmail/gmail_list_smime_infononemanaged
GMAIL_LIST_THREADS
Retrieves a list of email threads from a Gmail account, identified by `user_id` (email address or 'me'), supporting filtering and pagination. Spam and trash are excluded by default unless explicitly targeted via `label:spam` or `label:trash` in the query.
GET /composio/gmail/gmail_list_threadsnonemanaged
GMAIL_MODIFY_THREAD_LABELS
Adds or removes specified existing label IDs from a Gmail thread, affecting all its messages; ensure the thread ID is valid. To modify a single message only, use a message-level tool instead.
POST /composio/gmail/gmail_modify_thread_labelsexternal_sendmanaged
GMAIL_MOVE_THREAD_TO_TRASH
Moves the specified thread to the trash. Any messages that belong to the thread are also moved to the trash.
POST /composio/gmail/gmail_move_thread_to_trashexternal_sendmanaged
GMAIL_MOVE_TO_TRASH
Moves an existing, non-deleted email message to the trash for the specified user. Trashed messages are recoverable and still count toward storage quota until purged. Prefer this over GMAIL_BATCH_DELETE_MESSAGES when recovery may be needed. For bulk operations, use GMAIL_BATCH_MODIFY_MESSAGES or GMAIL_BATCH_DELETE_MESSAGES instead of repeated calls to this tool.
POST /composio/gmail/gmail_move_to_trashexternal_sendmanaged
GMAIL_PATCH_LABEL
Patches the specified user-created label. System labels (e.g., INBOX, SENT, SPAM) cannot be modified and will be rejected.
POST /composio/gmail/gmail_patch_labelexternal_sendmanaged
GMAIL_PATCH_SEND_AS
Tool to patch the specified send-as alias for a Gmail user. Use when you need to update properties of an existing send-as email address such as display name, reply-to address, signature, default status, or SMTP configuration.
POST /composio/gmail/gmail_patch_send_asexternal_sendmanaged
GMAIL_REMOVE_LABEL
DEPRECATED: Use GMAIL_DELETE_LABEL instead. Permanently deletes a specific, existing user-created Gmail label by its ID for a user; cannot delete system labels.
POST /composio/gmail/gmail_remove_labelexternal_sendmanaged
GMAIL_REPLY_TO_THREAD
Sends a reply within a specific Gmail thread using the original thread's subject; do not provide a custom subject as it will start a new conversation instead of replying in-thread. Requires a valid `thread_id` and at least one of `recipient_email`, `cc`, or `bcc`. Supports optional file attachments.
POST /composio/gmail/gmail_reply_to_threadexternal_sendmanaged
GMAIL_SEARCH_PEOPLE
Searches contacts by matching the query against names, nicknames, emails, phone numbers, and organizations, optionally including 'Other Contacts'. Only searches the authenticated user's contact directory — people existing solely in message headers won't appear; use GMAIL_FETCH_EMAILS for those. Results may be zero or multiple; never auto-select from ambiguous results. Results paginate via next_page_token; follow until empty and deduplicate by email. Many records lack emailAddresses or names even when requested — handle missing keys. Directory/organization policies may suppress entries.
GET /composio/gmail/gmail_search_peoplenonemanaged
GMAIL_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. Send is immediate and irreversible — confirm recipients and content before calling. No scheduling support; trigger at the desired UTC time externally. Gmail enforces ~25 MB message size limit and daily send caps (~500 recipients/day personal, ~2,000/day Workspace).
POST /composio/gmail/gmail_send_draftexternal_sendmanaged
GMAIL_SEND_EMAIL
Sends an email via Gmail API using the authenticated user's Google profile display name. Sends immediately and is irreversible — confirm recipients, subject, body, and attachments before calling. 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. All common file types including PNG, JPG, PDF, MP4, etc. are supported as attachments. Gmail API limits total message size to ~25 MB after base64 encoding. To reply in an existing thread, use GMAIL_REPLY_TO_THREAD instead. No scheduled send support; enforce timing externally.
POST /composio/gmail/gmail_send_emailexternal_sendmanaged
GMAIL_SETTINGS_GET_IMAP
Retrieves the IMAP settings for a Gmail user account, including whether IMAP is enabled, auto-expunge behavior, expunge behavior, and maximum folder size.
POST /composio/gmail/gmail_settings_get_imapexternal_sendmanaged
GMAIL_SETTINGS_GET_POP
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.
POST /composio/gmail/gmail_settings_get_popexternal_sendmanaged
GMAIL_SETTINGS_SEND_AS_GET
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.
POST /composio/gmail/gmail_settings_send_as_getexternal_sendmanaged
GMAIL_STOP_WATCH
Tool to stop receiving push notifications for a Gmail mailbox. Use when you need to disable watch notifications previously set up via the watch endpoint.
POST /composio/gmail/gmail_stop_watchexternal_sendmanaged
GMAIL_UNTRASH_MESSAGE
Tool to remove a message from trash in Gmail. Use when you need to restore a previously trashed email message.
POST /composio/gmail/gmail_untrash_messageexternal_sendmanaged
GMAIL_UNTRASH_THREAD
Tool to remove a thread from trash in Gmail. Use when you need to restore a deleted thread and its messages.
POST /composio/gmail/gmail_untrash_threadexternal_sendmanaged
GMAIL_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.
POST /composio/gmail/gmail_update_draftexternal_sendmanaged
GMAIL_UPDATE_IMAP_SETTINGS
Tool to update IMAP settings for a Gmail account. Use when you need to modify IMAP configuration such as enabling/disabling IMAP, setting auto-expunge behavior, or configuring folder size limits.
POST /composio/gmail/gmail_update_imap_settingsexternal_sendmanaged
GMAIL_UPDATE_LABEL
Tool to update the properties of an existing Gmail label. Use when you need to modify label name, visibility settings, or color.
POST /composio/gmail/gmail_update_labelexternal_sendmanaged
GMAIL_UPDATE_LANGUAGE_SETTINGS
Tool to update the language settings for a Gmail user. Use when you need to change the display language preference for the authenticated user or a specific Gmail account. The returned displayLanguage may differ from the requested value if Gmail selects a close variant.
POST /composio/gmail/gmail_update_language_settingsexternal_sendmanaged
GMAIL_UPDATE_POP_SETTINGS
Tool to update POP settings for a Gmail account. Use when you need to configure POP access window or message disposition behavior.
POST /composio/gmail/gmail_update_pop_settingsexternal_sendmanaged
GMAIL_UPDATE_SEND_AS
Tool to update a send-as alias for a Gmail user. Use when you need to modify display name, signature, reply-to address, or SMTP settings for a send-as email address. Gmail sanitizes HTML signatures before saving. Addresses other than the primary can only be updated by service accounts with domain-wide authority.
POST /composio/gmail/gmail_update_send_asexternal_sendmanaged
GMAIL_UPDATE_USER_ATTRIBUTES_VALUES
Update user attribute values for a resource. Use this action to set or update custom attributes for a user within an organization or project. When setting a value for an attribute key that also exists in SAML, the Sanity value will take precedence and shadow the SAML value.
POST /composio/gmail/gmail_update_user_attributes_valuesexternal_sendmanaged
GMAIL_UPDATE_VACATION_SETTINGS
Tool to update vacation responder settings for a Gmail user. Use when you need to configure out-of-office auto-replies.
POST /composio/gmail/gmail_update_vacation_settingsexternal_sendmanaged