/gmail/v1/users/{userId}/labels
GET
/gmail/v1/users/{userId}/labelsLists all labels in the user's mailbox.
Request
The user's email address. The special value me
can be used to indicate the authenticated user.
Request samples
Responses
List of labels. Note that each label resource only contains an id
, name
, messageListVisibility
, labelListVisibility
, and type
. The labels.get method can fetch additional label details.
The color to assign to the label. Color is only available for labels that have their type
set to user
.
The immutable ID of the label.
The visibility of the label in the label list in the Gmail web interface.
The visibility of messages with this label in the message list in the Gmail web interface.
The total number of messages with the label.
The number of unread messages with the label.
The display name of the label.
The total number of threads with the label.
The number of unread threads with the label.
The owner type for the label. User labels are created by the user and can be modified and deleted by the user and can be applied to any message or thread. System labels are internally created and cannot be added, modified, or deleted. System labels may be able to be applied to or removed from messages and threads under some circumstances but this is not guaranteed. For example, users can apply and remove the INBOX
and UNREAD
labels from messages and threads, but cannot apply or remove the DRAFTS
or SENT
labels from messages or threads.
{
"labels": [
{
"color": {
"backgroundColor": "string",
"textColor": "string"
},
"id": "string",
"labelListVisibility": "labelShow",
"messageListVisibility": "show",
"messagesTotal": 0,
"messagesUnread": 0,
"name": "string",
"threadsTotal": 0,
"threadsUnread": 0,
"type": "system"
}
]
}