gmail.users.threads.list

GET {{baseUrl}}/gmail/v1/users/:userId/threads?includeSpamTrash=<boolean>&labelIds=<string>&labelIds=<string>&maxResults=<integer>&pageToken=<string>&q=<string>&$.xgafv=<string>&access_token=<string>&alt=<string>&callback=<string>&fields=<string>&key=<string>&oauth_token=<string>&prettyPrint=<boolean>&quotaUser=<string>&upload_protocol=<string>&uploadType=<string>

Lists the threads in the user's mailbox.

Request Params

KeyDatatypeRequiredDescription
includeSpamTrashstringInclude threads from SPAM and TRASH in the results.
labelIdsstringOnly return threads with labels that match all of the specified label IDs.
labelIdsstringOnly return threads with labels that match all of the specified label IDs.
maxResultsstringMaximum number of threads to return.
pageTokenstringPage token to retrieve a specific page of results in the list.
qstringOnly return threads matching the specified query. Supports the same query format as the Gmail search box. For example, &quot;from:someuser@example.com rfc822msgid: is:unread&quot;. Parameter cannot be used when accessing the api using the gmail.metadata scope.
$.xgafvstringV1 error format.
access_tokenstringOAuth access token.
altstringData format for response.
callbackstringJSONP
fieldsstringSelector specifying which fields to include in a partial response.
keystringAPI key. Your API key identifies your project and provides you with API access, quota, and reports. Required unless you provide an OAuth 2.0 token.
oauth_tokenstringOAuth 2.0 token for the current user.
prettyPrintstringReturns response with indentations and line breaks.
quotaUserstringAvailable to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters.
upload_protocolstringUpload protocol for media (e.g. "raw", "multipart").
uploadTypestringLegacy upload protocol for media (e.g. "media", "multipart").

RESPONSES

status: OK

