Skip to main content

List Gmail Threads

Lists the threads in the user's mailbox.

External Documentation

To learn more, visit the Gmail documentation.

Basic Parameters

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

Advanced Parameters

ParameterDescription
Delegated User OverridePerform the action on behalf of another user, overriding the delegated user defined in the connection.

If not specified, the delegated user is the one provided in the connection.

Has no effect when using an OAuth connection.

NOTE: the connection details are not edited by this input.

Example Output

{
"nextPageToken": "Page token to retrieve the next page of results in the list.",
"resultSizeEstimate": 0,
"threads": [
{
"historyId": "The ID of the last history record that modified this thread.",
"id": "The unique ID of the thread.",
"messages": [
{
"historyId": "The ID of the last history record that modified this message.",
"id": "The immutable ID of the message.",
"internalDate": "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.",
"labelIds": [
"string"
],
"payload": {
"body": {
"attachmentId": "When present, contains the ID of an external attachment that can be retrieved in a separate `messages.attachments.get` request. When not present, the entire content of the message part body is contained in the data field.",
"data": "The body data of a MIME message part as a base64url encoded string. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment.",
"size": 0
},
"filename": "The filename of the attachment. Only present if this message part represents an attachment.",
"headers": [
{
"name": "The name of the header before the `:` separator. For example, `To`.",
"value": "The value of the header after the `:` separator. For example, `someuser@example.com`."
}
],
"mimeType": "The MIME type of the message part.",
"partId": "The immutable ID of the message part.",
"parts": [
null
]
},
"raw": "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.",
"sizeEstimate": 0,
"snippet": "A short part of the message text.",
"threadId": "The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met: 1. The requested `threadId` must be specified on the `Message` or `Draft.Message` you supply with your request. 2. The `References` and `In-Reply-To` headers must be set in compliance with the [RFC 2822](https://tools.ietf.org/html/rfc2822) standard. 3. The `Subject` headers must match. "
}
],
"snippet": "A short part of the message text."
}
]
}

Workflow Library Example

List Gmail Threads and Send Results Via Email

Workflow LibraryPreview this Workflow on desktop