Skip to content

Gmail

Gmail is a widely used email service by Google, offering free and feature-rich communication, organization, and storage capabilities accessible through web browsers and mobile apps.

Categories: communication

Type: googleMail/v1


Connections

Version: 1

OAuth2 Authorization Code

Properties

NameLabelTypeDescriptionRequired
clientIdClient IdSTRINGtrue
clientSecretClient SecretSTRINGtrue

Actions

Add Labels

Name: addLabels

Add labels to an email in your Gmail account.

Properties

NameLabelTypeDescriptionRequired
idMessage IDSTRINGID of the message to add labelstrue
labelIdsLabelsARRAY
Items [STRING]
Labels to add to this message. You can add up to 100 labels with each update.true

Example JSON Structure

{
"label" : "Add Labels",
"name" : "addLabels",
"parameters" : {
"id" : "",
"labelIds" : [ "" ]
},
"type" : "googleMail/v1/addLabels"
}

Output

Type: OBJECT

Properties

NameTypeDescription
idSTRINGThe ID of the message.
threadIdSTRINGThe ID of the thread the message belongs to.
labelIdsARRAY
Items [STRING]
List of IDs of labels applied to this message.

Output Example

{
"id" : "",
"threadId" : "",
"labelIds" : [ "" ]
}

Delete Mail

Name: deleteMail

Delete an email from your Gmail account permanently via Id

Properties

NameLabelTypeDescriptionRequired
idMessage IDSTRINGThe ID of the message to delete.true

Example JSON Structure

{
"label" : "Delete Mail",
"name" : "deleteMail",
"parameters" : {
"id" : ""
},
"type" : "googleMail/v1/deleteMail"
}

Output

This action does not produce any output.

Get Mail

Name: getMail

Get an email from your Gmail account via Id

Properties

NameLabelTypeDescriptionRequired
idMessage IDSTRINGThe ID of the message to retrieve.true
formatFormatSTRING
Options SIMPLE, MINIMAL, FULL, RAW, metadata
The format to return the message in.false
metadataHeadersMetadata headersARRAY
Items [STRING]
When given and format is METADATA, only include headers specified.false

Example JSON Structure

{
"label" : "Get Mail",
"name" : "getMail",
"parameters" : {
"id" : "",
"format" : "",
"metadataHeaders" : [ "" ]
},
"type" : "googleMail/v1/getMail"
}

Output

The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.

Get Thread

Name: getThread

Gets the specified thread.

Properties

NameLabelTypeDescriptionRequired
idThread IDSTRINGThe ID of the thread to retrieve.true
formatFormatSTRING
Options SIMPLE, MINIMAL, FULL, RAW, metadata
The format to return the message in.false
metadataHeadersMetadata headersARRAY
Items [STRING]
When given and format is METADATA, only include headers specified.false

Example JSON Structure

{
"label" : "Get Thread",
"name" : "getThread",
"parameters" : {
"id" : "",
"format" : "",
"metadataHeaders" : [ "" ]
},
"type" : "googleMail/v1/getThread"
}

Output

The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.

Reply to Email

Name: replyToEmail

Send a reply to an email message.

Properties

NameLabelTypeDescriptionRequired
idMessage IDSTRINGThe ID of the message to reply to.true
toToARRAY
Items [STRING]
Recipients email addresses.true
bccBccARRAY
Items [STRING]
Bcc recipients email addresses.false
ccCcARRAY
Items [STRING]
Cc recipients email addresses.false
bodyBodySTRINGBody text of the emailtrue
attachmentsAttachmentsARRAY
Items [FILE_ENTRY]
A list of attachments to send with the email.null

Example JSON Structure

{
"label" : "Reply to Email",
"name" : "replyToEmail",
"parameters" : {
"id" : "",
"to" : [ "" ],
"bcc" : [ "" ],
"cc" : [ "" ],
"body" : "",
"attachments" : [ {
"extension" : "",
"mimeType" : "",
"name" : "",
"url" : ""
} ]
},
"type" : "googleMail/v1/replyToEmail"
}

Output

Type: OBJECT

Properties

NameTypeDescription
idSTRINGThe ID of the message.
threadIdSTRINGThe ID of the thread the message belongs to.
labelIdsARRAY
Items [STRING]
List of IDs of labels applied to this message.

Output Example

{
"id" : "",
"threadId" : "",
"labelIds" : [ "" ]
}

Search Email

Name: searchEmail

Lists the messages in the user’s mailbox.

