> ## Documentation Index
> Fetch the complete documentation index at: https://docs.blinkops.com/llms.txt
> Use this file to discover all available pages before exploring further.

# List Gmail Threads

Lists the threads in the user's mailbox.

<Note>
  External Documentation

  To learn more, visit the [Gmail documentation](https://developers.google.com/gmail/api/reference/rest/v1/users.threads/list).
</Note>

## Basic Parameters

<div className="integrations-table">
  | Parameter        | Description                                                                                      |
  | ---------------- | ------------------------------------------------------------------------------------------------ |
  | Return All Pages | Automatically fetch all resources, page by page.                                                 |
  | User ID          | The user's email address. The special value `me` can be used to indicate the authenticated user. |
</div>

## Advanced Parameters

<div className="integrations-table">
  | Parameter               | Description                                                                                                                                                                                                                                                                                                                  |
  | ----------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
  | Delegated User Override | Perform the action on behalf of another user, overriding the delegated user defined in the connection.<br /><br />If not specified, the delegated user is the one provided in the connection.<br /><br />Has no effect when using an OAuth connection.<br /><br />NOTE: the connection details are not edited by this input. |
  | Page Size               | Maximum number of messages to return. The maximum allowed value for this field is 500.                                                                                                                                                                                                                                       |
  | Page Token              | The page token allows you to get a specific page of results in a list. If additional pages are available, the response will include a `nextPageToken` that you can use to fetch the next page of results.                                                                                                                    |
</div>

## Example Output

```json theme={"dark"}
{
	"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](https://library.blinkops.com/workflows/list-gmail-threads-and-send-results-via-email)

<div className="iframe-wrapper">
  <div className="iframe-media">
    <img src="https://mintcdn.com/blinkops-2/ojHYuDeYX5FWuN8a/img/Icons/play-box.svg?fit=max&auto=format&n=ojHYuDeYX5FWuN8a&q=85&s=b8af968e71438a9499c3223c9bd29fb2" alt="Workflow Library" width="16" height="16" data-path="img/Icons/play-box.svg" />

    Preview this Workflow on desktop
  </div>

  <iframe className="iframe" src="https://library.blinkops.com/workflows/list-gmail-threads-and-send-results-via-email/canvas" />
</div>
