List

Lists the threads in the user's mailbox

6 variables
16 variables

Lists the threads in the user's mailbox

Authorization

To use this building block you will have to grant access to at least one of the following scopes:

  • Read, compose, send, and permanently delete all your email from Gmail
  • View your email message metadata such as labels and headers, but not the email body
  • View and modify but not delete your email
  • View your email messages and settings

Input

This building block consumes 6 input parameters

  = Parameter name
  = Format

userId STRING Required

The user's email address. The special value me can be used to indicate the authenticated user

includeSpamTrash BOOLEAN

Include threads from SPAM and TRASH in the results

labelIds STRING

Only return threads with labels that match all of the specified label IDs

maxResults INTEGER

Maximum number of threads to return

pageToken STRING

Page token to retrieve a specific page of results in the list

q STRING

Only return threads matching the specified query. Supports the same query format as the Gmail search box. For example, "from:[email protected] rfc822msgid: is:unread". Parameter cannot be used when accessing the api using the gmail.metadata scope

Output

This building block provides 16 output parameters

  = Parameter name
  = Format

nextPageToken STRING

Page token to retrieve the next page of results in the list

resultSizeEstimate INTEGER

Estimated total number of results

threads[] OBJECT

A collection of messages representing a conversation

threads[].historyId INTEGER

The ID of the last history record that modified this thread

threads[].id STRING

The unique ID of the thread

threads[].messages[] OBJECT

An email message

threads[].messages[].historyId INTEGER

The ID of the last history record that modified this message

threads[].messages[].id STRING

The immutable ID of the message

threads[].messages[].internalDate INTEGER

The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header

threads[].messages[].labelIds[] STRING

threads[].messages[].payload OBJECT

A single MIME message part

threads[].messages[].raw BINARY

The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied

threads[].messages[].sizeEstimate INTEGER

Estimated size in bytes of the message

threads[].messages[].snippet STRING

A short part of the message text

threads[].messages[].threadId STRING

The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met:

  • The requested threadId must be specified on the Message or Draft.Message you supply with your request.
  • The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard.
  • The Subject headers must match.

threads[].snippet STRING

A short part of the message text