Properties

NameLabelTypeDescriptionRequired
maxResultsMax ResultsNUMBERMaximum number of messages to return.false
pageTokenPage TokenSTRINGPage token to retrieve a specific page of results in the list.false
fromFromSTRINGThe address sending the mailfalse
toToSTRINGThe address receiving the new mailfalse
subjectSubjectSTRINGWords in the subject linefalse
categoryCategorySTRING
Options primary, social, promotions, updates, forums, reservations, purchases
Messages in a certain categoryfalse
labelIdsLabelsARRAY
Items [STRING]
Only return messages with labels that match all of the specified label IDs. Messages in a thread might have labels that other messages in the same thread don’t have.false
includeSpamTrashInclude Spam TrashBOOLEAN
Options true, false
Include messages from SPAM and TRASH in the results.false

Example JSON Structure

{
"label" : "Search Email",
"name" : "searchEmail",
"parameters" : {
"maxResults" : 0.0,
"pageToken" : "",
"from" : "",
"to" : "",
"subject" : "",
"category" : "",
"labelIds" : [ "" ],
"includeSpamTrash" : false
},
"type" : "googleMail/v1/searchEmail"
}

Output

Type: OBJECT

Properties

NameTypeDescription
messagesARRAY
Items [{STRING(id), STRING(threadId)}]
nextPageTokenSTRING
resultSizeEstimateNUMBEREstimated number of messages.

Output Example

{
"messages" : [ {
"id" : "",
"threadId" : ""
} ],
"nextPageToken" : "",
"resultSizeEstimate" : 0.0
}

Send Email

Name: sendEmail

Sends the specified message to the recipients in the To, Cc, and Bcc headers.

Properties

NameLabelTypeDescriptionRequired
toToARRAY
Items [STRING]
Recipients email addresses.true
subjectSubjectSTRINGSubject of the email.true
bccBccARRAY
Items [STRING]
Bcc recipients email addresses.false
ccCcARRAY
Items [STRING]
Cc recipients email addresses.false
replyToReply ToARRAY
Items [STRING]
Reply-to email addresses.false
bodyBodySTRINGBody text of the emailtrue
attachmentsAttachmentsARRAY
Items [FILE_ENTRY]
A list of attachments to send with the email.null

Example JSON Structure

{
"label" : "Send Email",
"name" : "sendEmail",
"parameters" : {
"to" : [ "" ],
"subject" : "",
"bcc" : [ "" ],
"cc" : [ "" ],
"replyTo" : [ "" ],
"body" : "",
"attachments" : [ {
"extension" : "",
"mimeType" : "",
"name" : "",
"url" : ""
} ]
},
"type" : "googleMail/v1/sendEmail"
}

Output

Type: OBJECT

Properties

NameTypeDescription
idSTRINGThe ID of the message.
threadIdSTRINGThe ID of the thread the message belongs to.
labelIdsARRAY
Items [STRING]
List of IDs of labels applied to this message.

Output Example

{
"id" : "",
"threadId" : "",
"labelIds" : [ "" ]
}

Triggers

New Email

Name: newEmail

Triggers when new mail is found in your Gmail inbox.

Type: STATIC_WEBHOOK

Properties

NameLabelTypeDescriptionRequired
topicNameTopic NameSTRINGMust be 3-255 characters, start with a letter, and contain only the following characters: letters, numbers, dashes (-), periods (.), underscores (_), tildes (~), percents (%) or plus signs (+). Cannot start with goog.true
formatFormatSTRING
Options SIMPLE, MINIMAL, FULL, RAW, metadata
The format to return the message in.false

Output

The output for this action is dynamic and may vary depending on the input parameters. To determine the exact structure of the output, you need to execute the action.

JSON Example

{
"label" : "New Email",
"name" : "newEmail",
"parameters" : {
"topicName" : "",
"format" : ""
},
"type" : "googleMail/v1/newEmail"
}

New Email Polling

Name: newEmailPolling

Periodically checks your Gmail inbox for any new incoming emails.

Type: POLLING

Output

Type: ARRAY

Items Type: OBJECT

Properties

NameTypeDescription
idSTRINGID of the message.
threadIdSTRINGThe ID of the thread the message belongs to.

JSON Example

{
"label" : "New Email Polling",
"name" : "newEmailPolling",
"type" : "googleMail/v1/newEmailPolling"
}


Additional instructions


anl-c-google-mail-md

CONNECTION

Setting up OAuth2

Turning on Gmail API