Gmail
Read and send emails with Gmail.
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:
| Action | Purpose | Parameters |
|---|---|---|
| users_get_profile | Gets the current user's Gmail profile. | userId (string) required |
| users_watch | Set up or update a push notification watch on the given user mailbox. | userId (string) required labelIds (array) labelFilterAction (string) labelFilterBehavior (string) topicName (string) |
| users_stop | Stop receiving push notifications for the given user mailbox. | userId (string) required |
| drafts_delete | Immediately and permanently deletes the specified draft. Does not simply trash it. | userId (string) required id (string) required |
| drafts_create | Creates 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_get | Gets the specified draft. | userId (string) required id (string) required format (string) |
| drafts_list | Lists the drafts in the user's mailbox. | userId (string) required maxResults (integer) pageToken (string) q (string) includeSpamTrash (boolean) |
| drafts_send | Sends 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_update | Replaces 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_list | Lists 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_trash | Moves the specified message to the trash. | userId (string) required id (string) required |
| messages_untrash | Removes the specified message from the trash. | userId (string) required id (string) required |
| messages_delete | Immediately and permanently deletes the specified message. This operation cannot be undone. Prefer messages.trash instead. | userId (string) required id (string) required |
| messages_batch_delete | Deletes 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_import | Imports 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_insert | Directly 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_get | Gets the specified message. | userId (string) required id (string) required format (string) metadataHeaders (string) |
| messages_send | Sends 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_list | Lists 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_modify | Modifies the labels on the specified message. | userId (string) required id (string) required addLabelIds (array) removeLabelIds (array) |
| messages_batch_modify | Modifies the labels on the specified messages. | userId (string) required ids (array) addLabelIds (array) removeLabelIds (array) |
| attachments_get | Gets the specified message attachment. | userId (string) required messageId (string) required id (string) required |
| labels_create | Creates 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_delete | Immediately 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_get | Gets the specified label. | userId (string) required id (string) required |
| labels_list | Lists all labels in the user's mailbox. | userId (string) required |
| labels_update | Updates 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_patch | Patch 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_trash | Moves 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_untrash | Removes 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_delete | Immediately 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_get | Gets the specified thread. | userId (string) required id (string) required format (string) metadataHeaders (string) |
| threads_list | Lists the threads in the user's mailbox. | userId (string) required maxResults (integer) pageToken (string) q (string) labelIds (string) includeSpamTrash (boolean) |
| threads_modify | Modifies 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_imap | Gets IMAP settings. | userId (string) required |
| settings_update_imap | Updates IMAP settings. | userId (string) required enabled (boolean) autoExpunge (boolean) expungeBehavior (string) maxFolderSize (integer) |
| settings_get_pop | Gets POP settings. | userId (string) required |
| settings_update_pop | Updates POP settings. | userId (string) required accessWindow (string) disposition (string) |
| settings_get_vacation | Gets vacation responder settings. | userId (string) required |
| settings_update_vacation | Updates vacation responder settings. | userId (string) required enableAutoReply (boolean) responseSubject (string) responseBodyPlainText (string) responseBodyHtml (string) restrictToContacts (boolean) restrictToDomain (boolean) startTime (string) endTime (string) |
| settings_get_language | Gets language settings. | userId (string) required |
| settings_update_language | Updates 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_forwarding | Gets the auto-forwarding setting for the specified account. | userId (string) required |
| settings_update_auto_forwarding | Updates 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_list | Lists 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_get | Gets 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_create | Creates 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 the | userId (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_update | Updates 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_patch | Patch 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_delete | Deletes 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_verify | Sends 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_list | Lists S/MIME configs for the specified send-as alias. | userId (string) required sendAsEmail (string) required |
| smime_info_get | Gets the specified S/MIME config for the specified send-as alias. | userId (string) required sendAsEmail (string) required id (string) required |
| smime_info_insert | Insert 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_delete | Deletes the specified S/MIME config for the specified send-as alias. | userId (string) required sendAsEmail (string) required id (string) required |
| smime_info_set_default | Sets the default S/MIME config for the specified send-as alias. | userId (string) required sendAsEmail (string) required id (string) required |
| identities_create | Creates 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 d | userId (string) required emailAddress (string) primaryKeyPairId (string) signAndEncryptKeyPairs: { . signingKeyPairId (string) . encryptionKeyPairId (string) } (object) |
| identities_delete | Deletes 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_get | Retrieves 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 ma | userId (string) required cseEmailAddress (string) required |
| identities_list | Lists 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. F | userId (string) required pageToken (string) pageSize (integer) |
| identities_patch | Associates 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/protoc | userId (string) required emailAddress (string) required primaryKeyPairId (string) signAndEncryptKeyPairs: { . signingKeyPairId (string) . encryptionKeyPairId (string) } (object) |
| keypairs_create | Creates 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 t | userId (string) required keyPairId (string) pkcs7 (string) pem (string) subjectEmailAddresses (array) enablementState (string) disableTime (string) privateKeyMetadata (array) |
| keypairs_disable | Turns 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/ide | userId (string) required keyPairId (string) required |
| keypairs_enable | Turns 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 impers | userId (string) required keyPairId (string) required |
| keypairs_get | Retrieves 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 managi | userId (string) required keyPairId (string) required |
| keypairs_list | Lists 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 u | userId (string) required pageToken (string) pageSize (integer) |
| keypairs_obliterate | Deletes 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, reque | userId (string) required keyPairId (string) required |
| filters_list | Lists the message filters of a Gmail user. | userId (string) required |
| filters_get | Gets a filter. | userId (string) required id (string) required |
| filters_create | Creates 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_delete | Immediately and permanently deletes the specified filter. | userId (string) required id (string) required |
| forwarding_addresses_list | Lists the forwarding addresses for the specified account. | userId (string) required |
| forwarding_addresses_get | Gets the specified forwarding address. | userId (string) required forwardingEmail (string) required |
| forwarding_addresses_create | Creates 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_delete | Deletes 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_list | Lists 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_get | Gets 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_create | Adds 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 to | userId (string) required delegateEmail (string) verificationStatus (string) |
| delegates_delete | Removes 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 |