google-gmail
v1.0.4Send, read, organize emails, manage labels, drafts, and filters
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
get_profile Get Profile
Retrieves the Gmail profile information for the authenticated user or a specified user, including account details and settings.
| Parameter | Type | Description |
|---|---|---|
userId * | string | The user's email address or the special value `me` to refer to the authenticated user. |
list_drafts List Drafts
Retrieves a list of draft messages from the user's mailbox. Supports filtering by search query and optional inclusion of drafts from spam and trash folders.
| Parameter | Type | Description |
|---|---|---|
userId * | string | The user's email address. Use the special value `me` to refer to the authenticated user. |
includeSpamTrash | boolean | Whether to include draft messages from the SPAM and TRASH folders in the results. |
maxResults | integer | Maximum number of drafts to return. The default is 100 and the maximum allowed value is 500. |
q | string | Filter draft messages using Gmail search query syntax. Supports the same query operators as the Gmail search box (e.g., from:, rfc822msgid:, is:unread). |
create_draft Create Draft
Creates a new email draft with the DRAFT label in Gmail. The draft can optionally include classification labels and custom label IDs.
| Parameter | Type | Description |
|---|---|---|
userId * | string | The user's email address or the special value 'me' to indicate the authenticated user. |
classificationLabelValues | array | Classification label values to apply to the draft message. Each classification label ID must be unique; duplicate IDs will be deduplicated arbitrarily. Only available for Google Workspace accounts. |
email_bcc | string | Blind carbon copy recipients (Bcc header), comma-separated |
email_body | string | Email body content (plain text or HTML) |
email_body_is_html | boolean | Whether email_body is HTML (True) or plain text (False) |
email_cc | string | Carbon copy recipients (Cc header), comma-separated |
email_from | string | Sender email address (From header) |
email_in_reply_to | string | In-Reply-To header (Message-ID of original message) |
email_references | string | References header (Message-IDs of related messages), space-separated |
email_reply_to | string | Reply-To header address |
email_subject | string | Email subject line |
email_to | string | Recipient email address (To header) |
labelIds | array | List of label IDs to apply to the draft message. Labels are applied in the order provided. |
get_draft Get Draft
Retrieves a specific draft message by ID. Returns the draft in the requested format for viewing or further editing.
| Parameter | Type | Description |
|---|---|---|
id * | string | The unique identifier of the draft message to retrieve. |
userId * | string | The user's email address or the special value 'me' to refer to the authenticated user. |
format | string | The format in which to return the draft message content and metadata. |
update_draft Update Draft
Updates the content of an existing draft message. Replaces the draft's message body and metadata with the provided values.
| Parameter | Type | Description |
|---|---|---|
id * | string | The unique identifier of the draft message to update. |
userId * | string | The user's email address. Use the special value `me` to refer to the authenticated user. |
classificationLabelValues | array | Classification label values to apply to the message. Each classification label ID must be unique; duplicate IDs will be deduplicated arbitrarily. Only available for Google Workspace accounts. Classifi… |
email_bcc | string | Blind carbon copy recipients (Bcc header), comma-separated |
email_body | string | Email body content (plain text or HTML) |
email_body_is_html | boolean | Whether email_body is HTML (True) or plain text (False) |
email_cc | string | Carbon copy recipients (Cc header), comma-separated |
email_from | string | Sender email address (From header) |
email_in_reply_to | string | In-Reply-To header (Message-ID of original message) |
email_references | string | References header (Message-IDs of related messages), space-separated |
email_reply_to | string | Reply-To header address |
email_subject | string | Email subject line |
email_to | string | Recipient email address (To header) |
labelIds | array | List of label IDs to apply to this message. Labels are used to organize and categorize messages in Gmail. |
delete_draft Delete Draft
Permanently deletes a draft message without moving it to trash. This action is immediate and irreversible.
| Parameter | Type | Description |
|---|---|---|
id * | string | The unique identifier of the draft message to delete. |
userId * | string | The email address of the user whose draft should be deleted. Use the special value `me` to refer to the authenticated user. |
send_draft Send Draft
Sends an existing draft message to recipients specified in the To, Cc, and Bcc headers. The draft must already exist and contain valid recipient information.
| Parameter | Type | Description |
|---|---|---|
userId * | string | The user's email address or the special value `me` to indicate the authenticated user. |
classificationLabelValues | array | Classification label values to apply to the message. Each classification label ID must be unique; duplicate IDs will be deduplicated arbitrarily. Only available for Google Workspace accounts. |
email_bcc | string | Blind carbon copy recipients (Bcc header), comma-separated |
email_body | string | Email body content (plain text or HTML) |
email_body_is_html | boolean | Whether email_body is HTML (True) or plain text (False) |
email_cc | string | Carbon copy recipients (Cc header), comma-separated |
email_from | string | Sender email address (From header) |
email_in_reply_to | string | In-Reply-To header (Message-ID of original message) |
email_references | string | References header (Message-IDs of related messages), space-separated |
email_reply_to | string | Reply-To header address |
email_subject | string | Email subject line |
email_to | string | Recipient email address (To header) |
id | string | The immutable ID of the draft. |
labelIds | array | List of label IDs to apply to this message. Labels are applied in the order provided. |
list_mailbox_history List Mailbox History
Retrieves the chronological history of all changes to a mailbox, including message additions, deletions, and label modifications. Results are returned in chronological order by historyId and support pagination for efficient sync operations.
| Parameter | Type | Description |
|---|---|---|
userId * | string | The user's email address. Use the special value `me` to refer to the authenticated user. |
historyTypes | array | Types of history events to include in results. When specified, only changes matching these types are returned. |
labelId | string | Filter results to only include messages with a specific label ID. |
maxResults | integer | Maximum number of history records to return per request. Defaults to 100 if not specified. |
startHistoryId | string | Starting point for retrieving history records. Provide a historyId from a previous response or message to retrieve all changes after that point. History IDs are valid for at least a week but may expir… |
list_labels List Labels
Retrieves all labels in the user's mailbox. Labels are used to organize and categorize emails in Gmail.
| Parameter | Type | Description |
|---|---|---|
userId * | string | The user's email address or the special value `me` to refer to the authenticated user. |
create_label Create Label
Creates a new custom label in Gmail for organizing messages and threads. Labels can be configured with specific visibility settings in the Gmail web interface.
| Parameter | Type | Description |
|---|---|---|
userId * | string | The user's email address or the special value `me` to indicate the authenticated user. |
labelListVisibility | string | Controls whether this label appears in the label list in Gmail's web interface. |
messageListVisibility | string | Controls whether messages with this label are visible in the message list in Gmail's web interface. |
name | string | The display name for the label as it appears in Gmail. |
type | string | The owner type for the label. User labels are created and managed by the user and can be applied to any message or thread. System labels are internally created and cannot be modified or deleted by use… |
get_label Get Label
Retrieves a specific Gmail label by its ID. Use this to fetch detailed information about a label, such as its name, visibility settings, and other metadata.
| Parameter | Type | Description |
|---|---|---|
id * | string | The unique identifier of the label to retrieve. |
userId * | string | The user's email address or the special value `me` to refer to the authenticated user. |
update_label Update Label
Updates an existing Gmail label with new properties such as display name and visibility settings. Only user-created labels can be modified; system labels cannot be changed.
| Parameter | Type | Description |
|---|---|---|
id * | string | The unique identifier of the label to update. |
userId * | string | The user's email address. Use the special value `me` to refer to the authenticated user. |
labelListVisibility | string | Controls whether the label appears in the label list in Gmail's web interface. |
messageListVisibility | string | Controls whether messages with this label are visible in the message list in Gmail's web interface. |
name | string | The display name of the label as shown to the user in Gmail. |
type | string | The owner type of the label. User labels can be modified and deleted; system labels are managed by Gmail and cannot be altered. |
update_label_partial Update Label Partial
Update properties of a Gmail label using partial update semantics. Modify visibility settings, display name, or other label attributes without replacing the entire label configuration.
| Parameter | Type | Description |
|---|---|---|
id * | string | The unique identifier of the label to update. |
userId * | string | The user's email address. Use the special value `me` to refer to the authenticated user. |
labelListVisibility | string | Controls whether this label appears in the label list within Gmail's web interface. |
messageListVisibility | string | Controls whether messages with this label are visible in the message list within Gmail's web interface. |
name | string | The human-readable name displayed for this label in the Gmail interface. |
type | string | Indicates whether this is a system label (created and managed by Gmail) or a user label (created and managed by the user). System labels cannot be modified or deleted, while user labels can be fully c… |
delete_label Delete Label
Permanently deletes a label and removes it from all messages and threads it is applied to. This action cannot be undone.
| Parameter | Type | Description |
|---|---|---|
id * | string | The unique identifier of the label to delete. |
userId * | string | The user's email address. Use the special value `me` to refer to the authenticated user. |
delete_messages_batch Delete Messages Batch
Permanently deletes multiple messages by their IDs. Note that this operation provides no guarantees about message existence or prior deletion status.
| Parameter | Type | Description |
|---|---|---|
userId * | string | The user's email address or the special value `me` to indicate the authenticated user. |
ids | array | An array of message IDs to delete. The order of IDs is not significant. |
update_message_labels_batch Update Message Labels Batch
Modifies labels on specified messages by adding and/or removing label IDs. Supports batch operations on up to 1000 messages per request.
| Parameter | Type | Description |
|---|---|---|
userId * | string | The user's email address. Use the special value `me` to refer to the authenticated user. |
addLabelIds | array | Label IDs to add to the specified messages. Order is not significant. |
ids | array | The message IDs to modify. Maximum of 1000 IDs per request. |
removeLabelIds | array | Label IDs to remove from the specified messages. Order is not significant. |
get_message Get Message
Retrieves a specific message by ID from the user's mailbox. Supports multiple output formats including full message content, headers only, or raw RFC 2822 format.
| Parameter | Type | Description |
|---|---|---|
id * | string | The ID of the message to retrieve, typically obtained from messages.list, messages.insert, or messages.import operations. |
userId * | string | The user's email address or the special value `me` to indicate the authenticated user. |
format | string | The format in which to return the message content and structure. |
metadataHeaders | array | When format is set to `metadata`, specify which message headers to include in the response. Headers should be provided as an array of header names. |
delete_message Delete Message
Permanently and immediately deletes a specified message. This action cannot be undone; consider using trash_message for recoverable deletion instead.
| Parameter | Type | Description |
|---|---|---|
id * | string | The unique identifier of the message to delete. |
userId * | string | The email address of the user whose message will be deleted. Use the special value `me` to refer to the authenticated user. |
import_message Import Message
Imports a message into the user's mailbox with standard email delivery scanning and classification. The message is processed similarly to SMTP delivery, with a maximum size limit of 150MB.
| Parameter | Type | Description |
|---|---|---|
userId * | string | The user's email address. Use the special value 'me' to reference the authenticated user. |
classificationLabelValues | array | Classification label values to apply to the message. Each classification label ID must be unique; duplicate IDs will be deduplicated arbitrarily. Only applicable for Google Workspace accounts. Availab… |
deleted | boolean | Mark the message as permanently deleted and only visible to Google Vault administrators. Only applicable for Google Workspace accounts. |
email_bcc | string | Blind carbon copy recipients (Bcc header), comma-separated |
email_body | string | Email body content (plain text or HTML) |
email_body_is_html | boolean | Whether email_body is HTML (True) or plain text (False) |
email_cc | string | Carbon copy recipients (Cc header), comma-separated |
email_from | string | Sender email address (From header) |
email_in_reply_to | string | In-Reply-To header (Message-ID of original message) |
email_references | string | References header (Message-IDs of related messages), space-separated |
email_reply_to | string | Reply-To header address |
email_subject | string | Email subject line |
email_to | string | Recipient email address (To header) |
internalDateSource | string | Determines the source for Gmail's internal date assignment to the message. |
labelIds | array | List of label IDs to apply to the imported message. Labels are applied in the order provided. |
neverMarkSpam | boolean | Prevent Gmail's spam classifier from marking this message as SPAM, regardless of its classification decision. |
processForCalendar | boolean | Automatically process calendar invitations in the message and add any extracted meetings to the user's Google Calendar. |
list_messages List Messages
Retrieves a list of messages from the user's mailbox, with optional filtering by labels and inclusion of spam/trash folders. Supports pagination through the maxResults parameter.
| Parameter | Type | Description |
|---|---|---|
userId * | string | The user's email address. Use the special value `me` to refer to the authenticated user. |
after_date | string | Filter messages after this date (YYYY/MM/DD format) |
before_date | string | Filter messages before this date (YYYY/MM/DD format) |
custom_query | string | Custom Gmail query string for advanced filters (e.g., 'rfc822msgid:<id>') |
from_address | string | Filter messages from a specific sender email address |
has_attachment | boolean | Filter messages that have attachments |
includeSpamTrash | boolean | Include messages from SPAM and TRASH folders in the results. Defaults to false if not specified. |
is_starred | boolean | Filter starred messages only |
is_unread | boolean | Filter unread messages only |
labelIds | array | Filter results to only include messages with labels matching all specified label IDs. Messages within the same thread may have different labels. Provide as an array of label ID strings. |
maxResults | integer | Maximum number of messages to return per request. Defaults to 100 if not specified. |
subject_contains | string | Filter messages with subject containing this text |
to_address | string | Filter messages to a specific recipient email address |
insert_message Insert Message
Inserts a message directly into the user's mailbox, bypassing scanning and classification, similar to IMAP APPEND. This operation does not send a message but adds it to the mailbox with optional metadata.
| Parameter | Type | Description |
|---|---|---|
userId * | string | The user's email address. Use the special value 'me' to refer to the authenticated user. |
classificationLabelValues | array | Classification label values to apply to the message. Each classification label ID must be unique; duplicate IDs will be deduplicated arbitrarily. Only applicable for Google Workspace accounts. Availab… |
deleted | boolean | Mark the message as permanently deleted and only visible to Google Vault administrators. Only applicable for Google Workspace accounts. |
email_bcc | string | Blind carbon copy recipients (Bcc header), comma-separated |
email_body | string | Email body content (plain text or HTML) |
email_body_is_html | boolean | Whether email_body is HTML (True) or plain text (False) |
email_cc | string | Carbon copy recipients (Cc header), comma-separated |
email_from | string | Sender email address (From header) |
email_in_reply_to | string | In-Reply-To header (Message-ID of original message) |
email_references | string | References header (Message-IDs of related messages), space-separated |
email_reply_to | string | Reply-To header address |
email_subject | string | Email subject line |
email_to | string | Recipient email address (To header) |
internalDateSource | string | Determines the source for Gmail's internal date assigned to the message. |
labelIds | array | List of label IDs to apply to this message. Labels are applied in the order provided. |
update_message_labels Update Message Labels
Updates the labels applied to a specific message by adding and/or removing label IDs. You can modify up to 100 labels per request.
| Parameter | Type | Description |
|---|---|---|
id * | string | The unique identifier of the message to modify. |
userId * | string | The email address of the user whose message will be modified. Use the special value `me` to refer to the authenticated user. |
addLabelIds | array | A list of label IDs to add to the message. Maximum of 100 labels can be added in a single request. |
removeLabelIds | array | A list of label IDs to remove from the message. Maximum of 100 labels can be removed in a single request. |
send_message Send Message
Sends an email message to recipients specified in the To, Cc, and Bcc headers. The message is delivered immediately to all specified recipients.
| Parameter | Type | Description |
|---|---|---|
userId * | string | The email address of the user sending the message. Use the special value `me` to refer to the authenticated user. |
classificationLabelValues | array | Classification labels to apply to the message for organizational purposes. Each classification label ID must be unique; duplicate IDs will be deduplicated arbitrarily. Only available for Google Worksp… |
email_bcc | string | Blind carbon copy recipients (Bcc header), comma-separated |
email_body | string | Email body content (plain text or HTML) |
email_body_is_html | boolean | Whether email_body is HTML (True) or plain text (False) |
email_cc | string | Carbon copy recipients (Cc header), comma-separated |
email_from | string | Sender email address (From header) |
email_in_reply_to | string | In-Reply-To header (Message-ID of original message) |
email_references | string | References header (Message-IDs of related messages), space-separated |
email_reply_to | string | Reply-To header address |
email_subject | string | Email subject line |
email_to | string | Recipient email address (To header) |
labelIds | array | IDs of labels to apply to the message. Labels help organize and categorize messages in Gmail. |
move_message_to_trash Move Message to Trash
Moves a specified message to the trash folder. The message can be restored from trash before permanent deletion.
| Parameter | Type | Description |
|---|---|---|
id * | string | The unique identifier of the message to move to trash. |
userId * | string | The user's email address or the special value `me` to reference the authenticated user. |
remove_message_from_trash Remove Message From Trash
Restores a message from the trash by removing it from the trash folder. The message will be returned to its previous labels or inbox.
| Parameter | Type | Description |
|---|---|---|
id * | string | The unique identifier of the message to restore from trash. |
userId * | string | The email address of the user whose message should be restored. Use the special value `me` to refer to the authenticated user. |
get_message_attachment Get Message Attachment
Retrieves a specific attachment from a Gmail message. Use this to download or access attachment metadata by providing the message ID and attachment ID.
| Parameter | Type | Description |
|---|---|---|
id * | string | The unique identifier of the attachment to retrieve. |
messageId * | string | The unique identifier of the message containing the attachment. |
userId * | string | The email address of the account owner. Use the special value `me` to refer to the authenticated user's account. |
get_auto_forwarding Get Auto Forwarding
Retrieves the auto-forwarding configuration for the specified Gmail account. This includes the forwarding address and whether auto-forwarding is enabled.
| Parameter | Type | Description |
|---|---|---|
userId * | string | The Gmail account identifier. Use the email address associated with the account, or use the special value "me" to refer to the authenticated user's account. |
get_vacation_settings Get Vacation Settings
Retrieves the vacation responder settings for a Gmail account, including whether auto-reply is enabled and the message content.
| Parameter | Type | Description |
|---|---|---|
userId * | string | The Gmail user account identifier. Use 'me' to refer to the authenticated user, or provide a specific email address. |
list_cse_identities List CSE Identities
Retrieves all client-side encrypted identities for an authenticated user. Administrators with domain-wide delegation can manage identities for their organization, while users managing their own identities require hardware key encryption to be enabled.
| Parameter | Type | Description |
|---|---|---|
userId * | string | The user's primary email address. Use the special value `me` to refer to the authenticated user. |
pageSize | integer | Maximum number of identities to return per page. If not specified, defaults to 20 entries. |
create_cse_identity Create CSE Identity
Creates and configures a client-side encryption identity for sending encrypted mail from a user account. The S/MIME certificate is published to a shared domain-wide directory, enabling secure communication within a Google Workspace organization.
| Parameter | Type | Description |
|---|---|---|
userId * | string | The requester's primary email address. Use the special value `me` to indicate the authenticated user. |
emailAddress | string | The email address for the sending identity. Must be the primary email address of the authenticated user. |
get_cse_identity Get CSE Identity
Retrieves a client-side encryption identity configuration for a specified email address. Administrators require service account with domain-wide delegation authority, while users require hardware key encryption to be enabled.
| Parameter | Type | Description |
|---|---|---|
cseEmailAddress * | string | The primary email address associated with the client-side encryption identity configuration to retrieve. |
userId * | string | The requester's primary email address. Use the special value `me` to refer to the authenticated user. |
delete_cse_identity Delete CSE Identity
Permanently deletes a client-side encryption identity, preventing further use for sending encrypted messages. The identity cannot be restored; create a new identity with the same configuration if needed.
| Parameter | Type | Description |
|---|---|---|
cseEmailAddress * | string | The primary email address associated with the client-side encryption identity to be deleted. |
userId * | string | The user's primary email address. Use the special value `me` to refer to the authenticated user. |
update_cse_identity_keypair Update CSE Identity Keypair
Associates a new key pair with an existing client-side encryption identity. The updated key pair must validate against Google's S/MIME certificate profiles. Requires either domain-wide delegation authority for administrators or hardware key encryption enabled for individual users.
| Parameter | Type | Description |
|---|---|---|
userId * | string | The user identifier. Use the special value `me` to refer to the authenticated user, or provide the user's primary email address. |
emailAddress | string | The email address for the sending identity. Must be the primary email address of the authenticated user. |
list_cse_keypairs List CSE Keypairs
Retrieves all client-side encryption key pairs for a user. Administrators with domain-wide delegation can manage keypairs for users in their organization, while individual users require hardware key encryption to be enabled.
| Parameter | Type | Description |
|---|---|---|
userId * | string | The user's primary email address. Use the special value `me` to refer to the authenticated user. |
pageSize | integer | Maximum number of key pairs to return per page. If not specified, defaults to 20 entries. |
create_cse_keypair Create CSE Keypair
Creates and uploads a client-side encryption S/MIME public key certificate chain and private key metadata for Gmail. Requires either domain-wide delegation authority for administrators or hardware key encryption enabled for individual users.
| Parameter | Type | Description |
|---|---|---|
userId * | string | The user's primary email address. Use the special value `me` to refer to the authenticated user. |
pkcs7 | string | The public key and its certificate chain in PKCS#7 format with PEM encoding and ASCII armor. |
privateKeyMetadata | array | An ordered array of metadata objects for instances of this key pair's private key. Order significance and item structure should follow the API specification. |
disable_cse_keypair Disable CSE Keypair
Disables a client-side encryption key pair, preventing the user from decrypting incoming CSE messages or signing outgoing CSE mail. The key pair can be re-enabled later using enable_cse_keypair, or permanently deleted after 30 days using obliterate_cse_keypair.
| Parameter | Type | Description |
|---|---|---|
keyPairId * | string | The unique identifier of the key pair to disable. |
userId * | string | The user's primary email address. Use the special value 'me' to refer to the authenticated user. |
enable_cse_keypair Enable CSE Keypair
Reactivates a previously disabled client-side encryption key pair for use with associated encryption identities. Administrators require service account with domain-wide delegation authority; end users require hardware key encryption to be enabled.
| Parameter | Type | Description |
|---|---|---|
keyPairId * | string | The unique identifier of the key pair to reactivate. |
userId * | string | The user's primary email address. Use the special value `me` to refer to the authenticated user. |
get_cse_keypair Get CSE Keypair
Retrieves a client-side encryption key pair for Gmail. Administrators require service account authorization with domain-wide delegation, while users must have hardware key encryption enabled.
| Parameter | Type | Description |
|---|---|---|
keyPairId * | string | The unique identifier of the encryption key pair to retrieve. |
userId * | string | The email address of the user whose key pair is being retrieved. Use the special value `me` to refer to the authenticated user. |
delete_cse_keypair_permanently Delete CSE Keypair Permanently
Permanently and immediately deletes a client-side encryption key pair. The key pair must be disabled for at least 30 days before obliteration. Once obliterated, all messages encrypted with this key become permanently inaccessible to all users.
| Parameter | Type | Description |
|---|---|---|
keyPairId * | string | The unique identifier of the key pair to permanently delete. |
userId * | string | The email address of the user whose key pair will be obliterated. Use the special value `me` to refer to the authenticated user. |
list_delegates List Delegates
Retrieves the list of delegates for the specified Gmail account. This operation requires service account credentials with domain-wide delegation authority.
| Parameter | Type | Description |
|---|---|---|
userId * | string | The Gmail user account identifier. Use the special value 'me' to refer to the authenticated user, or provide the user's full email address. |
get_delegate Get Delegate
Retrieves the delegate relationship for a specified email address. This operation requires service account clients with domain-wide authority and uses the delegate's primary email address (not aliases).
| Parameter | Type | Description |
|---|---|---|
delegateEmail * | string | The primary email address of the delegate whose relationship details should be retrieved. Email aliases cannot be used; the primary email address is required. |
userId * | string | The email address of the user whose delegates are being queried. Use the special value 'me' to refer to the authenticated user. |
list_filters List Filters
Retrieves all message filters configured for a Gmail account. Filters define rules for automatically organizing, labeling, or processing incoming messages.
| Parameter | Type | Description |
|---|---|---|
userId * | string | The Gmail user account identifier. Use the special value 'me' to refer to the authenticated user, or provide a specific email address. |
get_filter Get Filter
Retrieves a specific Gmail filter by its ID. Use this to fetch the configuration and rules of an existing filter.
| Parameter | Type | Description |
|---|---|---|
id * | string | The unique identifier of the filter to retrieve. |
userId * | string | The Gmail account identifier. Use 'me' to refer to the authenticated user, or provide the user's email address. |
delete_filter Delete Filter
Permanently deletes a specified Gmail filter. This action is immediate and cannot be undone.
| Parameter | Type | Description |
|---|---|---|
id * | string | The unique identifier of the filter to be deleted. |
userId * | string | The email address of the user whose filter will be deleted. Use the special value "me" to refer to the authenticated user. |
list_forwarding_addresses List Forwarding Addresses
Retrieves all forwarding addresses configured for the specified Gmail account. Forwarding addresses are alternative email addresses where incoming messages can be automatically sent.
| Parameter | Type | Description |
|---|---|---|
userId * | string | The Gmail account identifier. Use the authenticated user's email address, or specify 'me' to refer to the currently authenticated user. |
get_forwarding_address Get Forwarding Address
Retrieves the configuration details for a specified forwarding address associated with a Gmail account. Use this to view forwarding settings for a particular email address.
| Parameter | Type | Description |
|---|---|---|
forwardingEmail * | string | The email address for which forwarding configuration should be retrieved. |
userId * | string | The Gmail account identifier. Use the special value 'me' to refer to the authenticated user's account, or provide the user's full email address. |
delete_forwarding_address Delete Forwarding Address
Deletes a forwarding address and revokes any associated verification. This operation requires service account credentials with domain-wide delegation authority.
| Parameter | Type | Description |
|---|---|---|
forwardingEmail * | string | The forwarding email address to delete. |
userId * | string | The user's email address or 'me' to reference the authenticated user. |
list_send_as_aliases List Send As Aliases
Retrieves all send-as aliases configured for the specified Gmail account, including the primary email address and any custom 'from' aliases.
| Parameter | Type | Description |
|---|---|---|
userId * | string | The Gmail account identifier. Use 'me' to reference the authenticated user's account. |
get_send_as_alias Get Send As Alias
Retrieves a specific send-as alias configuration for a user. Returns an HTTP 404 error if the specified email address is not configured as a send-as alias.
| Parameter | Type | Description |
|---|---|---|
sendAsEmail * | string | The email address of the send-as alias to retrieve. |
userId * | string | The user's email address. Use the special value 'me' to refer to the authenticated user. |
update_send_as_alias Update Send As Alias
Updates a send-as alias configuration for a Gmail account, including display name, reply-to address, and optional HTML signature. Service accounts with domain-wide delegation can update non-primary addresses; standard users can only modify their own aliases.
| Parameter | Type | Description |
|---|---|---|
userId * | string | The Gmail user's email address. Use the special value 'me' to refer to the authenticated user. |
displayName | string | The display name shown in the 'From:' header for messages sent using this alias. If empty for custom addresses, Gmail will use the primary account's name. Updates to this field may be silently ignored… |
host | string | The hostname of the SMTP server used for sending mail through this alias. |
isDefault | boolean | Whether this alias is the default 'From:' address for new messages and auto-replies. Only 'true' can be written; setting this to true automatically sets the previous default address to false. Every Gm… |
password | string | The password for SMTP authentication. This write-only field is used only during creation or updates and is never returned in responses. |
port | string | The port number of the SMTP server. |
replyToAddress | string | An optional email address to include in the 'Reply-To:' header for messages sent using this alias. Leave empty to omit the 'Reply-To:' header. |
securityMode | string | The security protocol for SMTP communication. |
sendAsEmail | string | The email address displayed in the 'From:' header for messages sent using this alias. This field is read-only and cannot be modified after creation. |
signature | string | An optional HTML signature appended to new emails composed with this alias in Gmail's web interface. Gmail will sanitize the HTML before saving. |
treatAsAlias | boolean | Whether Gmail should treat this address as an alias for the user's primary email address. This setting applies only to custom 'from' aliases. |
username | string | The username for SMTP authentication. This write-only field is used only during creation or updates and is never returned in responses. |
update_send_as_alias_partial Update Send As Alias Partial
Partially update a send-as alias configuration for a Gmail account. Use this to modify display name, default status, reply-to address, signature, SMTP settings, or alias treatment without replacing the entire resource.
| Parameter | Type | Description |
|---|---|---|
userId * | string | The Gmail account identifier. Use 'me' to refer to the authenticated user, or provide a specific email address. |
displayName | string | The display name shown in the 'From:' header for messages sent using this alias. If empty, Gmail uses the primary account's name. Updates may be silently ignored if the admin has restricted name forma… |
host | string | The hostname of the SMTP server used to send mail through this alias. |
isDefault | boolean | Set to true to make this the default 'From:' address for new messages and auto-replies. Only true is a valid value for updates; setting this true automatically sets the previous default to false. |
password | string | The password for SMTP authentication. This write-only field is never returned in responses and must be provided when configuring SMTP settings. |
port | string | The port number of the SMTP server. Common values are 25, 465, or 587 depending on the security mode. |
replyToAddress | string | An optional email address to include in the 'Reply-To:' header for messages sent using this alias. Leave empty to omit the Reply-To header. |
securityMode | string | The security protocol for SMTP communication. Determines how the connection to the SMTP server is encrypted or secured. |
sendAsEmail | string | The email address displayed in the 'From:' header for messages sent using this alias. This field is read-only for updates and can only be set during alias creation. |
signature | string | An optional HTML signature appended to new emails composed with this alias in Gmail's web interface. This signature is not added to replies or forwarded messages. |
treatAsAlias | boolean | Whether Gmail should treat this address as an alias for the user's primary email address. This setting only applies to custom 'from' aliases and affects how Gmail handles replies and threading. |
username | string | The username for SMTP authentication. This write-only field is never returned in responses and must be provided when configuring SMTP settings. |
send_verification_email_to_send_as_alias Send Verification Email to Send As Alias
Sends a verification email to a send-as alias address to confirm ownership. The alias must have a pending verification status and requires service account with domain-wide delegation authority.
| Parameter | Type | Description |
|---|---|---|
sendAsEmail * | string | The send-as alias email address that requires verification. |
userId * | string | The user's email address. Use the special value 'me' to refer to the authenticated user. |
get_smime_info Get Smime Info
Retrieves the S/MIME configuration for a specified send-as alias. This allows you to access the details of a specific S/MIME certificate associated with an email alias.
| Parameter | Type | Description |
|---|---|---|
id * | string | The immutable identifier for the S/MIME configuration. |
sendAsEmail * | string | The email address that appears in the From header for messages sent using this send-as alias. |
userId * | string | The user's email address. Use the special value `me` to refer to the authenticated user. |
delete_send_as_smime_config Delete Send As Smime Config
Deletes the S/MIME configuration for a specified send-as alias. This removes the security certificate associated with the alias used for signing and encrypting outgoing emails.
| Parameter | Type | Description |
|---|---|---|
id * | string | The immutable identifier for the S/MIME configuration to delete. |
sendAsEmail * | string | The email address that appears in the From header for messages sent using this send-as alias. |
userId * | string | The user's email address. Use the special value `me` to refer to the authenticated user. |
list_smime_configs List Smime Configs
Lists all S/MIME configurations for a specified send-as alias. S/MIME configs define the certificates and encryption settings used when sending emails from this alias.
| Parameter | Type | Description |
|---|---|---|
sendAsEmail * | string | The email address configured as a send-as alias. This is the address that appears in the From header for emails sent using this alias. |
userId * | string | The user's email address. Use the special value `me` to refer to the authenticated user. |
create_smime_config Create SMIME Config
Upload and configure an S/MIME certificate for a send-as alias. The certificate must be provided in PKCS#12 format containing a private/public key pair and certificate chain.
| Parameter | Type | Description |
|---|---|---|
sendAsEmail * | string | The email address that will appear in the From header for messages sent using this S/MIME alias. |
userId * | string | The user's email address. Use the special value `me` to refer to the authenticated user. |
encryptedKeyPassword | string | Password for the encrypted private key, required if the PKCS#12 certificate is password-protected. |
expiration | string | Certificate expiration timestamp in milliseconds since epoch (Unix time). |
isDefault | boolean | Whether to set this S/MIME certificate as the default for this send-as address. |
pkcs12 | string | The S/MIME certificate in PKCS#12 format. Must contain a single private/public key pair and certificate chain. The private key may be encrypted; if so, provide the password in encryptedKeyPassword. |
set_default_smime_config Set Default Smime Config
Sets the default S/MIME configuration for the specified send-as alias. This determines which S/MIME certificate will be used by default when sending emails from this alias.
| Parameter | Type | Description |
|---|---|---|
id * | string | The immutable identifier for the S/MIME configuration to set as default. |
sendAsEmail * | string | The email address that appears in the From header for mail sent using this send-as alias. |
userId * | string | The user's email address. Use the special value `me` to refer to the authenticated user. |
get_thread Get Thread
Retrieves a specific email thread by ID. Returns thread messages in the requested format with optional filtering of metadata headers.
| Parameter | Type | Description |
|---|---|---|
id * | string | The unique identifier of the thread to retrieve. |
userId * | string | The email address of the user whose thread should be retrieved. Use the special value `me` to refer to the authenticated user. |
format | string | The format in which to return thread messages. Controls the level of detail included in the response. |
metadataHeaders | array | When format is set to metadata, specify which email headers to include in the response. Headers should be provided as an array of header names. |
delete_thread Delete Thread
Permanently deletes a thread and all messages within it. This action cannot be undone; consider using trash_thread as a safer alternative.
| Parameter | Type | Description |
|---|---|---|
id * | string | The unique identifier of the thread to delete. |
userId * | string | The email address of the user whose thread will be deleted. Use the special value `me` to refer to the authenticated user. |
list_threads List Threads
Retrieves a list of message threads from the user's mailbox, with optional filtering by labels, search query, and inclusion of spam/trash folders.
| Parameter | Type | Description |
|---|---|---|
userId * | string | The user's email address. Use the special value `me` to refer to the authenticated user. |
includeSpamTrash | boolean | Include threads from the SPAM and TRASH folders in the results. |
labelIds | array | Filter results to only return threads that have all of the specified label IDs. Provide as an array of label ID strings. |
maxResults | integer | Maximum number of threads to return in the response. |
q | string | Filter results using Gmail search query syntax (e.g., sender, subject, date filters, read status). Not supported when using the gmail.metadata scope. |
update_thread_labels Update Thread Labels
Modifies the labels applied to a thread, affecting all messages within it. Supports adding and removing labels in a single operation.
| Parameter | Type | Description |
|---|---|---|
id * | string | The ID of the thread to modify. |
userId * | string | The user's email address. Use the special value `me` to refer to the authenticated user. |
addLabelIds | array | A list of label IDs to add to this thread. Up to 100 labels can be added per request. |
removeLabelIds | array | A list of label IDs to remove from this thread. Up to 100 labels can be removed per request. |
move_thread_to_trash Move Thread to Trash
Moves a thread and all its associated messages to the trash. The thread and its messages can be permanently deleted or recovered from trash.
| Parameter | Type | Description |
|---|---|---|
id * | string | The unique identifier of the thread to move to trash. |
userId * | string | The user's email address or the special value 'me' to reference the authenticated user. |
remove_thread_from_trash Remove Thread From Trash
Restores a thread from trash by removing it and all its associated messages from the trash folder.
| Parameter | Type | Description |
|---|---|---|
id * | string | The unique identifier of the thread to restore from trash. |
userId * | string | The user's email address. Use the special value `me` to refer to the authenticated user. |