Skip to main content

Gmail

Read and send emails with Gmail.

Gmail Logo

Authentication

This connector uses OAuth 2.0 authentication.

info

Set up your connection in the Abstra Console before using it in your workflows.

How to use

Using the Smart Chat

Execute the action "CHOOSE_ONE_ACTION_BELOW" from my connector "YOUR_CONNECTOR_NAME" using the params "PARAMS_HERE".

Using the Web Editor

from abstra.connectors import run_connection_action

result = run_connection_action(
connection_name="your_connection_name",
action_name="your_action_name",
params={
"param1": "value1",
"param2": "value2"
})

Available Actions

This connector provides 79 actions:

ActionPurposeParameters
users_get_profileGets the current user's Gmail profile.userId (string) required
users_watchSet up or update a push notification watch on the given user mailbox.userId (string) required
labelIds (array)
labelFilterAction (string)
labelFilterBehavior (string)
topicName (string)
users_stopStop receiving push notifications for the given user mailbox.userId (string) required
drafts_deleteImmediately and permanently deletes the specified draft. Does not simply trash it.userId (string) required
id (string) required
drafts_createCreates a new draft with the DRAFT label.userId (string) required
id (string)
message: {
. id (string)
. threadId (string)
. labelIds (array)
. snippet (string)
. historyId (string)
. internalDate (string)
. payload (object)
. sizeEstimate (integer)
. raw (string)
} (object)
drafts_getGets the specified draft.userId (string) required
id (string) required
format (string)
drafts_listLists the drafts in the user's mailbox.userId (string) required
maxResults (integer)
pageToken (string)
q (string)
includeSpamTrash (boolean)
drafts_sendSends the specified, existing draft to the recipients in the To, Cc, and Bcc headers.userId (string) required
id (string)
message: {
. id (string)
. threadId (string)
. labelIds (array)
. snippet (string)
. historyId (string)
. internalDate (string)
. payload (object)
. sizeEstimate (integer)
. raw (string)
} (object)
drafts_updateReplaces a draft's content.userId (string) required
id (string) required
message: {
. id (string)
. threadId (string)
. labelIds (array)
. snippet (string)
. historyId (string)
. internalDate (string)
. payload (object)
. sizeEstimate (integer)
. raw (string)
} (object)
history_listLists the history of all changes to the given mailbox. History results are returned in chronological order increasing historyId.userId (string) required
maxResults (integer)
pageToken (string)
startHistoryId (string)
labelId (string)
historyTypes (string)
messages_trashMoves the specified message to the trash.userId (string) required
id (string) required
messages_untrashRemoves the specified message from the trash.userId (string) required
id (string) required
messages_deleteImmediately and permanently deletes the specified message. This operation cannot be undone. Prefer messages.trash instead.userId (string) required
id (string) required
messages_batch_deleteDeletes many messages by message ID. Provides no guarantees that messages were not already deleted or even existed at all.userId (string) required
ids (array)
messages_importImports a message into only this user's mailbox, with standard email delivery scanning and classification similar to receiving via SMTP. This method doesn't perform SPF checks, so it might not work for some spam messages, such as those attempting to perform domain spoofing. This method does not send a message.userId (string) required
internalDateSource (string)
neverMarkSpam (boolean)
processForCalendar (boolean)
deleted (boolean)
id (string)
threadId (string)
labelIds (array)
snippet (string)
historyId (string)
internalDate (string)
payload: {
. partId (string)
. mimeType (string)
. filename (string)
. headers (array)
. body (object)
. parts (array)
} (object)
sizeEstimate (integer)
raw (string)
messages_insertDirectly inserts a message into only this user's mailbox similar to IMAP APPEND, bypassing most scanning and classification. Does not send a message.userId (string) required
internalDateSource (string)
deleted (boolean)
id (string)
threadId (string)
labelIds (array)
snippet (string)
historyId (string)
internalDate (string)
payload: {
. partId (string)
. mimeType (string)
. filename (string)
. headers (array)
. body (object)
. parts (array)
} (object)
sizeEstimate (integer)
raw (string)
messages_getGets the specified message.userId (string) required
id (string) required
format (string)
metadataHeaders (string)
messages_sendSends the specified message to the recipients in the To, Cc, and Bcc headers. For example usage, see Sending emailhttps://developers.google.com/workspace/gmail/api/guides/sending.userId (string) required
id (string)
threadId (string)
labelIds (array)
snippet (string)
historyId (string)
internalDate (string)
payload: {
. partId (string)
. mimeType (string)
. filename (string)
. headers (array)
. body (object)
. parts (array)
} (object)
sizeEstimate (integer)
raw (string)
messages_listLists the messages in the user's mailbox. For example usage, see List Gmail messageshttps://developers.google.com/workspace/gmail/api/guides/list-messages.userId (string) required
maxResults (integer)
pageToken (string)
q (string)
labelIds (string)
includeSpamTrash (boolean)
messages_modifyModifies the labels on the specified message.userId (string) required
id (string) required
addLabelIds (array)
removeLabelIds (array)
messages_batch_modifyModifies the labels on the specified messages.userId (string) required
ids (array)
addLabelIds (array)
removeLabelIds (array)
attachments_getGets the specified message attachment.userId (string) required
messageId (string) required
id (string) required
labels_createCreates a new label.userId (string) required
id (string)
name (string)
messageListVisibility (string)
labelListVisibility (string)
type (string)
messagesTotal (integer)
messagesUnread (integer)
threadsTotal (integer)
threadsUnread (integer)
color: {
. textColor (string)
. backgroundColor (string)
} (object)
labels_deleteImmediately and permanently deletes the specified label and removes it from any messages and threads that it is applied to.userId (string) required
id (string) required
labels_getGets the specified label.userId (string) required
id (string) required
labels_listLists all labels in the user's mailbox.userId (string) required
labels_updateUpdates the specified label.userId (string) required
id (string) required
name (string)
messageListVisibility (string)
labelListVisibility (string)
type (string)
messagesTotal (integer)
messagesUnread (integer)
threadsTotal (integer)
threadsUnread (integer)
color: {
. textColor (string)
. backgroundColor (string)
} (object)
labels_patchPatch the specified label.userId (string) required
id (string) required
name (string)
messageListVisibility (string)
labelListVisibility (string)
type (string)
messagesTotal (integer)
messagesUnread (integer)
threadsTotal (integer)
threadsUnread (integer)
color: {
. textColor (string)
. backgroundColor (string)
} (object)
threads_trashMoves the specified thread to the trash. Any messages that belong to the thread are also moved to the trash.userId (string) required
id (string) required
threads_untrashRemoves the specified thread from the trash. Any messages that belong to the thread are also removed from the trash.userId (string) required
id (string) required
threads_deleteImmediately and permanently deletes the specified thread. Any messages that belong to the thread are also deleted. This operation cannot be undone. Prefer threads.trash instead.userId (string) required
id (string) required
threads_getGets the specified thread.userId (string) required
id (string) required
format (string)
metadataHeaders (string)
threads_listLists the threads in the user's mailbox.userId (string) required
maxResults (integer)
pageToken (string)
q (string)
labelIds (string)
includeSpamTrash (boolean)
threads_modifyModifies the labels applied to the thread. This applies to all messages in the thread.userId (string) required
id (string) required
addLabelIds (array)
removeLabelIds (array)
settings_get_imapGets IMAP settings.userId (string) required
settings_update_imapUpdates IMAP settings.userId (string) required
enabled (boolean)
autoExpunge (boolean)
expungeBehavior (string)
maxFolderSize (integer)
settings_get_popGets POP settings.userId (string) required
settings_update_popUpdates POP settings.userId (string) required
accessWindow (string)
disposition (string)
settings_get_vacationGets vacation responder settings.userId (string) required
settings_update_vacationUpdates vacation responder settings.userId (string) required
enableAutoReply (boolean)
responseSubject (string)
responseBodyPlainText (string)
responseBodyHtml (string)
restrictToContacts (boolean)
restrictToDomain (boolean)
startTime (string)
endTime (string)
settings_get_languageGets language settings.userId (string) required
settings_update_languageUpdates language settings. If successful, the return object contains the displayLanguage that was saved for the user, which may differ from the value passed into the request. This is because the requested displayLanguage may not be directly supported by Gmail but have a close variant that is, and so the variant may be chosen and saved instead.userId (string) required
displayLanguage (string)
settings_get_auto_forwardingGets the auto-forwarding setting for the specified account.userId (string) required
settings_update_auto_forwardingUpdates the auto-forwarding setting for the specified account. A verified forwarding address must be specified when auto-forwarding is enabled. This method is only available to service account clients that have been delegated domain-wide authority.userId (string) required
enabled (boolean)
emailAddress (string)
disposition (string)
send_as_listLists the send-as aliases for the specified account. The result includes the primary send-as address associated with the account as well as any custom 'from' aliases.userId (string) required
send_as_getGets the specified send-as alias. Fails with an HTTP 404 error if the specified address is not a member of the collection.userId (string) required
sendAsEmail (string) required
send_as_createCreates a custom 'from' send-as alias. If an SMTP MSA is specified, Gmail will attempt to connect to the SMTP service to validate the configuration before creating the alias. If ownership verification is required for the alias, a message will be sent to the email address and the resource's verification status will be set to pending; otherwise, the resource will be created with verification status set to accepted. If a signature is provided, Gmail will sanitize the HTML before saving it with theuserId (string) required
sendAsEmail (string)
displayName (string)
replyToAddress (string)
signature (string)
isPrimary (boolean)
isDefault (boolean)
treatAsAlias (boolean)
smtpMsa: {
. host (string)
. port (integer)
. username (string)
. password (string)
. securityMode (string)
} (object)
verificationStatus (string)
send_as_updateUpdates a send-as alias. If a signature is provided, Gmail will sanitize the HTML before saving it with the alias. Addresses other than the primary address for the account can only be updated by service account clients that have been delegated domain-wide authority.userId (string) required
sendAsEmail (string) required
displayName (string)
replyToAddress (string)
signature (string)
isPrimary (boolean)
isDefault (boolean)
treatAsAlias (boolean)
smtpMsa: {
. host (string)
. port (integer)
. username (string)
. password (string)
. securityMode (string)
} (object)
verificationStatus (string)
send_as_patchPatch the specified send-as alias.userId (string) required
sendAsEmail (string) required
displayName (string)
replyToAddress (string)
signature (string)
isPrimary (boolean)
isDefault (boolean)
treatAsAlias (boolean)
smtpMsa: {
. host (string)
. port (integer)
. username (string)
. password (string)
. securityMode (string)
} (object)
verificationStatus (string)
send_as_deleteDeletes the specified send-as alias. Revokes any verification that may have been required for using it. This method is only available to service account clients that have been delegated domain-wide authority.userId (string) required
sendAsEmail (string) required
send_as_verifySends a verification email to the specified send-as alias address. The verification status must be pending. This method is only available to service account clients that have been delegated domain-wide authority.userId (string) required
sendAsEmail (string) required
smime_info_listLists S/MIME configs for the specified send-as alias.userId (string) required
sendAsEmail (string) required
smime_info_getGets the specified S/MIME config for the specified send-as alias.userId (string) required
sendAsEmail (string) required
id (string) required
smime_info_insertInsert upload the given S/MIME config for the specified send-as alias. Note that pkcs12 format is required for the key.userId (string) required
sendAsEmail (string) required
id (string)
issuerCn (string)
isDefault (boolean)
expiration (string)
pem (string)
pkcs12 (string)
encryptedKeyPassword (string)
smime_info_deleteDeletes the specified S/MIME config for the specified send-as alias.userId (string) required
sendAsEmail (string) required
id (string) required
smime_info_set_defaultSets the default S/MIME config for the specified send-as alias.userId (string) required
sendAsEmail (string) required
id (string) required
identities_createCreates and configures a client-side encryption identity that's authorized to send mail from the user account. Google publishes the S/MIME certificate to a shared domain-wide directory so that people within a Google Workspace organization can encrypt and send mail to the identity. For administrators managing identities and keypairs for users in their organization, requests require authorization with a service accounthttps://developers.google.com/identity/protocols/OAuth2ServiceAccount that has duserId (string) required
emailAddress (string)
primaryKeyPairId (string)
signAndEncryptKeyPairs: {
. signingKeyPairId (string)
. encryptionKeyPairId (string)
} (object)
identities_deleteDeletes a client-side encryption identity. The authenticated user can no longer use the identity to send encrypted messages. You cannot restore the identity after you delete it. Instead, use the CreateCseIdentity method to create another identity with the same configuration. For administrators managing identities and keypairs for users in their organization, requests require authorization with a service accounthttps://developers.google.com/identity/protocols/OAuth2ServiceAccount that has domain-userId (string) required
cseEmailAddress (string) required
identities_getRetrieves a client-side encryption identity configuration. For administrators managing identities and keypairs for users in their organization, requests require authorization with a service accounthttps://developers.google.com/identity/protocols/OAuth2ServiceAccount that has domain-wide delegation authorityhttps://developers.google.com/identity/protocols/OAuth2ServiceAccount delegatingauthority to impersonate users with the https://www.googleapis.com/auth/gmail.settings.basic scope. For users mauserId (string) required
cseEmailAddress (string) required
identities_listLists the client-side encrypted identities for an authenticated user. For administrators managing identities and keypairs for users in their organization, requests require authorization with a service accounthttps://developers.google.com/identity/protocols/OAuth2ServiceAccount that has domain-wide delegation authorityhttps://developers.google.com/identity/protocols/OAuth2ServiceAccount delegatingauthority to impersonate users with the https://www.googleapis.com/auth/gmail.settings.basic scope. FuserId (string) required
pageToken (string)
pageSize (integer)
identities_patchAssociates a different key pair with an existing client-side encryption identity. The updated key pair must validate against Google's S/MIME certificate profileshttps://support.google.com/a/answer/7300887. For administrators managing identities and keypairs for users in their organization, requests require authorization with a service accounthttps://developers.google.com/identity/protocols/OAuth2ServiceAccount that has domain-wide delegation authorityhttps://developers.google.com/identity/protocuserId (string) required
emailAddress (string) required
primaryKeyPairId (string)
signAndEncryptKeyPairs: {
. signingKeyPairId (string)
. encryptionKeyPairId (string)
} (object)
keypairs_createCreates and uploads a client-side encryption S/MIME public key certificate chain and private key metadata for the authenticated user. For administrators managing identities and keypairs for users in their organization, requests require authorization with a service accounthttps://developers.google.com/identity/protocols/OAuth2ServiceAccount that has domain-wide delegation authorityhttps://developers.google.com/identity/protocols/OAuth2ServiceAccount delegatingauthority to impersonate users with tuserId (string) required
keyPairId (string)
pkcs7 (string)
pem (string)
subjectEmailAddresses (array)
enablementState (string)
disableTime (string)
privateKeyMetadata (array)
keypairs_disableTurns off a client-side encryption key pair. The authenticated user can no longer use the key pair to decrypt incoming CSE message texts or sign outgoing CSE mail. To regain access, use the EnableCseKeyPair to turn on the key pair. After 30 days, you can permanently delete the key pair by using the ObliterateCseKeyPair method. For administrators managing identities and keypairs for users in their organization, requests require authorization with a service accounthttps://developers.google.com/ideuserId (string) required
keyPairId (string) required
keypairs_enableTurns on a client-side encryption key pair that was turned off. The key pair becomes active again for any associated client-side encryption identities. For administrators managing identities and keypairs for users in their organization, requests require authorization with a service accounthttps://developers.google.com/identity/protocols/OAuth2ServiceAccount that has domain-wide delegation authorityhttps://developers.google.com/identity/protocols/OAuth2ServiceAccount delegatingauthority to impersuserId (string) required
keyPairId (string) required
keypairs_getRetrieves an existing client-side encryption key pair. For administrators managing identities and keypairs for users in their organization, requests require authorization with a service accounthttps://developers.google.com/identity/protocols/OAuth2ServiceAccount that has domain-wide delegation authorityhttps://developers.google.com/identity/protocols/OAuth2ServiceAccount delegatingauthority to impersonate users with the https://www.googleapis.com/auth/gmail.settings.basic scope. For users managiuserId (string) required
keyPairId (string) required
keypairs_listLists client-side encryption key pairs for an authenticated user. For administrators managing identities and keypairs for users in their organization, requests require authorization with a service accounthttps://developers.google.com/identity/protocols/OAuth2ServiceAccount that has domain-wide delegation authorityhttps://developers.google.com/identity/protocols/OAuth2ServiceAccount delegatingauthority to impersonate users with the https://www.googleapis.com/auth/gmail.settings.basic scope. For uuserId (string) required
pageToken (string)
pageSize (integer)
keypairs_obliterateDeletes a client-side encryption key pair permanently and immediately. You can only permanently delete key pairs that have been turned off for more than 30 days. To turn off a key pair, use the DisableCseKeyPair method. Gmail can't restore or decrypt any messages that were encrypted by an obliterated key. Authenticated users and Google Workspace administrators lose access to reading the encrypted messages. For administrators managing identities and keypairs for users in their organization, requeuserId (string) required
keyPairId (string) required
filters_listLists the message filters of a Gmail user.userId (string) required
filters_getGets a filter.userId (string) required
id (string) required
filters_createCreates a filter. Note: you can only create a maximum of 1,000 filters.userId (string) required
id (string)
criteria: {
. from (string)
. to (string)
. subject (string)
. query (string)
. negatedQuery (string)
. hasAttachment (boolean)
. excludeChats (boolean)
. size (integer)
. sizeComparison (string)
} (object)
action: {
. addLabelIds (array)
. removeLabelIds (array)
. forward (string)
} (object)
filters_deleteImmediately and permanently deletes the specified filter.userId (string) required
id (string) required
forwarding_addresses_listLists the forwarding addresses for the specified account.userId (string) required
forwarding_addresses_getGets the specified forwarding address.userId (string) required
forwardingEmail (string) required
forwarding_addresses_createCreates a forwarding address. If ownership verification is required, a message will be sent to the recipient and the resource's verification status will be set to pending; otherwise, the resource will be created with verification status set to accepted. This method is only available to service account clients that have been delegated domain-wide authority.userId (string) required
forwardingEmail (string)
verificationStatus (string)
forwarding_addresses_deleteDeletes the specified forwarding address and revokes any verification that may have been required. This method is only available to service account clients that have been delegated domain-wide authority.userId (string) required
forwardingEmail (string) required
delegates_listLists the delegates for the specified account. This method is only available to service account clients that have been delegated domain-wide authority.userId (string) required
delegates_getGets the specified delegate. Note that a delegate user must be referred to by their primary email address, and not an email alias. This method is only available to service account clients that have been delegated domain-wide authority.userId (string) required
delegateEmail (string) required
delegates_createAdds a delegate with its verification status set directly to accepted, without sending any verification email. The delegate user must be a member of the same Google Workspace organization as the delegator user. Gmail imposes limitations on the number of delegates and delegators each user in a Google Workspace organization can have. These limits depend on your organization, but in general each user can have up to 25 delegates and up to 10 delegators. Note that a delegate user must be referred touserId (string) required
delegateEmail (string)
verificationStatus (string)
delegates_deleteRemoves the specified delegate which can be of any verification status, and revokes any verification that may have been required for using it. Note that a delegate user must be referred to by their primary email address, and not an email alias. This method is only available to service account clients that have been delegated domain-wide authority.userId (string) required
delegateEmail (string) required