Method: users.threads.list
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
사용자의 메일함에 있는 대화목록을 나열합니다.
HTTP 요청
GET https://gmail.googleapis.com/gmail/v1/users/{userId}/threads
URL은 gRPC 트랜스코딩 문법을 사용합니다.
경로 매개변수
매개변수 |
userId |
string
사용자의 이메일 주소 인증된 사용자를 나타내는 데 특수 값 me 을 사용할 수 있습니다.
|
쿼리 매개변수
매개변수 |
maxResults |
integer (uint32 format)
반환할 최대 스레드 수입니다. 이 필드의 기본값은 100입니다. 이 필드의 최대 허용 값은 500입니다.
|
pageToken |
string
목록에서 특정 결과 페이지를 검색하는 페이지 토큰입니다.
|
q |
string
지정된 검색어와 일치하는 대화목록만 반환합니다. Gmail 검색창과 동일한 쿼리 형식을 지원합니다. 예를 들면 "from:someuser@example.com rfc822msgid:<somemsgid@example.com>
is:unread" 입니다. gmail.metadata 범위를 사용하여 API에 액세스할 때는 매개변수를 사용할 수 없습니다.
|
labelIds[] |
string
지정된 모든 라벨 ID와 일치하는 라벨이 있는 대화목록만 반환합니다.
|
includeSpamTrash |
boolean
결과에 SPAM 및 TRASH 의 대화목록을 포함합니다.
|
응답 본문
성공한 경우 응답 본문은 다음과 같은 구조의 데이터를 포함합니다.
JSON 표현 |
{
"threads": [
{
object (Thread )
}
],
"nextPageToken": string,
"resultSizeEstimate": integer
} |
필드 |
threads[] |
object (Thread )
스레드 목록입니다. 각 스레드 리소스에는 messages 목록이 포함되지 않습니다. 특정 스레드의 messages 목록은 threads.get 메서드를 사용하여 가져올 수 있습니다.
|
nextPageToken |
string
목록에서 결과의 다음 페이지를 가져오는 페이지 토큰입니다.
|
resultSizeEstimate |
integer (uint32 format)
예상 총 결과 수입니다.
|
승인 범위
다음 OAuth 범위 중 하나가 필요합니다.
https://mail.google.com/
https://www.googleapis.com/auth/gmail.modify
https://www.googleapis.com/auth/gmail.readonly
https://www.googleapis.com/auth/gmail.metadata
자세한 내용은 승인 가이드를 참고하세요.
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2025-07-25(UTC)
[null,null,["최종 업데이트: 2025-07-25(UTC)"],[],[],null,["# Method: users.threads.list\n\n- [HTTP request](#body.HTTP_TEMPLATE)\n- [Path parameters](#body.PATH_PARAMETERS)\n- [Query parameters](#body.QUERY_PARAMETERS)\n- [Request body](#body.request_body)\n- [Response body](#body.response_body)\n - [JSON representation](#body.ListThreadsResponse.SCHEMA_REPRESENTATION)\n- [Authorization scopes](#body.aspect)\n- [Try it!](#try-it)\n\nLists the threads in the user's mailbox.\n\n### HTTP request\n\n`GET https://gmail.googleapis.com/gmail/v1/users/{userId}/threads`\n\nThe URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.\n\n### Path parameters\n\n| Parameters ||\n|----------|-----------------------------------------------------------------------------------------------------------|\n| `userId` | `string` The user's email address. The special value `me` can be used to indicate the authenticated user. |\n\n### Query parameters\n\n| Parameters ||\n|--------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `maxResults` | `integer (`[uint32](https://developers.google.com/discovery/v1/type-format)` format)` Maximum number of threads to return. This field defaults to 100. The maximum allowed value for this field is 500. |\n| `pageToken` | `string` Page token to retrieve a specific page of results in the list. |\n| `q` | `string` Only return threads matching the specified query. Supports the same query format as the Gmail search box. For example, `\"from:someuser@example.com rfc822msgid:\u003csomemsgid@example.com\u003e is:unread\"`. Parameter cannot be used when accessing the api using the gmail.metadata scope. |\n| `labelIds[]` | `string` Only return threads with labels that match all of the specified label IDs. |\n| `includeSpamTrash` | `boolean` Include threads from `SPAM` and `TRASH` in the results. |\n\n### Request body\n\nThe request body must be empty.\n\n### Response body\n\nIf successful, the response body contains data with the following structure:\n\n| JSON representation |\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ``` { \"threads\": [ { object (/workspace/gmail/api/reference/rest/v1/users.threads#Thread) } ], \"nextPageToken\": string, \"resultSizeEstimate\": integer } ``` |\n\n| Fields ||\n|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `threads[]` | `object (`[Thread](/workspace/gmail/api/reference/rest/v1/users.threads#Thread)`)` 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`](https://developers.google.com/workspace/gmail/api/v1/reference/users/threads/get) method. |\n| `nextPageToken` | `string` Page token to retrieve the next page of results in the list. |\n| `resultSizeEstimate` | `integer (`[uint32](https://developers.google.com/discovery/v1/type-format)` format)` Estimated total number of results. |\n\n### Authorization scopes\n\nRequires one of the following OAuth scopes:\n\n- `https://mail.google.com/`\n- `\n https://www.googleapis.com/auth/gmail.modify`\n- `\n https://www.googleapis.com/auth/gmail.readonly`\n- `\n https://www.googleapis.com/auth/gmail.metadata`\n\nFor more information, see the [Authorization guide](/workspace/guides/configure-oauth-consent)."]]