Gmail
API integration
Ship Email features without building the integration. Full Gmail API access via Proxy, normalized data through Unified APIs, and 50+ MCP-ready tools for AI agents — all extensible to your exact use case.
Talk to usUse Cases
Why integrate with Gmail
Common scenarios for SaaS companies building Gmail integrations for their customers.
Log email activity to your app's record timeline
SaaS platforms like CRMs, ATS tools, and project management apps can sync Gmail messages and threads to automatically associate email conversations with contacts, deals, or tickets — giving users full context without leaving your product.
Send emails through your users' Gmail accounts
Sales engagement, outreach, and support platforms can send emails directly from end users' Gmail accounts using create_a_gmail_message, ensuring messages land in the user's Sent folder, carry their signature, and benefit from their domain's deliverability reputation.
Generate and manage drafts programmatically
AI copilots, support tools, and workflow automation products can push pre-composed drafts into a user's Gmail via create_a_gmail_draft, letting the user review, edit, and send from their native Gmail client — keeping them in control while reducing manual work.
Extract attachments for automated document processing
Expense management, contract analysis, and recruiting platforms can pull attachments from specific emails using get_single_gmail_attachment_by_id to automatically parse receipts, invoices, resumes, or contracts without any manual upload step.
Monitor and triage inbound email with labels and filters
Support and operations tools can programmatically apply Gmail labels to threads via update_a_gmail_thread_by_id and create server-side filters with create_a_gmail_settings_filter to route, categorize, and prioritize inbound email for end users.
What You Can Build
Ship these features with Truto + Gmail
Concrete product features your team can ship faster by leveraging Truto’s Gmail integration instead of building from scratch.
Bi-directional email sync with record matching
Automatically ingest Gmail messages and threads into your app, match them to CRM contacts or support tickets by email address, and display full threaded conversation history on each record.
Native send-as-user email composer
Let users compose and send emails from within your app using their own Gmail account and Send As aliases, fetched via list_all_gmail_settings_sendas, so messages go out with the correct identity and signature.
AI-powered draft generation
Use create_a_gmail_draft to push AI-generated or template-based replies directly into a user's Gmail Drafts folder, ready for review and one-click send via gmail_drafts_send.
Incremental email sync via History API
Build a high-performance sync engine using list_all_gmail_history to fetch only new or changed messages since the last checkpoint, minimizing API calls and keeping your app's data fresh in near real-time.
Automated attachment ingestion pipeline
Scan incoming emails for attachments, download them with get_single_gmail_attachment_by_id, and feed them into OCR, parsing, or storage workflows — ideal for expense receipts, signed contracts, or candidate resumes.
Smart inbox labeling and categorization
Programmatically create custom labels with create_a_gmail_label and apply them to threads via update_a_gmail_thread_by_id to implement automated triage — tagging threads as 'High Priority', 'Needs Follow-up', or any custom category your product defines.
SuperAI
Gmail AI agent tools
Comprehensive AI agent toolset with fine-grained control. Integrates with MCP clients like Cursor and Claude, or frameworks like LangChain.
gmail_list_emails
Search and list Gmail messages matching a query. Use when locating specific emails by sender, subject, label, or unread state. Pass q with Gmail search syntax (from:, to:, subject:, label:, is:unread, has:attachment, after:, before:). Results are summaries (id and threadId only); hydrate via this resource's get with format=metadata. For conversation previews with snippets, prefer threads list instead. Returns one page; pass the response's next_cursor to fetch subsequent pages.
gmail_get_email
Read a single Gmail message: sender, subject, date, and snippet by default via format=metadata. Use when you know the exact message to inspect. Pass format=full only when you need the body to reply or summarize — metadata is faster and usually enough. Obtain id from messages list or threads get.
gmail_send_email
Send a Gmail message on behalf of the authenticated user. Provide the email as plain-text RFC 2822 MIME in the raw field (headers + blank line + body); Truto base64url-encodes it before sending, so do NOT pre-encode. For attachments, build a multipart/mixed MIME and pass the whole thing as raw. Returns the sent message resource including its id and threadId.
gmail_modify_email_labels
Modify labels on a Gmail message (addLabelIds / removeLabelIds) without changing the body. Use when starring, marking read/unread, archiving (remove INBOX), or applying user labels. Does NOT edit subject or body — use drafts for composition. Obtain id from messages.
gmail_trash_email
Move a Gmail message to Trash (recoverable). Use when the user asks to delete an email and a soft delete is acceptable. Prefer this over messages delete. Obtain id from messages.
gmail_list_conversations
Search and list Gmail conversations (threads) with a preview snippet per thread. Use when browsing recent correspondence or getting a conversation overview. Pass q with Gmail search syntax. For pinpointing one specific email, use messages list instead. Use threads get only when you need every message in the conversation. Returns one page; pass the response's next_cursor to fetch subsequent pages.
gmail_get_conversation
Read a full Gmail conversation (thread) including its messages. Use when summarizing or replying in-thread and you need the complete exchange. For a single message, use messages get instead. Obtain id from threads.
gmail_modify_conversation_labels
Modify labels on every message in a Gmail thread. Use when archiving, starring, or labeling a whole conversation at once. Obtain id from threads.
gmail_trash_conversation
Move an entire Gmail conversation (thread) to Trash, including all messages. Use when the user wants to discard a whole thread. Prefer this over threads delete. Obtain id from threads.
create_a_gmail_batch
The batch endpoint allows you to group multiple Gmail API requests (such as sending messages, modifying labels, deleting drafts, etc.) into a single HTTP request. Each request is executed independently, and its responses are returned in a multipart response. This is especially useful for bulk operations such as modifying labels on many messages or sending multiple emails at once.
list_all_oauth_user_info
Retrieves basic profile information about the authenticated user in Google Calendar. The response includes essential details such as the user's unique identifier (sub), full name (name), first name (given_name), last name (family_name), profile picture URL (picture), and email address (email).
gmail_get_attachment
Get a specific attachment from a Gmail message by attachment id. Returns the attachment payload including its base64url-encoded data and size. Required: message_id and id. user_id defaults to "me" (the authenticated user).
gmail_list_drafts
List Gmail drafts with each draft id and underlying message/thread ids (no body). Use when browsing unsent mail or resolving a draft to edit or send. Results are summaries; fetch content via this resource's get method. Pass q with Gmail search syntax when filtering. Returns one page; pass the response's next_cursor to fetch subsequent pages.
gmail_get_draft
Read one Gmail draft including its message headers and snippet (format=metadata) or full MIME (format=full). Use when reviewing or editing an unsent message before send. Obtain id from drafts.
create_a_gmail_draft
Create a Gmail draft (an unsent message saved in the mailbox). Pass the email as plain-text RFC 2822 MIME in message.raw and Truto base64url-encodes it before saving. Do not pre-encode. Returns the created draft including its id.
update_a_gmail_draft
Update an existing Gmail draft by its id, replacing its content. Pass the email as plain-text RFC 2822 MIME in message.raw and Truto base64url-encodes it before saving. Do not pre-encode. Returns the updated draft.
gmail_delete_draft
Permanently delete a Gmail draft by id (not moved to Trash). Use when discarding an unsent message. This delete is permanent and cannot be undone; confirm the exact id and get explicit user confirmation before calling. Obtain id from drafts.
send_a_gmail_draft
Send an existing Gmail draft by its id. Obtain the id from create draft or list drafts. Returns the sent message including its id and threadId.
list_all_gmail_history
List the history of all changes to the mailbox for user_id after the specified startHistoryId in Gmail. Returns history records with id, messages, messagesAdded, messagesDeleted, labelsAdded, and labelsRemoved fields.
gmail_list_labels
List all Gmail labels (system and user-created) in one response. Use when resolving a label name to its id before filtering mail or applying labels. Gmail does not paginate this endpoint. To apply labels to mail, use messages update or threads update — not this method.
gmail_get_label
Read one Gmail label: name, type, and visibility settings. Use when inspecting a known label id. Obtain id from labels.
gmail_create_label
Create a user-defined Gmail label. Use when the user wants a new mailbox label for organizing mail. Returns the created label including its id. System labels cannot be created this way.
gmail_delete_label
Permanently delete a user-created Gmail label by its immutable id (e.g. Label_31 from labels). Use when removing a custom label. System labels (INBOX, STARRED, …) cannot be deleted — remove them from messages via messages update instead. This delete is permanent and cannot be undone; confirm the exact id and get explicit user confirmation before calling. Obtain id from labels.
gmail_update_label
Update a user-created Gmail label's name or visibility. Use when renaming a label. Obtain id from labels. System labels cannot be renamed.
list_all_gmail_settings_sendas
List send-as aliases for the specified user_id in Gmail. Returns the primary send-as address and any custom 'from' aliases in the sendAs array.
get_single_gmail_settings_senda_by_id
Get the specified send-as alias for user_id in Gmail. Returns the send-as alias details including email address and configuration. Fails with 404 if alias is not found.
create_a_gmail_settings_senda
Create a custom 'from' send-as alias for user_id in Gmail. Returns the created alias with fields including verification status and sanitized signature if provided.
update_a_gmail_settings_senda_by_id
Update a send-as alias for user_id and id in Gmail. Returns the updated send-as alias including fields like signature and email address. Note: Only service account clients with domain-wide authority can update non-primary addresses.
delete_a_gmail_settings_senda_by_id
Delete the specified send-as alias for user_id in Gmail. Revokes any verification required for using the alias. Returns an empty JSON object on success.
list_all_gmail_settings_filters
Get message filters for a Gmail user with user_id. Returns a list of filters including criteria and actions for each filter.
get_single_gmail_settings_filter_by_id
Get a filter by id for the user identified by user_id in Gmail. Returns the filter's id, criteria, and action fields.
create_a_gmail_settings_filter
Create a filter for the user identified by user_id in Gmail. Returns the created filter including its id, criteria, and action. Note: maximum of 1,000 filters can be created.
delete_a_gmail_settings_filter_by_id
Delete a filter by id for the user_id in Gmail. Returns an empty JSON object on success.
list_all_gmail_settings_forwarding_addresses
Get the list of forwarding addresses for the specified user_id in Gmail. Returns forwardingAddresses array containing addresses that may be used for forwarding.
get_single_gmail_settings_forwarding_address_by_id
Get the specified forwarding address for user_id in Gmail. Returns forwardingEmail and verification status fields.
create_a_gmail_settings_forwarding_address
Create a forwarding address for user_id in Gmail. Returns the forwarding address resource including verification status which may be 'pending' if ownership verification is required.
delete_a_gmail_settings_forwarding_address_by_id
Delete the specified forwarding address for user_id in Gmail. Returns an empty JSON object on success. Requires forwardingEmail as id.
list_all_gmail_settings_delegates
List delegates for the specified userId in Gmail. Returns delegates array with delegate details including verification status.
get_single_gmail_settings_delegate_by_id
Get the specified delegate for user_id in Gmail. Returns delegate's email and related delegate information. Note: delegateEmail must be the primary email address.
create_a_gmail_settings_delegate
Create a delegate for the user identified by user_id in Gmail. Returns the delegate's email address and verification status. The delegate must be in the same Google Workspace organization and is added with status accepted without verification email.
delete_a_gmail_settings_delegate_by_id
Remove the specified delegate by delegate_email for the user identified by user_id in Gmail. The delegate user must be referred to by their primary email address. Response is an empty JSON object.
list_all_gmail_settings_cse_keypairs
List client-side encryption key pairs for a user in Gmail. Requires user_id. Returns cseKeyPairs array with key pair details and nextPageToken for pagination.
get_single_gmail_settings_cse_keypair_by_id
Get an existing client-side encryption key pair by user_id and id in Gmail. Returns key pair details including encryption keys and metadata.
create_a_gmail_settings_cse_keypair
Create and upload a client-side encryption S/MIME public key certificate chain and private key metadata for the authenticated user in Gmail. Requires user_id. Returns the created CseKeyPair including public key certificate chain and metadata.
list_all_gmail_settings_cse_identities
List client-side encrypted identities for a user in Gmail. Requires user_id. Returns cseIdentities array with identity details and nextPageToken for pagination.
get_single_gmail_settings_cse_identity_by_id
Get client-side encryption identity configuration for user_id and id in Gmail. Returns fields of the CseIdentity resource.
create_a_gmail_settings_cse_identity
Create and configure a client-side encryption identity authorized to send mail from the user account in Gmail. Requires user_id. Returns the created CseIdentity with its configuration details.
update_a_gmail_settings_cse_identity_by_id
Update a client-side encryption identity in Gmail by associating a different key pair. Requires user_id and id (emailAddress). Returns the updated CseIdentity fields including emailAddress and key_pair_configuration.
delete_a_gmail_settings_cse_identity_by_id
Delete a client-side encryption identity for the authenticated user in Gmail. Requires user_id and cse_email_address. The identity cannot be restored after deletion.
get_single_gmail_settings_auto_forwarding_by_id
Get the auto-forwarding setting for the specified account in Gmail. Requires user_id. Returns auto-forwarding configuration including enabled status, email address, and disposition.
update_a_gmail_settings_auto_forwarding_by_id
Update the auto-forwarding setting for the specified user_id in Gmail. Requires a verified forwarding address when auto-forwarding is enabled. Returns the updated AutoForwarding configuration.
get_single_gmail_settings_imap_by_id
Get IMAP settings for the user identified by user_id in Gmail. Returns fields including enabled status, auto-expunge, and folder size limits.
update_a_gmail_settings_imap_by_id
Update IMAP settings for a user in Gmail. Requires userId as the user's email address or 'me'. Returns the updated ImapSettings object.
get_single_gmail_settings_language_by_id
Get language settings for a user in Gmail. Requires user_id. Returns language code and display name fields in the response.
update_a_gmail_settings_language_by_id
Update language settings for a user in Gmail using user_id. Returns the saved displayLanguage which may differ from the requested value if a close variant is used.
get_single_gmail_settings_pop_by_id
Get POP settings for a user in Gmail. Requires user_id. Returns fields including accessWindow, disposition, and enable status.
update_a_gmail_settings_pop_by_id
Update POP settings for the user identified by user_id in Gmail. Returns the updated PopSettings including access window and disposition fields.
Why Truto
Why use Truto’s MCP server for Gmail
Other MCP servers give you a static tool list for one app. Truto gives you a managed, multi-tenant MCP infrastructure across 700+ integrations.
Auto-generated, always up to date
Tools are dynamically generated from curated documentation — not hand-coded. As integrations evolve, tools stay current without manual maintenance.
Fine-grained access control
Scope each MCP server to read-only, write-only, specific methods, or tagged tool groups. Expose only what your AI agent needs — nothing more.
Multi-tenant by design
Each MCP server is scoped to a single connected account with its own credentials. The URL itself is the auth token — no shared secrets, no credential leaking across tenants.
Works with every MCP client
Standard JSON-RPC 2.0 protocol. Paste the URL into Claude, ChatGPT, Cursor, or any MCP-compatible agent framework — tools are discovered automatically.
Built-in auth, rate limits, and error handling
Tool calls execute through Truto’s proxy layer with automatic OAuth refresh, rate-limit handling, and normalized error responses. No raw API plumbing in your agent.
Expiring and auditable servers
Create time-limited MCP servers for contractors or automated workflows. Optional dual-auth requires both the URL and a Truto API token for high-security environments.
Unified APIs
Unified APIs for Gmail
Skip writing code for every integration. Use Truto’s category-specific Unified APIs out of the box or customize the mappings with AI.
Unified Emails API
Attachments
Attachments are the files associated with an email.
Emails
An email is a digital message sent and received electronically over the Internet. It typically contains a subject, sender, recipients, body content, and sometimes attachments.
Folders
The folder is a container used to organize and manage email messages.
Unified User Directory API
Me
Unified Search API
Search
Search endpoint for all the apps.
How It Works
From zero to integrated
Go live with Gmail in under an hour. No boilerplate, no maintenance burden.
Link your customer’s Gmail account
Use Truto’s frontend SDK to connect your customer’s Gmail account. We handle all OAuth and API key flows — you don’t need to create the OAuth app.
We handle authentication
Don’t spend time refreshing access tokens or figuring out secure storage. We handle it and inject credentials into every API request.
Call our API, we call Gmail
Truto’s Proxy API is a 1-to-1 mapping of the Gmail API. You call us, we call Gmail, and pass the response back in the same cycle.
Unified response format
Every response follows a single format across all integrations. We translate Gmail’s pagination into unified cursor-based pagination. Data is always in the result attribute.
FAQs
Common questions about Gmail on Truto
Authentication, rate limits, data freshness, and everything else you need to know before you integrate.
How does authentication work for Gmail integrations through Truto?
Truto handles the full OAuth 2.0 flow required by Google. Your end users authorize access via a consent screen, and Truto manages token storage, refresh, and revocation. You never touch raw credentials.
How can I efficiently sync emails without polling the entire inbox?
Use the list_all_gmail_history endpoint. Store the historyId from your last sync, then request only changes (new messages, label modifications, deletions) since that point. This is far more efficient than re-listing all messages.
Does Truto support Gmail's label system, or does it map to folders?
Both. The Unified Emails API exposes a Folders resource that maps to Gmail labels, giving you a normalized interface. You can also use the native Gmail label endpoints (list_all_gmail_labels, create_a_gmail_label, update_a_gmail_label_by_id) for full control over Gmail's label system, including custom labels.
Can I send emails and manage drafts through the integration?
Yes. Use create_a_gmail_message to send emails directly, or create_a_gmail_draft to stage a draft in the user's mailbox. You can update drafts with update_a_gmail_draft_by_id and send them programmatically via gmail_drafts_send.
How do I handle bulk operations without hitting Gmail API rate limits?
Truto exposes create_a_gmail_batch for batch operations, which groups multiple API calls into a single request. This significantly reduces quota consumption when performing bulk actions like labeling, archiving, or fetching multiple messages.
What unified APIs are available alongside the native Gmail endpoints?
Truto provides Unified Emails API (covering Emails, Attachments, and Folders), Unified User Directory API (for the authenticated user's profile via 'Me'), and Unified Search API. These give you a normalized schema that works across email providers, while native endpoints remain available for Gmail-specific features like filters, delegates, and Send As aliases.
From the Blog
Gmail integration guides
Deep dives, architecture guides, and practical tutorials for building Gmail integrations.
Gmail
Get Gmail integrated into your app
Our team understands what it takes to make a Gmail integration successful. A short, crisp 30 minute call with folks who understand the problem.