• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<html><body>
2<style>
3
4body, h1, h2, h3, div, span, p, pre, a {
5  margin: 0;
6  padding: 0;
7  border: 0;
8  font-weight: inherit;
9  font-style: inherit;
10  font-size: 100%;
11  font-family: inherit;
12  vertical-align: baseline;
13}
14
15body {
16  font-size: 13px;
17  padding: 1em;
18}
19
20h1 {
21  font-size: 26px;
22  margin-bottom: 1em;
23}
24
25h2 {
26  font-size: 24px;
27  margin-bottom: 1em;
28}
29
30h3 {
31  font-size: 20px;
32  margin-bottom: 1em;
33  margin-top: 1em;
34}
35
36pre, code {
37  line-height: 1.5;
38  font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39}
40
41pre {
42  margin-top: 0.5em;
43}
44
45h1, h2, h3, p {
46  font-family: Arial, sans serif;
47}
48
49h1, h2, h3 {
50  border-bottom: solid #CCC 1px;
51}
52
53.toc_element {
54  margin-top: 0.5em;
55}
56
57.firstline {
58  margin-left: 2 em;
59}
60
61.method  {
62  margin-top: 1em;
63  border: solid 1px #CCC;
64  padding: 1em;
65  background: #EEE;
66}
67
68.details {
69  font-weight: bold;
70  font-size: 14px;
71}
72
73</style>
74
75<h1><a href="gmail_v1.html">Gmail API</a> . <a href="gmail_v1.users.html">users</a> . <a href="gmail_v1.users.labels.html">labels</a></h1>
76<h2>Instance Methods</h2>
77<p class="toc_element">
78  <code><a href="#create">create(userId, body)</a></code></p>
79<p class="firstline">Creates a new label.</p>
80<p class="toc_element">
81  <code><a href="#delete">delete(userId, id)</a></code></p>
82<p class="firstline">Immediately and permanently deletes the specified label and removes it from any messages and threads that it is applied to.</p>
83<p class="toc_element">
84  <code><a href="#get">get(userId, id)</a></code></p>
85<p class="firstline">Gets the specified label.</p>
86<p class="toc_element">
87  <code><a href="#list">list(userId)</a></code></p>
88<p class="firstline">Lists all labels in the user's mailbox.</p>
89<p class="toc_element">
90  <code><a href="#patch">patch(userId, id, body)</a></code></p>
91<p class="firstline">Updates the specified label. This method supports patch semantics.</p>
92<p class="toc_element">
93  <code><a href="#update">update(userId, id, body)</a></code></p>
94<p class="firstline">Updates the specified label.</p>
95<h3>Method Details</h3>
96<div class="method">
97    <code class="details" id="create">create(userId, body)</code>
98  <pre>Creates a new label.
99
100Args:
101  userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
102  body: object, The request body. (required)
103    The object takes the form of:
104
105{ # Labels are used to categorize messages and threads within the user's mailbox.
106  "name": "A String", # The display name of the label.
107  "messagesTotal": 42, # The total number of messages with the label.
108  "type": "A String", # 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.
109  "threadsUnread": 42, # The number of unread threads with the label.
110  "messagesUnread": 42, # The number of unread messages with the label.
111  "labelListVisibility": "A String", # The visibility of the label in the label list in the Gmail web interface.
112  "threadsTotal": 42, # The total number of threads with the label.
113  "messageListVisibility": "A String", # The visibility of the label in the message list in the Gmail web interface.
114  "id": "A String", # The immutable ID of the label.
115}
116
117
118Returns:
119  An object of the form:
120
121    { # Labels are used to categorize messages and threads within the user's mailbox.
122    "name": "A String", # The display name of the label.
123    "messagesTotal": 42, # The total number of messages with the label.
124    "type": "A String", # 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.
125    "threadsUnread": 42, # The number of unread threads with the label.
126    "messagesUnread": 42, # The number of unread messages with the label.
127    "labelListVisibility": "A String", # The visibility of the label in the label list in the Gmail web interface.
128    "threadsTotal": 42, # The total number of threads with the label.
129    "messageListVisibility": "A String", # The visibility of the label in the message list in the Gmail web interface.
130    "id": "A String", # The immutable ID of the label.
131  }</pre>
132</div>
133
134<div class="method">
135    <code class="details" id="delete">delete(userId, id)</code>
136  <pre>Immediately and permanently deletes the specified label and removes it from any messages and threads that it is applied to.
137
138Args:
139  userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
140  id: string, The ID of the label to delete. (required)
141</pre>
142</div>
143
144<div class="method">
145    <code class="details" id="get">get(userId, id)</code>
146  <pre>Gets the specified label.
147
148Args:
149  userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
150  id: string, The ID of the label to retrieve. (required)
151
152Returns:
153  An object of the form:
154
155    { # Labels are used to categorize messages and threads within the user's mailbox.
156    "name": "A String", # The display name of the label.
157    "messagesTotal": 42, # The total number of messages with the label.
158    "type": "A String", # 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.
159    "threadsUnread": 42, # The number of unread threads with the label.
160    "messagesUnread": 42, # The number of unread messages with the label.
161    "labelListVisibility": "A String", # The visibility of the label in the label list in the Gmail web interface.
162    "threadsTotal": 42, # The total number of threads with the label.
163    "messageListVisibility": "A String", # The visibility of the label in the message list in the Gmail web interface.
164    "id": "A String", # The immutable ID of the label.
165  }</pre>
166</div>
167
168<div class="method">
169    <code class="details" id="list">list(userId)</code>
170  <pre>Lists all labels in the user's mailbox.
171
172Args:
173  userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
174
175Returns:
176  An object of the form:
177
178    {
179    "labels": [ # List of labels.
180      { # Labels are used to categorize messages and threads within the user's mailbox.
181        "name": "A String", # The display name of the label.
182        "messagesTotal": 42, # The total number of messages with the label.
183        "type": "A String", # 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.
184        "threadsUnread": 42, # The number of unread threads with the label.
185        "messagesUnread": 42, # The number of unread messages with the label.
186        "labelListVisibility": "A String", # The visibility of the label in the label list in the Gmail web interface.
187        "threadsTotal": 42, # The total number of threads with the label.
188        "messageListVisibility": "A String", # The visibility of the label in the message list in the Gmail web interface.
189        "id": "A String", # The immutable ID of the label.
190      },
191    ],
192  }</pre>
193</div>
194
195<div class="method">
196    <code class="details" id="patch">patch(userId, id, body)</code>
197  <pre>Updates the specified label. This method supports patch semantics.
198
199Args:
200  userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
201  id: string, The ID of the label to update. (required)
202  body: object, The request body. (required)
203    The object takes the form of:
204
205{ # Labels are used to categorize messages and threads within the user's mailbox.
206  "name": "A String", # The display name of the label.
207  "messagesTotal": 42, # The total number of messages with the label.
208  "type": "A String", # 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.
209  "threadsUnread": 42, # The number of unread threads with the label.
210  "messagesUnread": 42, # The number of unread messages with the label.
211  "labelListVisibility": "A String", # The visibility of the label in the label list in the Gmail web interface.
212  "threadsTotal": 42, # The total number of threads with the label.
213  "messageListVisibility": "A String", # The visibility of the label in the message list in the Gmail web interface.
214  "id": "A String", # The immutable ID of the label.
215}
216
217
218Returns:
219  An object of the form:
220
221    { # Labels are used to categorize messages and threads within the user's mailbox.
222    "name": "A String", # The display name of the label.
223    "messagesTotal": 42, # The total number of messages with the label.
224    "type": "A String", # 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.
225    "threadsUnread": 42, # The number of unread threads with the label.
226    "messagesUnread": 42, # The number of unread messages with the label.
227    "labelListVisibility": "A String", # The visibility of the label in the label list in the Gmail web interface.
228    "threadsTotal": 42, # The total number of threads with the label.
229    "messageListVisibility": "A String", # The visibility of the label in the message list in the Gmail web interface.
230    "id": "A String", # The immutable ID of the label.
231  }</pre>
232</div>
233
234<div class="method">
235    <code class="details" id="update">update(userId, id, body)</code>
236  <pre>Updates the specified label.
237
238Args:
239  userId: string, The user's email address. The special value me can be used to indicate the authenticated user. (required)
240  id: string, The ID of the label to update. (required)
241  body: object, The request body. (required)
242    The object takes the form of:
243
244{ # Labels are used to categorize messages and threads within the user's mailbox.
245  "name": "A String", # The display name of the label.
246  "messagesTotal": 42, # The total number of messages with the label.
247  "type": "A String", # 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.
248  "threadsUnread": 42, # The number of unread threads with the label.
249  "messagesUnread": 42, # The number of unread messages with the label.
250  "labelListVisibility": "A String", # The visibility of the label in the label list in the Gmail web interface.
251  "threadsTotal": 42, # The total number of threads with the label.
252  "messageListVisibility": "A String", # The visibility of the label in the message list in the Gmail web interface.
253  "id": "A String", # The immutable ID of the label.
254}
255
256
257Returns:
258  An object of the form:
259
260    { # Labels are used to categorize messages and threads within the user's mailbox.
261    "name": "A String", # The display name of the label.
262    "messagesTotal": 42, # The total number of messages with the label.
263    "type": "A String", # 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.
264    "threadsUnread": 42, # The number of unread threads with the label.
265    "messagesUnread": 42, # The number of unread messages with the label.
266    "labelListVisibility": "A String", # The visibility of the label in the label list in the Gmail web interface.
267    "threadsTotal": 42, # The total number of threads with the label.
268    "messageListVisibility": "A String", # The visibility of the label in the message list in the Gmail web interface.
269    "id": "A String", # The immutable ID of the label.
270  }</pre>
271</div>
272
273</body></html>