/gmail/v1/users/{userId}/threads
GET
/gmail/v1/users/{userId}/threadsLists the threads in the user's mailbox.
Request
The user's email address. The special value me
can be used to indicate the authenticated user.
Include threads from SPAM
and TRASH
in the results.
Only return threads with labels that match all of the specified label IDs.
Maximum number of threads to return. This field defaults to 100. The maximum allowed value for this field is 500.
Page token to retrieve a specific page of results in the list.
Only return threads matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread"
. Parameter cannot be used when accessing the api using the gmail.metadata scope.
Request samples
Responses
Page token to retrieve the next page of results in the list.
Estimated total number of results.
List of threads. Note that each thread resource does not contain a list of messages
. The list of messages
for a given thread can be fetched using the threads.get method.
The ID of the last history record that modified this thread.
The unique ID of the thread.
The list of messages in the thread.
A short part of the message text.
{
"nextPageToken": "string",
"resultSizeEstimate": 0,
"threads": [
{
"historyId": "string",
"id": "string",
"messages": [
{
"historyId": "string",
"id": "string",
"internalDate": "string",
"labelIds": [
"string"
],
"payload": {
"body": {
"attachmentId": "string",
"data": "string",
"size": 0
},
"filename": "string",
"headers": [
{
"name": "string",
"value": "string"
}
],
"mimeType": "string",
"partId": "string",
"parts": [
{}
]
},
"raw": "string",
"sizeEstimate": 0,
"snippet": "string",
"threadId": "string"
}
],
"snippet": "string"
}
]
}