{&quot;nextPageToken&quot;:&quot;anim dolore dolore aliquip pariatur&quot;,&quot;resultSizeEstimate&quot;:-21814645,&quot;threads&quot;:[{&quot;historyId&quot;:&quot;Ut ame&quot;,&quot;id&quot;:&quot;sunt in elit dolor&quot;,&quot;messages&quot;:[{&quot;historyId&quot;:&quot;\u003cstring\u003e&quot;,&quot;id&quot;:&quot;\u003cstring\u003e&quot;,&quot;internalDate&quot;:&quot;\u003cstring\u003e&quot;,&quot;labelIds&quot;:[&quot;\u003cstring\u003e&quot;,&quot;\u003cstring\u003e&quot;],&quot;payload&quot;:{&quot;body&quot;:{&quot;attachmentId&quot;:{&quot;value&quot;:&quot;\u003cError: Too many levels of nesting to fake this schema\u003e&quot;},&quot;data&quot;:{&quot;value&quot;:&quot;\u003cError: Too many levels of nesting to fake this schema\u003e&quot;},&quot;size&quot;:{&quot;value&quot;:&quot;\u003cError: Too many levels of nesting to fake this schema\u003e&quot;}},&quot;filename&quot;:&quot;et Excepteur&quot;,&quot;headers&quot;:[{&quot;value&quot;:&quot;\u003cError: Too many levels of nesting to fake this schema\u003e&quot;},{&quot;value&quot;:&quot;\u003cError: Too many levels of nesting to fake this schema\u003e&quot;}],&quot;mimeType&quot;:&quot;officia ut&quot;,&quot;partId&quot;:&quot;irure&quot;,&quot;parts&quot;:[{&quot;value&quot;:&quot;\u003cCircular reference to #/components/schemas/MessagePart detected\u003e&quot;},{&quot;value&quot;:&quot;\u003cCircular reference to #/components/schemas/MessagePart detected\u003e&quot;}]},&quot;raw&quot;:&quot;\u003cstring\u003e&quot;,&quot;sizeEstimate&quot;:&quot;\u003cinteger\u003e&quot;,&quot;snippet&quot;:&quot;\u003cstring\u003e&quot;,&quot;threadId&quot;:&quot;\u003cstring\u003e&quot;},{&quot;historyId&quot;:&quot;\u003cstring\u003e&quot;,&quot;id&quot;:&quot;\u003cstring\u003e&quot;,&quot;internalDate&quot;:&quot;\u003cstring\u003e&quot;,&quot;labelIds&quot;:[&quot;\u003cstring\u003e&quot;,&quot;\u003cstring\u003e&quot;],&quot;payload&quot;:{&quot;body&quot;:{&quot;attachmentId&quot;:{&quot;value&quot;:&quot;\u003cError: Too many levels of nesting to fake this schema\u003e&quot;},&quot;data&quot;:{&quot;value&quot;:&quot;\u003cError: Too many levels of nesting to fake this schema\u003e&quot;},&quot;size&quot;:{&quot;value&quot;:&quot;\u003cError: Too many levels of nesting to fake this schema\u003e&quot;}},&quot;filename&quot;:&quot;fugiat id eu &quot;,&quot;headers&quot;:[{&quot;value&quot;:&quot;\u003cError: Too many levels of nesting to fake this schema\u003e&quot;},{&quot;value&quot;:&quot;\u003cError: Too many levels of nesting to fake this schema\u003e&quot;}],&quot;mimeType&quot;:&quot;exercitation ullamco&quot;,&quot;partId&quot;:&quot;ut in consequat ut&quot;,&quot;parts&quot;:[{&quot;value&quot;:&quot;\u003cCircular reference to #/components/schemas/MessagePart detected\u003e&quot;},{&quot;value&quot;:&quot;\u003cCircular reference to #/components/schemas/MessagePart detected\u003e&quot;}]},&quot;raw&quot;:&quot;\u003cstring\u003e&quot;,&quot;sizeEstimate&quot;:&quot;\u003cinteger\u003e&quot;,&quot;snippet&quot;:&quot;\u003cstring\u003e&quot;,&quot;threadId&quot;:&quot;\u003cstring\u003e&quot;}],&quot;snippet&quot;:&quot;irure ex&quot;},{&quot;historyId&quot;:&quot;in labore ut Lorem&quot;,&quot;id&quot;:&quot;do in ut&quot;,&quot;messages&quot;:[{&quot;historyId&quot;:&quot;\u003cstring\u003e&quot;,&quot;id&quot;:&quot;\u003cstring\u003e&quot;,&quot;internalDate&quot;:&quot;\u003cstring\u003e&quot;,&quot;labelIds&quot;:[&quot;\u003cstring\u003e&quot;,&quot;\u003cstring\u003e&quot;],&quot;payload&quot;:{&quot;body&quot;:{&quot;attachmentId&quot;:{&quot;value&quot;:&quot;\u003cError: Too many levels of nesting to fake this schema\u003e&quot;},&quot;data&quot;:{&quot;value&quot;:&quot;\u003cError: Too many levels of nesting to fake this schema\u003e&quot;},&quot;size&quot;:{&quot;value&quot;:&quot;\u003cError: Too many levels of nesting to fake this schema\u003e&quot;}},&quot;filename&quot;:&quot;aliquip mollit&quot;,&quot;headers&quot;:[{&quot;value&quot;:&quot;\u003cError: Too many levels of nesting to fake this schema\u003e&quot;},{&quot;value&quot;:&quot;\u003cError: Too many levels of nesting to fake this schema\u003e&quot;}],&quot;mimeType&quot;:&quot;nisi consequat amet&quot;,&quot;partId&quot;:&quot;incididunt consequat sed consectetur&quot;,&quot;parts&quot;:[{&quot;value&quot;:&quot;\u003cCircular reference to #/components/schemas/MessagePart detected\u003e&quot;},{&quot;value&quot;:&quot;\u003cCircular reference to #/components/schemas/MessagePart detected\u003e&quot;}]},&quot;raw&quot;:&quot;\u003cstring\u003e&quot;,&quot;sizeEstimate&quot;:&quot;\u003cinteger\u003e&quot;,&quot;snippet&quot;:&quot;\u003cstring\u003e&quot;,&quot;threadId&quot;:&quot;\u003cstring\u003e&quot;},{&quot;historyId&quot;:&quot;\u003cstring\u003e&quot;,&quot;id&quot;:&quot;\u003cstring\u003e&quot;,&quot;internalDate&quot;:&quot;\u003cstring\u003e&quot;,&quot;labelIds&quot;:[&quot;\u003cstring\u003e&quot;,&quot;\u003cstring\u003e&quot;],&quot;payload&quot;:{&quot;body&quot;:{&quot;attachmentId&quot;:{&quot;value&quot;:&quot;\u003cError: Too many levels of nesting to fake this schema\u003e&quot;},&quot;data&quot;:{&quot;value&quot;:&quot;\u003cError: Too many levels of nesting to fake this schema\u003e&quot;},&quot;size&quot;:{&quot;value&quot;:&quot;\u003cError: Too many levels of nesting to fake this schema\u003e&quot;}},&quot;filename&quot;:&quot;incididunt minim dolore occaec&quot;,&quot;headers&quot;:[{&quot;value&quot;:&quot;\u003cError: Too many levels of nesting to fake this schema\u003e&quot;},{&quot;value&quot;:&quot;\u003cError: Too many levels of nesting to fake this schema\u003e&quot;}],&quot;mimeType&quot;:&quot;aute culpa&quot;,&quot;partId&quot;:&quot;nisi&quot;,&quot;parts&quot;:[{&quot;value&quot;:&quot;\u003cCircular reference to #/components/schemas/MessagePart detected\u003e&quot;},{&quot;value&quot;:&quot;\u003cCircular reference to #/components/schemas/MessagePart detected\u003e&quot;}]},&quot;raw&quot;:&quot;\u003cstring\u003e&quot;,&quot;sizeEstimate&quot;:&quot;\u003cinteger\u003e&quot;,&quot;snippet&quot;:&quot;\u003cstring\u003e&quot;,&quot;threadId&quot;:&quot;\u003cstring\u003e&quot;}],&quot;snippet&quot;:&quot;eiusmod Ut id occaecat Duis&quot;}]}