Sends the specified, existing draft to the recipients in the To, Cc, and Bcc headers.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
The user's email address. The special value me can be used to indicate the authenticated user. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Name | Data Type | Description |
---|---|---|
Draft
|
object |
A draft email in the user's mailbox. |
message
|
Message |
The message content of the draft. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id
|
string |
The immutable ID of the draft. |
Name | Data Type | Description |
---|---|---|
Message
|
object |
An email message. |
threadId
|
string |
The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
snippet
|
string |
A short part of the message text. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sizeEstimate
|
integer |
Estimated size in bytes of the message. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
raw
|
byte |
The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
payload
|
MessagePart |
The parsed email structure in the message parts. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
labelIds
|
array [string] |
List of IDs of labels applied to this message. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
internalDate
|
string |
The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id
|
string |
The immutable ID of the message. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
historyId
|
string |
The ID of the last history record that modified this message. |
Immediately and permanently deletes the specified draft. Does not simply trash it.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
The user's email address. The special value me can be used to indicate the authenticated user. |
id
|
string |
The ID of the draft to delete. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Gets the specified draft.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
The user's email address. The special value me can be used to indicate the authenticated user. |
id
|
string |
The ID of the draft to retrieve. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
format
|
string Default value: full Allowed values: - full - metadata - minimal - raw |
The format to return the draft in. |
Name | Data Type | Description |
---|---|---|
Draft
|
object |
A draft email in the user's mailbox. |
message
|
Message |
The message content of the draft. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id
|
string |
The immutable ID of the draft. |
Replaces a draft's content.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
The user's email address. The special value me can be used to indicate the authenticated user. |
id
|
string |
The ID of the draft to update. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Name | Data Type | Description |
---|---|---|
Draft
|
object |
A draft email in the user's mailbox. |
message
|
Message |
The message content of the draft. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id
|
string |
The immutable ID of the draft. |
Name | Data Type | Description |
---|---|---|
Draft
|
object |
A draft email in the user's mailbox. |
message
|
Message |
The message content of the draft. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id
|
string |
The immutable ID of the draft. |
Lists the drafts in the user's mailbox.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
The user's email address. The special value me can be used to indicate the authenticated user. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
q
|
string |
Only return draft messages matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid: is:unread". |
pageToken
|
string |
Page token to retrieve a specific page of results in the list. |
maxResults
|
integer Default value: 100
|
Maximum number of drafts to return. |
includeSpamTrash
|
boolean Default value: false
|
Include drafts from SPAM and TRASH in the results. |
Name | Data Type | Description |
---|---|---|
ListDraftsResponse
|
object |
resultSizeEstimate
|
integer |
Estimated total number of results. |
||||||||||||||||||||||||||||||||||||||||||||
nextPageToken
|
string |
Token to retrieve the next page of results in the list. |
||||||||||||||||||||||||||||||||||||||||||||
drafts
|
array [Draft] |
List of drafts. |
||||||||||||||||||||||||||||||||||||||||||||
Properties
|
Creates a new draft with the DRAFT label.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
The user's email address. The special value me can be used to indicate the authenticated user. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Name | Data Type | Description |
---|---|---|
Draft
|
object |
A draft email in the user's mailbox. |
message
|
Message |
The message content of the draft. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id
|
string |
The immutable ID of the draft. |
Name | Data Type | Description |
---|---|---|
Draft
|
object |
A draft email in the user's mailbox. |
message
|
Message |
The message content of the draft. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id
|
string |
The immutable ID of the draft. |
Lists the history of all changes to the given mailbox. History results are returned in chronological order (increasing historyId).
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
The user's email address. The special value me can be used to indicate the authenticated user. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
startHistoryId
|
string |
Required. Returns history records after the specified startHistoryId. The supplied startHistoryId should be obtained from the historyId of a message, thread, or previous list response. History IDs increase chronologically but are not contiguous with random gaps in between valid IDs. Supplying an invalid or out of date startHistoryId typically returns an HTTP 404 error code. A historyId is typically valid for at least a week, but in some rare circumstances may be valid for only a few hours. If you receive an HTTP 404 error response, your application should perform a full sync. If you receive no nextPageToken in the response, there are no updates to retrieve and you can store the returned historyId for a future request. |
pageToken
|
string |
Page token to retrieve a specific page of results in the list. |
maxResults
|
integer Default value: 100
|
The maximum number of history records to return. |
labelId
|
string |
Only return messages with a label matching the ID. |
historyTypes
|
array |
History types to be returned by the function |
Name | Data Type | Description |
---|---|---|
ListHistoryResponse
|
object |
nextPageToken
|
string |
Page token to retrieve the next page of results in the list. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
historyId
|
string |
The ID of the mailbox's current history record. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
history
|
array [History] |
List of history records. Any messages contained in the response will typically only have id and threadId fields populated. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties
|
Immediately and permanently deletes the specified label and removes it from any messages and threads that it is applied to.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
The user's email address. The special value me can be used to indicate the authenticated user. |
id
|
string |
The ID of the label to delete. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Gets the specified label.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
The user's email address. The special value me can be used to indicate the authenticated user. |
id
|
string |
The ID of the label to retrieve. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Name | Data Type | Description |
---|---|---|
Label
|
object |
Labels are used to categorize messages and threads within the user's mailbox. |
type
|
string Allowed values: - system - user |
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. |
||||||||||
threadsUnread
|
integer |
The number of unread threads with the label. |
||||||||||
threadsTotal
|
integer |
The total number of threads with the label. |
||||||||||
name
|
string |
The display name of the label. |
||||||||||
messagesUnread
|
integer |
The number of unread messages with the label. |
||||||||||
messagesTotal
|
integer |
The total number of messages with the label. |
||||||||||
messageListVisibility
|
string Allowed values: - hide - show |
The visibility of the label in the message list in the Gmail web interface. |
||||||||||
labelListVisibility
|
string Allowed values: - labelHide - labelShow - labelShowIfUnread |
The visibility of the label in the label list in the Gmail web interface. |
||||||||||
id
|
string |
The immutable ID of the label. |
||||||||||
color
|
LabelColor |
The color to assign to the label. Color is only available for labels that have their type set to user. |
||||||||||
Properties
|
Updates the specified label. This method supports patch semantics.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
The user's email address. The special value me can be used to indicate the authenticated user. |
id
|
string |
The ID of the label to update. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Name | Data Type | Description |
---|---|---|
Label
|
object |
Labels are used to categorize messages and threads within the user's mailbox. |
type
|
string Allowed values: - system - user |
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. |
||||||||||
threadsUnread
|
integer |
The number of unread threads with the label. |
||||||||||
threadsTotal
|
integer |
The total number of threads with the label. |
||||||||||
name
|
string |
The display name of the label. |
||||||||||
messagesUnread
|
integer |
The number of unread messages with the label. |
||||||||||
messagesTotal
|
integer |
The total number of messages with the label. |
||||||||||
messageListVisibility
|
string Allowed values: - hide - show |
The visibility of the label in the message list in the Gmail web interface. |
||||||||||
labelListVisibility
|
string Allowed values: - labelHide - labelShow - labelShowIfUnread |
The visibility of the label in the label list in the Gmail web interface. |
||||||||||
id
|
string |
The immutable ID of the label. |
||||||||||
color
|
LabelColor |
The color to assign to the label. Color is only available for labels that have their type set to user. |
||||||||||
Properties
|
Name | Data Type | Description |
---|---|---|
Label
|
object |
Labels are used to categorize messages and threads within the user's mailbox. |
type
|
string Allowed values: - system - user |
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. |
||||||||||
threadsUnread
|
integer |
The number of unread threads with the label. |
||||||||||
threadsTotal
|
integer |
The total number of threads with the label. |
||||||||||
name
|
string |
The display name of the label. |
||||||||||
messagesUnread
|
integer |
The number of unread messages with the label. |
||||||||||
messagesTotal
|
integer |
The total number of messages with the label. |
||||||||||
messageListVisibility
|
string Allowed values: - hide - show |
The visibility of the label in the message list in the Gmail web interface. |
||||||||||
labelListVisibility
|
string Allowed values: - labelHide - labelShow - labelShowIfUnread |
The visibility of the label in the label list in the Gmail web interface. |
||||||||||
id
|
string |
The immutable ID of the label. |
||||||||||
color
|
LabelColor |
The color to assign to the label. Color is only available for labels that have their type set to user. |
||||||||||
Properties
|
Updates the specified label.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
The user's email address. The special value me can be used to indicate the authenticated user. |
id
|
string |
The ID of the label to update. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Name | Data Type | Description |
---|---|---|
Label
|
object |
Labels are used to categorize messages and threads within the user's mailbox. |
type
|
string Allowed values: - system - user |
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. |
||||||||||
threadsUnread
|
integer |
The number of unread threads with the label. |
||||||||||
threadsTotal
|
integer |
The total number of threads with the label. |
||||||||||
name
|
string |
The display name of the label. |
||||||||||
messagesUnread
|
integer |
The number of unread messages with the label. |
||||||||||
messagesTotal
|
integer |
The total number of messages with the label. |
||||||||||
messageListVisibility
|
string Allowed values: - hide - show |
The visibility of the label in the message list in the Gmail web interface. |
||||||||||
labelListVisibility
|
string Allowed values: - labelHide - labelShow - labelShowIfUnread |
The visibility of the label in the label list in the Gmail web interface. |
||||||||||
id
|
string |
The immutable ID of the label. |
||||||||||
color
|
LabelColor |
The color to assign to the label. Color is only available for labels that have their type set to user. |
||||||||||
Properties
|
Name | Data Type | Description |
---|---|---|
Label
|
object |
Labels are used to categorize messages and threads within the user's mailbox. |
type
|
string Allowed values: - system - user |
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. |
||||||||||
threadsUnread
|
integer |
The number of unread threads with the label. |
||||||||||
threadsTotal
|
integer |
The total number of threads with the label. |
||||||||||
name
|
string |
The display name of the label. |
||||||||||
messagesUnread
|
integer |
The number of unread messages with the label. |
||||||||||
messagesTotal
|
integer |
The total number of messages with the label. |
||||||||||
messageListVisibility
|
string Allowed values: - hide - show |
The visibility of the label in the message list in the Gmail web interface. |
||||||||||
labelListVisibility
|
string Allowed values: - labelHide - labelShow - labelShowIfUnread |
The visibility of the label in the label list in the Gmail web interface. |
||||||||||
id
|
string |
The immutable ID of the label. |
||||||||||
color
|
LabelColor |
The color to assign to the label. Color is only available for labels that have their type set to user. |
||||||||||
Properties
|
Lists all labels in the user's mailbox.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
The user's email address. The special value me can be used to indicate the authenticated user. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Name | Data Type | Description |
---|---|---|
ListLabelsResponse
|
object |
labels
|
array [Label] |
List of labels. |
|||||||||||||||||||||||||||||||||||||||||||||||
Properties
|
Creates a new label.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
The user's email address. The special value me can be used to indicate the authenticated user. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Name | Data Type | Description |
---|---|---|
Label
|
object |
Labels are used to categorize messages and threads within the user's mailbox. |
type
|
string Allowed values: - system - user |
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. |
||||||||||
threadsUnread
|
integer |
The number of unread threads with the label. |
||||||||||
threadsTotal
|
integer |
The total number of threads with the label. |
||||||||||
name
|
string |
The display name of the label. |
||||||||||
messagesUnread
|
integer |
The number of unread messages with the label. |
||||||||||
messagesTotal
|
integer |
The total number of messages with the label. |
||||||||||
messageListVisibility
|
string Allowed values: - hide - show |
The visibility of the label in the message list in the Gmail web interface. |
||||||||||
labelListVisibility
|
string Allowed values: - labelHide - labelShow - labelShowIfUnread |
The visibility of the label in the label list in the Gmail web interface. |
||||||||||
id
|
string |
The immutable ID of the label. |
||||||||||
color
|
LabelColor |
The color to assign to the label. Color is only available for labels that have their type set to user. |
||||||||||
Properties
|
Name | Data Type | Description |
---|---|---|
Label
|
object |
Labels are used to categorize messages and threads within the user's mailbox. |
type
|
string Allowed values: - system - user |
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. |
||||||||||
threadsUnread
|
integer |
The number of unread threads with the label. |
||||||||||
threadsTotal
|
integer |
The total number of threads with the label. |
||||||||||
name
|
string |
The display name of the label. |
||||||||||
messagesUnread
|
integer |
The number of unread messages with the label. |
||||||||||
messagesTotal
|
integer |
The total number of messages with the label. |
||||||||||
messageListVisibility
|
string Allowed values: - hide - show |
The visibility of the label in the message list in the Gmail web interface. |
||||||||||
labelListVisibility
|
string Allowed values: - labelHide - labelShow - labelShowIfUnread |
The visibility of the label in the label list in the Gmail web interface. |
||||||||||
id
|
string |
The immutable ID of the label. |
||||||||||
color
|
LabelColor |
The color to assign to the label. Color is only available for labels that have their type set to user. |
||||||||||
Properties
|
Deletes many messages by message ID. Provides no guarantees that messages were not already deleted or even existed at all.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
The user's email address. The special value me can be used to indicate the authenticated user. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Name | Data Type | Description |
---|---|---|
BatchDeleteMessagesRequest
|
object |
ids
|
array [string] |
The IDs of the messages to delete. |
Modifies the labels on the specified messages.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
The user's email address. The special value me can be used to indicate the authenticated user. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Name | Data Type | Description |
---|---|---|
BatchModifyMessagesRequest
|
object |
removeLabelIds
|
array [string] |
A list of label IDs to remove from messages. |
ids
|
array [string] |
The IDs of the messages to modify. There is a limit of 1000 ids per request. |
addLabelIds
|
array [string] |
A list of label IDs to add to messages. |
Imports a message into only this user's mailbox, with standard email delivery scanning and classification similar to receiving via SMTP. Does not send a message.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
The user's email address. The special value me can be used to indicate the authenticated user. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
processForCalendar
|
boolean Default value: false
|
Process calendar invites in the email and add any extracted meetings to the Google Calendar for this user. |
neverMarkSpam
|
boolean Default value: false
|
Ignore the Gmail spam classifier decision and never mark this email as SPAM in the mailbox. |
internalDateSource
|
string Default value: dateHeader Allowed values: - dateHeader - receivedTime |
Source for Gmail's internal date of the message. |
deleted
|
boolean Default value: false
|
Mark the email as permanently deleted (not TRASH) and only visible in Google Vault to a Vault administrator. Only used for G Suite accounts. |
Name | Data Type | Description |
---|---|---|
Message
|
object |
An email message. |
threadId
|
string |
The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
snippet
|
string |
A short part of the message text. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sizeEstimate
|
integer |
Estimated size in bytes of the message. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
raw
|
byte |
The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
payload
|
MessagePart |
The parsed email structure in the message parts. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
labelIds
|
array [string] |
List of IDs of labels applied to this message. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
internalDate
|
string |
The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id
|
string |
The immutable ID of the message. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
historyId
|
string |
The ID of the last history record that modified this message. |
Name | Data Type | Description |
---|---|---|
Message
|
object |
An email message. |
threadId
|
string |
The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
snippet
|
string |
A short part of the message text. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sizeEstimate
|
integer |
Estimated size in bytes of the message. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
raw
|
byte |
The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
payload
|
MessagePart |
The parsed email structure in the message parts. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
labelIds
|
array [string] |
List of IDs of labels applied to this message. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
internalDate
|
string |
The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id
|
string |
The immutable ID of the message. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
historyId
|
string |
The ID of the last history record that modified this message. |
Sends the specified message to the recipients in the To, Cc, and Bcc headers.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
The user's email address. The special value me can be used to indicate the authenticated user. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Name | Data Type | Description |
---|---|---|
Message
|
object |
An email message. |
threadId
|
string |
The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
snippet
|
string |
A short part of the message text. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sizeEstimate
|
integer |
Estimated size in bytes of the message. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
raw
|
byte |
The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
payload
|
MessagePart |
The parsed email structure in the message parts. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
labelIds
|
array [string] |
List of IDs of labels applied to this message. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
internalDate
|
string |
The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id
|
string |
The immutable ID of the message. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
historyId
|
string |
The ID of the last history record that modified this message. |
Name | Data Type | Description |
---|---|---|
Message
|
object |
An email message. |
threadId
|
string |
The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
snippet
|
string |
A short part of the message text. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sizeEstimate
|
integer |
Estimated size in bytes of the message. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
raw
|
byte |
The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
payload
|
MessagePart |
The parsed email structure in the message parts. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
labelIds
|
array [string] |
List of IDs of labels applied to this message. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
internalDate
|
string |
The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id
|
string |
The immutable ID of the message. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
historyId
|
string |
The ID of the last history record that modified this message. |
Modifies the labels on the specified message.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
The user's email address. The special value me can be used to indicate the authenticated user. |
id
|
string |
The ID of the message to modify. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Name | Data Type | Description |
---|---|---|
ModifyMessageRequest
|
object |
removeLabelIds
|
array [string] |
A list IDs of labels to remove from this message. |
addLabelIds
|
array [string] |
A list of IDs of labels to add to this message. |
Name | Data Type | Description |
---|---|---|
Message
|
object |
An email message. |
threadId
|
string |
The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
snippet
|
string |
A short part of the message text. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sizeEstimate
|
integer |
Estimated size in bytes of the message. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
raw
|
byte |
The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
payload
|
MessagePart |
The parsed email structure in the message parts. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
labelIds
|
array [string] |
List of IDs of labels applied to this message. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
internalDate
|
string |
The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id
|
string |
The immutable ID of the message. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
historyId
|
string |
The ID of the last history record that modified this message. |
Moves the specified message to the trash.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
The user's email address. The special value me can be used to indicate the authenticated user. |
id
|
string |
The ID of the message to Trash. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Name | Data Type | Description |
---|---|---|
Message
|
object |
An email message. |
threadId
|
string |
The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
snippet
|
string |
A short part of the message text. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sizeEstimate
|
integer |
Estimated size in bytes of the message. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
raw
|
byte |
The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
payload
|
MessagePart |
The parsed email structure in the message parts. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
labelIds
|
array [string] |
List of IDs of labels applied to this message. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
internalDate
|
string |
The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id
|
string |
The immutable ID of the message. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
historyId
|
string |
The ID of the last history record that modified this message. |
Removes the specified message from the trash.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
The user's email address. The special value me can be used to indicate the authenticated user. |
id
|
string |
The ID of the message to remove from Trash. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Name | Data Type | Description |
---|---|---|
Message
|
object |
An email message. |
threadId
|
string |
The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
snippet
|
string |
A short part of the message text. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sizeEstimate
|
integer |
Estimated size in bytes of the message. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
raw
|
byte |
The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
payload
|
MessagePart |
The parsed email structure in the message parts. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
labelIds
|
array [string] |
List of IDs of labels applied to this message. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
internalDate
|
string |
The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id
|
string |
The immutable ID of the message. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
historyId
|
string |
The ID of the last history record that modified this message. |
Immediately and permanently deletes the specified message. This operation cannot be undone. Prefer messages.trash instead.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
The user's email address. The special value me can be used to indicate the authenticated user. |
id
|
string |
The ID of the message to delete. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Gets the specified message.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
The user's email address. The special value me can be used to indicate the authenticated user. |
id
|
string |
The ID of the message to retrieve. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
metadataHeaders
|
array |
When given and format is METADATA, only include headers specified. |
format
|
string Default value: full Allowed values: - full - metadata - minimal - raw |
The format to return the message in. |
Name | Data Type | Description |
---|---|---|
Message
|
object |
An email message. |
threadId
|
string |
The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
snippet
|
string |
A short part of the message text. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sizeEstimate
|
integer |
Estimated size in bytes of the message. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
raw
|
byte |
The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
payload
|
MessagePart |
The parsed email structure in the message parts. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
labelIds
|
array [string] |
List of IDs of labels applied to this message. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
internalDate
|
string |
The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id
|
string |
The immutable ID of the message. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
historyId
|
string |
The ID of the last history record that modified this message. |
Gets the specified message attachment.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
The user's email address. The special value me can be used to indicate the authenticated user. |
messageId
|
string |
The ID of the message containing the attachment. |
id
|
string |
The ID of the attachment. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Name | Data Type | Description |
---|---|---|
MessagePartBody
|
object |
The body of a single MIME message part. |
size
|
integer |
Number of bytes for the message part data (encoding notwithstanding). |
data
|
byte |
The body data of a MIME message part as a base64url encoded string. May be empty for MIME container types that have no message body or when the body data is sent as a separate attachment. An attachment ID is present if the body data is contained in a separate attachment. |
attachmentId
|
string |
When present, contains the ID of an external attachment that can be retrieved in a separate messages.attachments.get request. When not present, the entire content of the message part body is contained in the data field. |
Lists the messages in the user's mailbox.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
The user's email address. The special value me can be used to indicate the authenticated user. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
q
|
string |
Only return messages matching the specified query. Supports the same query format as the Gmail search box. For example, "from:someuser@example.com rfc822msgid:somemsgid@example.com is:unread". Parameter cannot be used when accessing the api using the gmail.metadata scope. |
pageToken
|
string |
Page token to retrieve a specific page of results in the list. |
maxResults
|
integer Default value: 100
|
Maximum number of messages to return. |
labelIds
|
array |
Only return messages with labels that match all of the specified label IDs. |
includeSpamTrash
|
boolean Default value: false
|
Include messages from SPAM and TRASH in the results. |
Name | Data Type | Description |
---|---|---|
ListMessagesResponse
|
object |
resultSizeEstimate
|
integer |
Estimated total number of results. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
nextPageToken
|
string |
Token to retrieve the next page of results in the list. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
messages
|
array [Message] |
List of messages. Note that each message resource contains only an id and a threadId. Additional message details can be fetched using the messages.get method. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties
|
Directly inserts a message into only this user's mailbox similar to IMAP APPEND, bypassing most scanning and classification. Does not send a message.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
The user's email address. The special value me can be used to indicate the authenticated user. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
internalDateSource
|
string Default value: receivedTime Allowed values: - dateHeader - receivedTime |
Source for Gmail's internal date of the message. |
deleted
|
boolean Default value: false
|
Mark the email as permanently deleted (not TRASH) and only visible in Google Vault to a Vault administrator. Only used for G Suite accounts. |
Name | Data Type | Description |
---|---|---|
Message
|
object |
An email message. |
threadId
|
string |
The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
snippet
|
string |
A short part of the message text. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sizeEstimate
|
integer |
Estimated size in bytes of the message. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
raw
|
byte |
The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
payload
|
MessagePart |
The parsed email structure in the message parts. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
labelIds
|
array [string] |
List of IDs of labels applied to this message. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
internalDate
|
string |
The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id
|
string |
The immutable ID of the message. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
historyId
|
string |
The ID of the last history record that modified this message. |
Name | Data Type | Description |
---|---|---|
Message
|
object |
An email message. |
threadId
|
string |
The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met:
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
snippet
|
string |
A short part of the message text. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
sizeEstimate
|
integer |
Estimated size in bytes of the message. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
raw
|
byte |
The entire email message in an RFC 2822 formatted and base64url encoded string. Returned in messages.get and drafts.get responses when the format=RAW parameter is supplied. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
payload
|
MessagePart |
The parsed email structure in the message parts. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
labelIds
|
array [string] |
List of IDs of labels applied to this message. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
internalDate
|
string |
The internal message creation timestamp (epoch ms), which determines ordering in the inbox. For normal SMTP-received email, this represents the time the message was originally accepted by Google, which is more reliable than the Date header. However, for API-migrated mail, it can be configured by client to be based on the Date header. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
id
|
string |
The immutable ID of the message. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
historyId
|
string |
The ID of the last history record that modified this message. |
Gets the current user's Gmail profile.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
The user's email address. The special value me can be used to indicate the authenticated user. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Name | Data Type | Description |
---|---|---|
Profile
|
object |
Profile for a Gmail user. |
threadsTotal
|
integer |
The total number of threads in the mailbox. |
messagesTotal
|
integer |
The total number of messages in the mailbox. |
historyId
|
string |
The ID of the mailbox's current history record. |
emailAddress
|
string |
The user's email address. |
Gets the auto-forwarding setting for the specified account.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
User's email address. The special value "me" can be used to indicate the authenticated user. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Name | Data Type | Description |
---|---|---|
AutoForwarding
|
object |
Auto-forwarding settings for an account. |
enabled
|
boolean |
Whether all incoming mail is automatically forwarded to another address. |
emailAddress
|
string |
Email address to which all incoming messages are forwarded. This email address must be a verified member of the forwarding addresses. |
disposition
|
string Allowed values: - archive - dispositionUnspecified - leaveInInbox - markRead - trash |
The state that a message should be left in after it has been forwarded. |
Updates the auto-forwarding setting for the specified account. A verified forwarding address must be specified when auto-forwarding is enabled.
This method is only available to service account clients that have been delegated domain-wide authority.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
User's email address. The special value "me" can be used to indicate the authenticated user. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Name | Data Type | Description |
---|---|---|
AutoForwarding
|
object |
Auto-forwarding settings for an account. |
enabled
|
boolean |
Whether all incoming mail is automatically forwarded to another address. |
emailAddress
|
string |
Email address to which all incoming messages are forwarded. This email address must be a verified member of the forwarding addresses. |
disposition
|
string Allowed values: - archive - dispositionUnspecified - leaveInInbox - markRead - trash |
The state that a message should be left in after it has been forwarded. |
Name | Data Type | Description |
---|---|---|
AutoForwarding
|
object |
Auto-forwarding settings for an account. |
enabled
|
boolean |
Whether all incoming mail is automatically forwarded to another address. |
emailAddress
|
string |
Email address to which all incoming messages are forwarded. This email address must be a verified member of the forwarding addresses. |
disposition
|
string Allowed values: - archive - dispositionUnspecified - leaveInInbox - markRead - trash |
The state that a message should be left in after it has been forwarded. |
Removes the specified delegate (which can be of any verification status), and revokes any verification that may have been required for using it.
Note that a delegate user must be referred to by their primary email address, and not an email alias.
This method is only available to service account clients that have been delegated domain-wide authority.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
User's email address. The special value "me" can be used to indicate the authenticated user. |
delegateEmail
|
string |
The email address of the user to be removed as a delegate. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Gets the specified delegate.
Note that a delegate user must be referred to by their primary email address, and not an email alias.
This method is only available to service account clients that have been delegated domain-wide authority.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
User's email address. The special value "me" can be used to indicate the authenticated user. |
delegateEmail
|
string |
The email address of the user whose delegate relationship is to be retrieved. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Name | Data Type | Description |
---|---|---|
Delegate
|
object |
Settings for a delegate. Delegates can read, send, and delete messages, as well as view and add contacts, for the delegator's account. See "Set up mail delegation" for more information about delegates. |
verificationStatus
|
string Allowed values: - accepted - expired - pending - rejected - verificationStatusUnspecified |
Indicates whether this address has been verified and can act as a delegate for the account. Read-only. |
delegateEmail
|
string |
The email address of the delegate. |
Lists the delegates for the specified account.
This method is only available to service account clients that have been delegated domain-wide authority.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
User's email address. The special value "me" can be used to indicate the authenticated user. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Name | Data Type | Description |
---|---|---|
ListDelegatesResponse
|
object |
Response for the ListDelegates method. |
delegates
|
array [Delegate] |
List of the user's delegates (with any verification status). |
||||||||||
Properties
|
Adds a delegate with its verification status set directly to accepted, without sending any verification email. The delegate user must be a member of the same G Suite organization as the delegator user.
Gmail imposes limtations on the number of delegates and delegators each user in a G Suite organization can have. These limits depend on your organization, but in general each user can have up to 25 delegates and up to 10 delegators.
Note that a delegate user must be referred to by their primary email address, and not an email alias.
Also note that when a new delegate is created, there may be up to a one minute delay before the new delegate is available for use.
This method is only available to service account clients that have been delegated domain-wide authority.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
User's email address. The special value "me" can be used to indicate the authenticated user. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Name | Data Type | Description |
---|---|---|
Delegate
|
object |
Settings for a delegate. Delegates can read, send, and delete messages, as well as view and add contacts, for the delegator's account. See "Set up mail delegation" for more information about delegates. |
verificationStatus
|
string Allowed values: - accepted - expired - pending - rejected - verificationStatusUnspecified |
Indicates whether this address has been verified and can act as a delegate for the account. Read-only. |
delegateEmail
|
string |
The email address of the delegate. |
Name | Data Type | Description |
---|---|---|
Delegate
|
object |
Settings for a delegate. Delegates can read, send, and delete messages, as well as view and add contacts, for the delegator's account. See "Set up mail delegation" for more information about delegates. |
verificationStatus
|
string Allowed values: - accepted - expired - pending - rejected - verificationStatusUnspecified |
Indicates whether this address has been verified and can act as a delegate for the account. Read-only. |
delegateEmail
|
string |
The email address of the delegate. |
Deletes a filter.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
User's email address. The special value "me" can be used to indicate the authenticated user. |
id
|
string |
The ID of the filter to be deleted. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Gets a filter.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
User's email address. The special value "me" can be used to indicate the authenticated user. |
id
|
string |
The ID of the filter to be fetched. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Name | Data Type | Description |
---|---|---|
Filter
|
object |
Resource definition for Gmail filters. Filters apply to specific messages instead of an entire email thread. |
id
|
string |
The server assigned ID of the filter. |
|||||||||||||||||||||||||||||||
criteria
|
FilterCriteria |
Matching criteria for the filter. |
|||||||||||||||||||||||||||||||
Properties
|
|||||||||||||||||||||||||||||||||
action
|
FilterAction |
Action that the filter performs. |
|||||||||||||||||||||||||||||||
Properties
|
Lists the message filters of a Gmail user.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
User's email address. The special value "me" can be used to indicate the authenticated user. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Name | Data Type | Description |
---|---|---|
ListFiltersResponse
|
object |
Response for the ListFilters method. |
filter
|
array [Filter] |
List of a user's filters. |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Properties
|
Creates a filter.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
User's email address. The special value "me" can be used to indicate the authenticated user. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Name | Data Type | Description |
---|---|---|
Filter
|
object |
Resource definition for Gmail filters. Filters apply to specific messages instead of an entire email thread. |
id
|
string |
The server assigned ID of the filter. |
|||||||||||||||||||||||||||||||
criteria
|
FilterCriteria |
Matching criteria for the filter. |
|||||||||||||||||||||||||||||||
Properties
|
|||||||||||||||||||||||||||||||||
action
|
FilterAction |
Action that the filter performs. |
|||||||||||||||||||||||||||||||
Properties
|
Name | Data Type | Description |
---|---|---|
Filter
|
object |
Resource definition for Gmail filters. Filters apply to specific messages instead of an entire email thread. |
id
|
string |
The server assigned ID of the filter. |
|||||||||||||||||||||||||||||||
criteria
|
FilterCriteria |
Matching criteria for the filter. |
|||||||||||||||||||||||||||||||
Properties
|
|||||||||||||||||||||||||||||||||
action
|
FilterAction |
Action that the filter performs. |
|||||||||||||||||||||||||||||||
Properties
|
Deletes the specified forwarding address and revokes any verification that may have been required.
This method is only available to service account clients that have been delegated domain-wide authority.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
User's email address. The special value "me" can be used to indicate the authenticated user. |
forwardingEmail
|
string |
The forwarding address to be deleted. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Gets the specified forwarding address.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
User's email address. The special value "me" can be used to indicate the authenticated user. |
forwardingEmail
|
string |
The forwarding address to be retrieved. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Name | Data Type | Description |
---|---|---|
ForwardingAddress
|
object |
Settings for a forwarding address. |
verificationStatus
|
string Allowed values: - accepted - pending - verificationStatusUnspecified |
Indicates whether this address has been verified and is usable for forwarding. Read-only. |
forwardingEmail
|
string |
An email address to which messages can be forwarded. |
Lists the forwarding addresses for the specified account.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
User's email address. The special value "me" can be used to indicate the authenticated user. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Name | Data Type | Description |
---|---|---|
ListForwardingAddressesResponse
|
object |
Response for the ListForwardingAddresses method. |
forwardingAddresses
|
array [ForwardingAddress] |
List of addresses that may be used for forwarding. |
||||||||||
Properties
|
Creates a forwarding address. If ownership verification is required, a message will be sent to the recipient and the resource's verification status will be set to pending; otherwise, the resource will be created with verification status set to accepted.
This method is only available to service account clients that have been delegated domain-wide authority.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
User's email address. The special value "me" can be used to indicate the authenticated user. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Name | Data Type | Description |
---|---|---|
ForwardingAddress
|
object |
Settings for a forwarding address. |
verificationStatus
|
string Allowed values: - accepted - pending - verificationStatusUnspecified |
Indicates whether this address has been verified and is usable for forwarding. Read-only. |
forwardingEmail
|
string |
An email address to which messages can be forwarded. |
Name | Data Type | Description |
---|---|---|
ForwardingAddress
|
object |
Settings for a forwarding address. |
verificationStatus
|
string Allowed values: - accepted - pending - verificationStatusUnspecified |
Indicates whether this address has been verified and is usable for forwarding. Read-only. |
forwardingEmail
|
string |
An email address to which messages can be forwarded. |
Gets IMAP settings.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
User's email address. The special value "me" can be used to indicate the authenticated user. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Name | Data Type | Description |
---|---|---|
ImapSettings
|
object |
IMAP settings for an account. |
maxFolderSize
|
integer |
An optional limit on the number of messages that an IMAP folder may contain. Legal values are 0, 1000, 2000, 5000 or 10000. A value of zero is interpreted to mean that there is no limit. |
expungeBehavior
|
string Allowed values: - archive - deleteForever - expungeBehaviorUnspecified - trash |
The action that will be executed on a message when it is marked as deleted and expunged from the last visible IMAP folder. |
enabled
|
boolean |
Whether IMAP is enabled for the account. |
autoExpunge
|
boolean |
If this value is true, Gmail will immediately expunge a message when it is marked as deleted in IMAP. Otherwise, Gmail will wait for an update from the client before expunging messages marked as deleted. |
Updates IMAP settings.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
User's email address. The special value "me" can be used to indicate the authenticated user. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Name | Data Type | Description |
---|---|---|
ImapSettings
|
object |
IMAP settings for an account. |
maxFolderSize
|
integer |
An optional limit on the number of messages that an IMAP folder may contain. Legal values are 0, 1000, 2000, 5000 or 10000. A value of zero is interpreted to mean that there is no limit. |
expungeBehavior
|
string Allowed values: - archive - deleteForever - expungeBehaviorUnspecified - trash |
The action that will be executed on a message when it is marked as deleted and expunged from the last visible IMAP folder. |
enabled
|
boolean |
Whether IMAP is enabled for the account. |
autoExpunge
|
boolean |
If this value is true, Gmail will immediately expunge a message when it is marked as deleted in IMAP. Otherwise, Gmail will wait for an update from the client before expunging messages marked as deleted. |
Name | Data Type | Description |
---|---|---|
ImapSettings
|
object |
IMAP settings for an account. |
maxFolderSize
|
integer |
An optional limit on the number of messages that an IMAP folder may contain. Legal values are 0, 1000, 2000, 5000 or 10000. A value of zero is interpreted to mean that there is no limit. |
expungeBehavior
|
string Allowed values: - archive - deleteForever - expungeBehaviorUnspecified - trash |
The action that will be executed on a message when it is marked as deleted and expunged from the last visible IMAP folder. |
enabled
|
boolean |
Whether IMAP is enabled for the account. |
autoExpunge
|
boolean |
If this value is true, Gmail will immediately expunge a message when it is marked as deleted in IMAP. Otherwise, Gmail will wait for an update from the client before expunging messages marked as deleted. |
Gets language settings.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
User's email address. The special value "me" can be used to indicate the authenticated user. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Name | Data Type | Description |
---|---|---|
LanguageSettings
|
object |
Language settings for an account. These settings correspond to the "Language settings" feature in the web interface. |
displayLanguage
|
string |
The language to display Gmail in, formatted as an RFC 3066 Language Tag (for example en-GB, fr or ja for British English, French, or Japanese respectively). The set of languages supported by Gmail evolves over time, so please refer to the "Language" dropdown in the Gmail settings for all available options, as described in the language settings help article. A table of sample values is also provided in the Managing Language Settings guide Not all Gmail clients can display the same set of languages. In the case that a user's display language is not available for use on a particular client, said client automatically chooses to display in the closest supported variant (or a reasonable default). |
Updates language settings.
If successful, the return object contains the displayLanguage that was saved for the user, which may differ from the value passed into the request. This is because the requested displayLanguage may not be directly supported by Gmail but have a close variant that is, and so the variant may be chosen and saved instead.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
User's email address. The special value "me" can be used to indicate the authenticated user. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Name | Data Type | Description |
---|---|---|
LanguageSettings
|
object |
Language settings for an account. These settings correspond to the "Language settings" feature in the web interface. |
displayLanguage
|
string |
The language to display Gmail in, formatted as an RFC 3066 Language Tag (for example en-GB, fr or ja for British English, French, or Japanese respectively). The set of languages supported by Gmail evolves over time, so please refer to the "Language" dropdown in the Gmail settings for all available options, as described in the language settings help article. A table of sample values is also provided in the Managing Language Settings guide Not all Gmail clients can display the same set of languages. In the case that a user's display language is not available for use on a particular client, said client automatically chooses to display in the closest supported variant (or a reasonable default). |
Name | Data Type | Description |
---|---|---|
LanguageSettings
|
object |
Language settings for an account. These settings correspond to the "Language settings" feature in the web interface. |
displayLanguage
|
string |
The language to display Gmail in, formatted as an RFC 3066 Language Tag (for example en-GB, fr or ja for British English, French, or Japanese respectively). The set of languages supported by Gmail evolves over time, so please refer to the "Language" dropdown in the Gmail settings for all available options, as described in the language settings help article. A table of sample values is also provided in the Managing Language Settings guide Not all Gmail clients can display the same set of languages. In the case that a user's display language is not available for use on a particular client, said client automatically chooses to display in the closest supported variant (or a reasonable default). |
Gets POP settings.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
User's email address. The special value "me" can be used to indicate the authenticated user. |
Name | Data Type | Description |
---|---|---|
userIp
|
string |
Deprecated. Please use quotaUser instead. |
quotaUser
|
string |
An opaque string that represents a user for quota purposes. Must not exceed 40 characters. |
prettyPrint
|
boolean Default value: true
|
Returns response with indentations and line breaks. |
oauth_token
|
string |
OAuth 2.0 token for the current user. |
key
|
string |
API 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. |
fields
|
string |
Selector specifying which fields to include in a partial response. |
alt
|
string Default value: json Allowed values: - json |
Data format for the response. |
Name | Data Type | Description |
---|---|---|
PopSettings
|
object |
POP settings for an account. |
disposition
|
string Allowed values: - archive - dispositionUnspecified - leaveInInbox - markRead - trash |
The action that will be executed on a message after it has been fetched via POP. |
accessWindow
|
string Allowed values: - accessWindowUnspecified - allMail - disabled - fromNowOn |
The range of messages which are accessible via POP. |
Updates POP settings.
Name | Data Type | Description |
---|---|---|
userId
|
string Default value: me
|
User's email address. The special value "me" can be used to indicate the authenticated user. |