Skip to main content

Search email in Gmail

Search your email in Gmail.

Query documentation: https://support.google.com/mail/answer/7190

Application

  • Google Gmail

Inputs (what you have)

NameDescriptionData TypeRequired?Example
Gmail credentialsThe connected account to use for the requestConnected AccountYes
QueryOnly return messages matching the specified query. Supports the same query format as the Gmail search box. Example: from:someuser@example.com rfc822msgid:is:unreadText (Long)Yesfrom:someuser@example.com rfc822msgid:is:unread
Email addressThe Email address you would like to search in. Defaults to ‘me’. Example: support@wrk.comEmailNosupport@wrk.com
Maximum number of resultsDefault: 100NumberNo10
Label IDsList of IDs of labels to search by. Example: sent, importantText (Long)Nosent, important
Include spam and trash?Indicates if the spam and trash folders should be included in the searchTrue/FalseNo

List of the correct query documentation: https://support.google.com/mail/answer/7190

Search and filter differences: Gmail UI versus Gmail API

  • The Gmail UI performs alias expansion which allows it to infer an account alias from a Google Workspace account. For example, suppose you have an account of myprimary@mycompany.net and your admin sets up an alias for that account of myalias@mycompany.net. If myalias@mycompany.net sends an email, but you search for "from: myprimary@mycompany.net)" the email sent by myalias@mycompany.net shows up as a search result the Gmail UI, but not in the API response.
  • The Gmail UI allows users to perform thread-wide searches, but the API doesn't.

Outputs (what you get)

NameDescriptionData TypeRequired?Example
Number of emails returnedNumberNo
gmailSearchEmailMessageResultsList of undefinedNo

Outcomes

NameDescription
SuccessThis status is selected if the job has successfully completed.
No resultThis status is selected if the job has successfully completed but no result was produced.

Requirements

  • N/A