"description":"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.",
"description":"Available to use for quota purposes for server-side applications. Can be any arbitrary string assigned to a user, but should not exceed 40 characters. Overrides userIp if both are provided.",
"description":"The user's email address. The special value me can be used to indicate the authenticated user.",
"location":"path",
"required":true,
"type":"string"
}
},
"path":"{userId}/drafts",
"request":{
"$ref":"Draft"
},
"response":{
"$ref":"Draft"
},
"scopes":[
"https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.compose",
"https://www.googleapis.com/auth/gmail.modify"
],
"supportsMediaUpload":true
},
"delete":{
"description":"Immediately and permanently deletes the specified draft. Does not simply trash it.",
"httpMethod":"DELETE",
"id":"gmail.users.drafts.delete",
"parameterOrder":[
"userId",
"id"
],
"parameters":{
"id":{
"description":"The ID of the draft to delete.",
"location":"path",
"required":true,
"type":"string"
},
"userId":{
"default":"me",
"description":"The user's email address. The special value me can be used to indicate the authenticated user.",
"location":"path",
"required":true,
"type":"string"
}
},
"path":"{userId}/drafts/{id}",
"scopes":[
"https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.compose",
"https://www.googleapis.com/auth/gmail.modify"
]
},
"get":{
"description":"Gets the specified draft.",
"httpMethod":"GET",
"id":"gmail.users.drafts.get",
"parameterOrder":[
"userId",
"id"
],
"parameters":{
"format":{
"default":"full",
"description":"The format to return the draft in.",
"enum":[
"full",
"metadata",
"minimal",
"raw"
],
"enumDescriptions":[
"",
"",
"",
""
],
"location":"query",
"type":"string"
},
"id":{
"description":"The ID of the draft to retrieve.",
"location":"path",
"required":true,
"type":"string"
},
"userId":{
"default":"me",
"description":"The user's email address. The special value me can be used to indicate the authenticated user.",
"location":"path",
"required":true,
"type":"string"
}
},
"path":"{userId}/drafts/{id}",
"response":{
"$ref":"Draft"
},
"scopes":[
"https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.compose",
"https://www.googleapis.com/auth/gmail.modify",
"https://www.googleapis.com/auth/gmail.readonly"
]
},
"list":{
"description":"Lists the drafts in the user's mailbox.",
"httpMethod":"GET",
"id":"gmail.users.drafts.list",
"parameterOrder":[
"userId"
],
"parameters":{
"includeSpamTrash":{
"default":"false",
"description":"Include drafts from SPAM and TRASH in the results.",
"location":"query",
"type":"boolean"
},
"maxResults":{
"default":"100",
"description":"Maximum number of drafts to return.",
"format":"uint32",
"location":"query",
"type":"integer"
},
"pageToken":{
"description":"Page token to retrieve a specific page of results in the list.",
"location":"query",
"type":"string"
},
"q":{
"description":"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\".",
"location":"query",
"type":"string"
},
"userId":{
"default":"me",
"description":"The user's email address. The special value me can be used to indicate the authenticated user.",
"location":"path",
"required":true,
"type":"string"
}
},
"path":"{userId}/drafts",
"response":{
"$ref":"ListDraftsResponse"
},
"scopes":[
"https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.compose",
"https://www.googleapis.com/auth/gmail.modify",
"https://www.googleapis.com/auth/gmail.readonly"
]
},
"send":{
"description":"Sends the specified, existing draft to the recipients in the To, Cc, and Bcc headers.",
"description":"The user's email address. The special value me can be used to indicate the authenticated user.",
"location":"path",
"required":true,
"type":"string"
}
},
"path":"{userId}/drafts/{id}",
"request":{
"$ref":"Draft"
},
"response":{
"$ref":"Draft"
},
"scopes":[
"https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.compose",
"https://www.googleapis.com/auth/gmail.modify"
],
"supportsMediaUpload":true
}
}
},
"history":{
"methods":{
"list":{
"description":"Lists the history of all changes to the given mailbox. History results are returned in chronological order (increasing historyId).",
"httpMethod":"GET",
"id":"gmail.users.history.list",
"parameterOrder":[
"userId"
],
"parameters":{
"historyTypes":{
"description":"History types to be returned by the function",
"enum":[
"labelAdded",
"labelRemoved",
"messageAdded",
"messageDeleted"
],
"enumDescriptions":[
"",
"",
"",
""
],
"location":"query",
"repeated":true,
"type":"string"
},
"labelId":{
"description":"Only return messages with a label matching the ID.",
"location":"query",
"type":"string"
},
"maxResults":{
"default":"100",
"description":"The maximum number of history records to return.",
"format":"uint32",
"location":"query",
"type":"integer"
},
"pageToken":{
"description":"Page token to retrieve a specific page of results in the list.",
"location":"query",
"type":"string"
},
"startHistoryId":{
"description":"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.",
"format":"uint64",
"location":"query",
"type":"string"
},
"userId":{
"default":"me",
"description":"The user's email address. The special value me can be used to indicate the authenticated user.",
"location":"path",
"required":true,
"type":"string"
}
},
"path":"{userId}/history",
"response":{
"$ref":"ListHistoryResponse"
},
"scopes":[
"https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.metadata",
"https://www.googleapis.com/auth/gmail.modify",
"https://www.googleapis.com/auth/gmail.readonly"
]
}
}
},
"labels":{
"methods":{
"create":{
"description":"Creates a new label.",
"httpMethod":"POST",
"id":"gmail.users.labels.create",
"parameterOrder":[
"userId"
],
"parameters":{
"userId":{
"default":"me",
"description":"The user's email address. The special value me can be used to indicate the authenticated user.",
"location":"path",
"required":true,
"type":"string"
}
},
"path":"{userId}/labels",
"request":{
"$ref":"Label"
},
"response":{
"$ref":"Label"
},
"scopes":[
"https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.labels",
"https://www.googleapis.com/auth/gmail.modify"
]
},
"delete":{
"description":"Immediately and permanently deletes the specified label and removes it from any messages and threads that it is applied to.",
"httpMethod":"DELETE",
"id":"gmail.users.labels.delete",
"parameterOrder":[
"userId",
"id"
],
"parameters":{
"id":{
"description":"The ID of the label to delete.",
"location":"path",
"required":true,
"type":"string"
},
"userId":{
"default":"me",
"description":"The user's email address. The special value me can be used to indicate the authenticated user.",
"location":"path",
"required":true,
"type":"string"
}
},
"path":"{userId}/labels/{id}",
"scopes":[
"https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.labels",
"https://www.googleapis.com/auth/gmail.modify"
]
},
"get":{
"description":"Gets the specified label.",
"httpMethod":"GET",
"id":"gmail.users.labels.get",
"parameterOrder":[
"userId",
"id"
],
"parameters":{
"id":{
"description":"The ID of the label to retrieve.",
"location":"path",
"required":true,
"type":"string"
},
"userId":{
"default":"me",
"description":"The user's email address. The special value me can be used to indicate the authenticated user.",
"location":"path",
"required":true,
"type":"string"
}
},
"path":"{userId}/labels/{id}",
"response":{
"$ref":"Label"
},
"scopes":[
"https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.labels",
"https://www.googleapis.com/auth/gmail.metadata",
"https://www.googleapis.com/auth/gmail.modify",
"https://www.googleapis.com/auth/gmail.readonly"
]
},
"list":{
"description":"Lists all labels in the user's mailbox.",
"httpMethod":"GET",
"id":"gmail.users.labels.list",
"parameterOrder":[
"userId"
],
"parameters":{
"userId":{
"default":"me",
"description":"The user's email address. The special value me can be used to indicate the authenticated user.",
"location":"path",
"required":true,
"type":"string"
}
},
"path":"{userId}/labels",
"response":{
"$ref":"ListLabelsResponse"
},
"scopes":[
"https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.labels",
"https://www.googleapis.com/auth/gmail.metadata",
"https://www.googleapis.com/auth/gmail.modify",
"https://www.googleapis.com/auth/gmail.readonly"
]
},
"patch":{
"description":"Updates the specified label. This method supports patch semantics.",
"httpMethod":"PATCH",
"id":"gmail.users.labels.patch",
"parameterOrder":[
"userId",
"id"
],
"parameters":{
"id":{
"description":"The ID of the label to update.",
"location":"path",
"required":true,
"type":"string"
},
"userId":{
"default":"me",
"description":"The user's email address. The special value me can be used to indicate the authenticated user.",
"location":"path",
"required":true,
"type":"string"
}
},
"path":"{userId}/labels/{id}",
"request":{
"$ref":"Label"
},
"response":{
"$ref":"Label"
},
"scopes":[
"https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.labels",
"https://www.googleapis.com/auth/gmail.modify"
]
},
"update":{
"description":"Updates the specified label.",
"httpMethod":"PUT",
"id":"gmail.users.labels.update",
"parameterOrder":[
"userId",
"id"
],
"parameters":{
"id":{
"description":"The ID of the label to update.",
"location":"path",
"required":true,
"type":"string"
},
"userId":{
"default":"me",
"description":"The user's email address. The special value me can be used to indicate the authenticated user.",
"location":"path",
"required":true,
"type":"string"
}
},
"path":"{userId}/labels/{id}",
"request":{
"$ref":"Label"
},
"response":{
"$ref":"Label"
},
"scopes":[
"https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.labels",
"https://www.googleapis.com/auth/gmail.modify"
]
}
}
},
"messages":{
"methods":{
"batchDelete":{
"description":"Deletes many messages by message ID. Provides no guarantees that messages were not already deleted or even existed at all.",
"httpMethod":"POST",
"id":"gmail.users.messages.batchDelete",
"parameterOrder":[
"userId"
],
"parameters":{
"userId":{
"default":"me",
"description":"The user's email address. The special value me can be used to indicate the authenticated user.",
"location":"path",
"required":true,
"type":"string"
}
},
"path":"{userId}/messages/batchDelete",
"request":{
"$ref":"BatchDeleteMessagesRequest"
},
"scopes":[
"https://mail.google.com/"
]
},
"batchModify":{
"description":"Modifies the labels on the specified messages.",
"httpMethod":"POST",
"id":"gmail.users.messages.batchModify",
"parameterOrder":[
"userId"
],
"parameters":{
"userId":{
"default":"me",
"description":"The user's email address. The special value me can be used to indicate the authenticated user.",
"location":"path",
"required":true,
"type":"string"
}
},
"path":"{userId}/messages/batchModify",
"request":{
"$ref":"BatchModifyMessagesRequest"
},
"scopes":[
"https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.modify"
]
},
"delete":{
"description":"Immediately and permanently deletes the specified message. This operation cannot be undone. Prefer messages.trash instead.",
"httpMethod":"DELETE",
"id":"gmail.users.messages.delete",
"parameterOrder":[
"userId",
"id"
],
"parameters":{
"id":{
"description":"The ID of the message to delete.",
"location":"path",
"required":true,
"type":"string"
},
"userId":{
"default":"me",
"description":"The user's email address. The special value me can be used to indicate the authenticated user.",
"location":"path",
"required":true,
"type":"string"
}
},
"path":"{userId}/messages/{id}",
"scopes":[
"https://mail.google.com/"
]
},
"get":{
"description":"Gets the specified message.",
"httpMethod":"GET",
"id":"gmail.users.messages.get",
"parameterOrder":[
"userId",
"id"
],
"parameters":{
"format":{
"default":"full",
"description":"The format to return the message in.",
"enum":[
"full",
"metadata",
"minimal",
"raw"
],
"enumDescriptions":[
"",
"",
"",
""
],
"location":"query",
"type":"string"
},
"id":{
"description":"The ID of the message to retrieve.",
"location":"path",
"required":true,
"type":"string"
},
"metadataHeaders":{
"description":"When given and format is METADATA, only include headers specified.",
"location":"query",
"repeated":true,
"type":"string"
},
"userId":{
"default":"me",
"description":"The user's email address. The special value me can be used to indicate the authenticated user.",
"location":"path",
"required":true,
"type":"string"
}
},
"path":"{userId}/messages/{id}",
"response":{
"$ref":"Message"
},
"scopes":[
"https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.metadata",
"https://www.googleapis.com/auth/gmail.modify",
"https://www.googleapis.com/auth/gmail.readonly"
]
},
"import":{
"description":"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.",
"description":"Mark the email as permanently deleted (not TRASH) and only visible in Google Vault to a Vault administrator. Only used for G Suite accounts.",
"location":"query",
"type":"boolean"
},
"internalDateSource":{
"default":"dateHeader",
"description":"Source for Gmail's internal date of the message.",
"enum":[
"dateHeader",
"receivedTime"
],
"enumDescriptions":[
"",
""
],
"location":"query",
"type":"string"
},
"neverMarkSpam":{
"default":"false",
"description":"Ignore the Gmail spam classifier decision and never mark this email as SPAM in the mailbox.",
"location":"query",
"type":"boolean"
},
"processForCalendar":{
"default":"false",
"description":"Process calendar invites in the email and add any extracted meetings to the Google Calendar for this user.",
"location":"query",
"type":"boolean"
},
"userId":{
"default":"me",
"description":"The user's email address. The special value me can be used to indicate the authenticated user.",
"location":"path",
"required":true,
"type":"string"
}
},
"path":"{userId}/messages/import",
"request":{
"$ref":"Message"
},
"response":{
"$ref":"Message"
},
"scopes":[
"https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.insert",
"https://www.googleapis.com/auth/gmail.modify"
],
"supportsMediaUpload":true
},
"insert":{
"description":"Directly inserts a message into only this user's mailbox similar to IMAP APPEND, bypassing most scanning and classification. Does not send a message.",
"description":"Mark the email as permanently deleted (not TRASH) and only visible in Google Vault to a Vault administrator. Only used for G Suite accounts.",
"location":"query",
"type":"boolean"
},
"internalDateSource":{
"default":"receivedTime",
"description":"Source for Gmail's internal date of the message.",
"enum":[
"dateHeader",
"receivedTime"
],
"enumDescriptions":[
"",
""
],
"location":"query",
"type":"string"
},
"userId":{
"default":"me",
"description":"The user's email address. The special value me can be used to indicate the authenticated user.",
"location":"path",
"required":true,
"type":"string"
}
},
"path":"{userId}/messages",
"request":{
"$ref":"Message"
},
"response":{
"$ref":"Message"
},
"scopes":[
"https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.insert",
"https://www.googleapis.com/auth/gmail.modify"
],
"supportsMediaUpload":true
},
"list":{
"description":"Lists the messages in the user's mailbox.",
"httpMethod":"GET",
"id":"gmail.users.messages.list",
"parameterOrder":[
"userId"
],
"parameters":{
"includeSpamTrash":{
"default":"false",
"description":"Include messages from SPAM and TRASH in the results.",
"location":"query",
"type":"boolean"
},
"labelIds":{
"description":"Only return messages with labels that match all of the specified label IDs.",
"location":"query",
"repeated":true,
"type":"string"
},
"maxResults":{
"default":"100",
"description":"Maximum number of messages to return.",
"format":"uint32",
"location":"query",
"type":"integer"
},
"pageToken":{
"description":"Page token to retrieve a specific page of results in the list.",
"location":"query",
"type":"string"
},
"q":{
"description":"Only return messages matching the specified query. Supports the same query format as the Gmail search box. For example, \"from:someuser@example.com rfc822msgid:\u003csomemsgid@example.com\u003e is:unread\". Parameter cannot be used when accessing the api using the gmail.metadata scope.",
"location":"query",
"type":"string"
},
"userId":{
"default":"me",
"description":"The user's email address. The special value me can be used to indicate the authenticated user.",
"location":"path",
"required":true,
"type":"string"
}
},
"path":"{userId}/messages",
"response":{
"$ref":"ListMessagesResponse"
},
"scopes":[
"https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.metadata",
"https://www.googleapis.com/auth/gmail.modify",
"https://www.googleapis.com/auth/gmail.readonly"
]
},
"modify":{
"description":"Modifies the labels on the specified message.",
"httpMethod":"POST",
"id":"gmail.users.messages.modify",
"parameterOrder":[
"userId",
"id"
],
"parameters":{
"id":{
"description":"The ID of the message to modify.",
"location":"path",
"required":true,
"type":"string"
},
"userId":{
"default":"me",
"description":"The user's email address. The special value me can be used to indicate the authenticated user.",
"location":"path",
"required":true,
"type":"string"
}
},
"path":"{userId}/messages/{id}/modify",
"request":{
"$ref":"ModifyMessageRequest"
},
"response":{
"$ref":"Message"
},
"scopes":[
"https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.modify"
]
},
"send":{
"description":"Sends the specified message to the recipients in the To, Cc, and Bcc headers.",
"description":"Updates the auto-forwarding setting for the specified account. A verified forwarding address must be specified when auto-forwarding is enabled.\n\nThis method is only available to service account clients that have been delegated domain-wide authority.",
"httpMethod":"PUT",
"id":"gmail.users.settings.updateAutoForwarding",
"parameterOrder":[
"userId"
],
"parameters":{
"userId":{
"default":"me",
"description":"User's email address. The special value \"me\" can be used to indicate the authenticated user.",
"description":"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.\n\nThis method is only available to service account clients that have been delegated domain-wide authority.",
"description":"Deletes the specified forwarding address and revokes any verification that may have been required.\n\nThis method is only available to service account clients that have been delegated domain-wide authority.",
"description":"Creates a custom \"from\" send-as alias. If an SMTP MSA is specified, Gmail will attempt to connect to the SMTP service to validate the configuration before creating the alias. If ownership verification is required for the alias, a message will be sent to the email address and the resource's verification status will be set to pending; otherwise, the resource will be created with verification status set to accepted. If a signature is provided, Gmail will sanitize the HTML before saving it with the alias.\n\nThis method is only available to service account clients that have been delegated domain-wide authority.",
"httpMethod":"POST",
"id":"gmail.users.settings.sendAs.create",
"parameterOrder":[
"userId"
],
"parameters":{
"userId":{
"default":"me",
"description":"User's email address. The special value \"me\" can be used to indicate the authenticated user.",
"description":"Deletes the specified send-as alias. Revokes any verification that may have been required for using it.\n\nThis method is only available to service account clients that have been delegated domain-wide authority.",
"httpMethod":"DELETE",
"id":"gmail.users.settings.sendAs.delete",
"parameterOrder":[
"userId",
"sendAsEmail"
],
"parameters":{
"sendAsEmail":{
"description":"The send-as alias to be deleted.",
"location":"path",
"required":true,
"type":"string"
},
"userId":{
"default":"me",
"description":"User's email address. The special value \"me\" can be used to indicate the authenticated user.",
"description":"Lists the send-as aliases for the specified account. The result includes the primary send-as address associated with the account as well as any custom \"from\" aliases.",
"httpMethod":"GET",
"id":"gmail.users.settings.sendAs.list",
"parameterOrder":[
"userId"
],
"parameters":{
"userId":{
"default":"me",
"description":"User's email address. The special value \"me\" can be used to indicate the authenticated user.",
"description":"Updates a send-as alias. If a signature is provided, Gmail will sanitize the HTML before saving it with the alias.\n\nAddresses other than the primary address for the account can only be updated by service account clients that have been delegated domain-wide authority. This method supports patch semantics.",
"httpMethod":"PATCH",
"id":"gmail.users.settings.sendAs.patch",
"parameterOrder":[
"userId",
"sendAsEmail"
],
"parameters":{
"sendAsEmail":{
"description":"The send-as alias to be updated.",
"location":"path",
"required":true,
"type":"string"
},
"userId":{
"default":"me",
"description":"User's email address. The special value \"me\" can be used to indicate the authenticated user.",
"description":"Updates a send-as alias. If a signature is provided, Gmail will sanitize the HTML before saving it with the alias.\n\nAddresses other than the primary address for the account can only be updated by service account clients that have been delegated domain-wide authority.",
"httpMethod":"PUT",
"id":"gmail.users.settings.sendAs.update",
"parameterOrder":[
"userId",
"sendAsEmail"
],
"parameters":{
"sendAsEmail":{
"description":"The send-as alias to be updated.",
"location":"path",
"required":true,
"type":"string"
},
"userId":{
"default":"me",
"description":"User's email address. The special value \"me\" can be used to indicate the authenticated user.",
"description":"Sends a verification email to the specified send-as alias address. The verification status must be pending.\n\nThis method is only available to service account clients that have been delegated domain-wide authority.",
"httpMethod":"POST",
"id":"gmail.users.settings.sendAs.verify",
"parameterOrder":[
"userId",
"sendAsEmail"
],
"parameters":{
"sendAsEmail":{
"description":"The send-as alias to be verified.",
"location":"path",
"required":true,
"type":"string"
},
"userId":{
"default":"me",
"description":"User's email address. The special value \"me\" can be used to indicate the authenticated user.",
"description":"Immediately and permanently deletes the specified thread. This operation cannot be undone. Prefer threads.trash instead.",
"httpMethod":"DELETE",
"id":"gmail.users.threads.delete",
"parameterOrder":[
"userId",
"id"
],
"parameters":{
"id":{
"description":"ID of the Thread to delete.",
"location":"path",
"required":true,
"type":"string"
},
"userId":{
"default":"me",
"description":"The user's email address. The special value me can be used to indicate the authenticated user.",
"location":"path",
"required":true,
"type":"string"
}
},
"path":"{userId}/threads/{id}",
"scopes":[
"https://mail.google.com/"
]
},
"get":{
"description":"Gets the specified thread.",
"httpMethod":"GET",
"id":"gmail.users.threads.get",
"parameterOrder":[
"userId",
"id"
],
"parameters":{
"format":{
"default":"full",
"description":"The format to return the messages in.",
"enum":[
"full",
"metadata",
"minimal"
],
"enumDescriptions":[
"",
"",
""
],
"location":"query",
"type":"string"
},
"id":{
"description":"The ID of the thread to retrieve.",
"location":"path",
"required":true,
"type":"string"
},
"metadataHeaders":{
"description":"When given and format is METADATA, only include headers specified.",
"location":"query",
"repeated":true,
"type":"string"
},
"userId":{
"default":"me",
"description":"The user's email address. The special value me can be used to indicate the authenticated user.",
"location":"path",
"required":true,
"type":"string"
}
},
"path":"{userId}/threads/{id}",
"response":{
"$ref":"Thread"
},
"scopes":[
"https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.metadata",
"https://www.googleapis.com/auth/gmail.modify",
"https://www.googleapis.com/auth/gmail.readonly"
]
},
"list":{
"description":"Lists the threads in the user's mailbox.",
"httpMethod":"GET",
"id":"gmail.users.threads.list",
"parameterOrder":[
"userId"
],
"parameters":{
"includeSpamTrash":{
"default":"false",
"description":"Include threads from SPAM and TRASH in the results.",
"location":"query",
"type":"boolean"
},
"labelIds":{
"description":"Only return threads with labels that match all of the specified label IDs.",
"location":"query",
"repeated":true,
"type":"string"
},
"maxResults":{
"default":"100",
"description":"Maximum number of threads to return.",
"format":"uint32",
"location":"query",
"type":"integer"
},
"pageToken":{
"description":"Page token to retrieve a specific page of results in the list.",
"location":"query",
"type":"string"
},
"q":{
"description":"Only return threads matching the specified query. Supports the same query format as the Gmail search box. For example, \"from:someuser@example.com rfc822msgid: is:unread\". Parameter cannot be used when accessing the api using the gmail.metadata scope.",
"location":"query",
"type":"string"
},
"userId":{
"default":"me",
"description":"The user's email address. The special value me can be used to indicate the authenticated user.",
"location":"path",
"required":true,
"type":"string"
}
},
"path":"{userId}/threads",
"response":{
"$ref":"ListThreadsResponse"
},
"scopes":[
"https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.metadata",
"https://www.googleapis.com/auth/gmail.modify",
"https://www.googleapis.com/auth/gmail.readonly"
]
},
"modify":{
"description":"Modifies the labels applied to the thread. This applies to all messages in the thread.",
"httpMethod":"POST",
"id":"gmail.users.threads.modify",
"parameterOrder":[
"userId",
"id"
],
"parameters":{
"id":{
"description":"The ID of the thread to modify.",
"location":"path",
"required":true,
"type":"string"
},
"userId":{
"default":"me",
"description":"The user's email address. The special value me can be used to indicate the authenticated user.",
"location":"path",
"required":true,
"type":"string"
}
},
"path":"{userId}/threads/{id}/modify",
"request":{
"$ref":"ModifyThreadRequest"
},
"response":{
"$ref":"Thread"
},
"scopes":[
"https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.modify"
]
},
"trash":{
"description":"Moves the specified thread to the trash.",
"httpMethod":"POST",
"id":"gmail.users.threads.trash",
"parameterOrder":[
"userId",
"id"
],
"parameters":{
"id":{
"description":"The ID of the thread to Trash.",
"location":"path",
"required":true,
"type":"string"
},
"userId":{
"default":"me",
"description":"The user's email address. The special value me can be used to indicate the authenticated user.",
"location":"path",
"required":true,
"type":"string"
}
},
"path":"{userId}/threads/{id}/trash",
"response":{
"$ref":"Thread"
},
"scopes":[
"https://mail.google.com/",
"https://www.googleapis.com/auth/gmail.modify"
]
},
"untrash":{
"description":"Removes the specified thread from the trash.",
"httpMethod":"POST",
"id":"gmail.users.threads.untrash",
"parameterOrder":[
"userId",
"id"
],
"parameters":{
"id":{
"description":"The ID of the thread to remove from Trash.",
"location":"path",
"required":true,
"type":"string"
},
"userId":{
"default":"me",
"description":"The user's email address. The special value me can be used to indicate the authenticated user.",
"description":"Whether the response should exclude chats.",
"type":"boolean"
},
"from":{
"description":"The sender's display name or email address.",
"type":"string"
},
"hasAttachment":{
"description":"Whether the message has any attachment.",
"type":"boolean"
},
"negatedQuery":{
"description":"Only return messages not matching the specified query. Supports the same query format as the Gmail search box. For example, \"from:someuser@example.com rfc822msgid: is:unread\".",
"type":"string"
},
"query":{
"description":"Only return messages matching the specified query. Supports the same query format as the Gmail search box. For example, \"from:someuser@example.com rfc822msgid: is:unread\".",
"type":"string"
},
"size":{
"description":"The size of the entire RFC822 message in bytes, including all headers and attachments.",
"format":"int32",
"type":"integer"
},
"sizeComparison":{
"description":"How the message size in bytes should be in relation to the size field.",
"enum":[
"larger",
"smaller",
"unspecified"
],
"enumDescriptions":[
"",
"",
""
],
"type":"string"
},
"subject":{
"description":"Case-insensitive phrase found in the message's subject. Trailing and leading whitespace are be trimmed and adjacent spaces are collapsed.",
"type":"string"
},
"to":{
"description":"The recipient's display name or email address. Includes recipients in the \"to\", \"cc\", and \"bcc\" header fields. You can use simply the local part of the email address. For example, \"example\" and \"example@\" both match \"example@gmail.com\". This field is case-insensitive.",
"description":"Labels added to messages in this history record.",
"items":{
"$ref":"HistoryLabelAdded"
},
"type":"array"
},
"labelsRemoved":{
"description":"Labels removed from messages in this history record.",
"items":{
"$ref":"HistoryLabelRemoved"
},
"type":"array"
},
"messages":{
"description":"List of messages changed in this history record. The fields for specific change types, such as messagesAdded may duplicate messages in this field. We recommend using the specific change-type fields instead of this.",
"items":{
"$ref":"Message"
},
"type":"array"
},
"messagesAdded":{
"description":"Messages added to the mailbox in this history record.",
"items":{
"$ref":"HistoryMessageAdded"
},
"type":"array"
},
"messagesDeleted":{
"description":"Messages deleted (not Trashed) from the mailbox in this history record.",
"description":"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.",
"type":"boolean"
},
"enabled":{
"description":"Whether IMAP is enabled for the account.",
"type":"boolean"
},
"expungeBehavior":{
"description":"The action that will be executed on a message when it is marked as deleted and expunged from the last visible IMAP folder.",
"enum":[
"archive",
"deleteForever",
"expungeBehaviorUnspecified",
"trash"
],
"enumDescriptions":[
"",
"",
"",
""
],
"type":"string"
},
"maxFolderSize":{
"description":"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.",
"description":"The visibility of the label in the label list in the Gmail web interface.",
"enum":[
"labelHide",
"labelShow",
"labelShowIfUnread"
],
"enumDescriptions":[
"",
"",
""
],
"type":"string"
},
"messageListVisibility":{
"annotations":{
"required":[
"gmail.users.labels.create",
"gmail.users.labels.update"
]
},
"description":"The visibility of the label in the message list in the Gmail web interface.",
"enum":[
"hide",
"show"
],
"enumDescriptions":[
"",
""
],
"type":"string"
},
"messagesTotal":{
"description":"The total number of messages with the label.",
"format":"int32",
"type":"integer"
},
"messagesUnread":{
"description":"The number of unread messages with the label.",
"format":"int32",
"type":"integer"
},
"name":{
"annotations":{
"required":[
"gmail.users.labels.create",
"gmail.users.labels.update"
]
},
"description":"The display name of the label.",
"type":"string"
},
"threadsTotal":{
"description":"The total number of threads with the label.",
"format":"int32",
"type":"integer"
},
"threadsUnread":{
"description":"The number of unread threads with the label.",
"format":"int32",
"type":"integer"
},
"type":{
"description":"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.",
"description":"The background color represented as hex string #RRGGBB (ex #000000). This field is required in order to set the color of a label. Only the following predefined set of color values are allowed:\n#000000, #434343, #666666, #999999, #cccccc, #efefef, #f3f3f3, #ffffff, #fb4c2f, #ffad47, #fad165, #16a766, #43d692, #4a86e8, #a479e2, #f691b3, #f6c5be, #ffe6c7, #fef1d1, #b9e4d0, #c6f3de, #c9daf8, #e4d7f5, #fcdee8, #efa093, #ffd6a2, #fce8b3, #89d3b2, #a0eac9, #a4c2f4, #d0bcf1, #fbc8d9, #e66550, #ffbc6b, #fcda83, #44b984, #68dfa9, #6d9eeb, #b694e8, #f7a7c0, #cc3a21, #eaa041, #f2c960, #149e60, #3dc789, #3c78d8, #8e63ce, #e07798, #ac2b16, #cf8933, #d5ae49, #0b804b, #2a9c68, #285bac, #653e9b, #b65775, #822111, #a46a21, #aa8831, #076239, #1a764d, #1c4587, #41236d, #83334c",
"description":"The text color of the label, represented as hex string. This field is required in order to set the color of a label. Only the following predefined set of color values are allowed:\n#000000, #434343, #666666, #999999, #cccccc, #efefef, #f3f3f3, #ffffff, #fb4c2f, #ffad47, #fad165, #16a766, #43d692, #4a86e8, #a479e2, #f691b3, #f6c5be, #ffe6c7, #fef1d1, #b9e4d0, #c6f3de, #c9daf8, #e4d7f5, #fcdee8, #efa093, #ffd6a2, #fce8b3, #89d3b2, #a0eac9, #a4c2f4, #d0bcf1, #fbc8d9, #e66550, #ffbc6b, #fcda83, #44b984, #68dfa9, #6d9eeb, #b694e8, #f7a7c0, #cc3a21, #eaa041, #f2c960, #149e60, #3dc789, #3c78d8, #8e63ce, #e07798, #ac2b16, #cf8933, #d5ae49, #0b804b, #2a9c68, #285bac, #653e9b, #b65775, #822111, #a46a21, #aa8831, #076239, #1a764d, #1c4587, #41236d, #83334c",
"description":"The ID of the last history record that modified this message.",
"format":"uint64",
"type":"string"
},
"id":{
"description":"The immutable ID of the message.",
"type":"string"
},
"internalDate":{
"description":"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.",
"format":"int64",
"type":"string"
},
"labelIds":{
"description":"List of IDs of labels applied to this message.",
"items":{
"type":"string"
},
"type":"array"
},
"payload":{
"$ref":"MessagePart",
"description":"The parsed email structure in the message parts."
},
"raw":{
"annotations":{
"required":[
"gmail.users.drafts.create",
"gmail.users.drafts.update",
"gmail.users.messages.insert",
"gmail.users.messages.send"
]
},
"description":"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.",
"format":"byte",
"type":"string"
},
"sizeEstimate":{
"description":"Estimated size in bytes of the message.",
"format":"int32",
"type":"integer"
},
"snippet":{
"description":"A short part of the message text.",
"type":"string"
},
"threadId":{
"description":"The ID of the thread the message belongs to. To add a message or draft to a thread, the following criteria must be met: \n- The requested threadId must be specified on the Message or Draft.Message you supply with your request. \n- The References and In-Reply-To headers must be set in compliance with the RFC 2822 standard. \n- The Subject headers must match.",
"description":"The message part body for this part, which may be empty for container MIME message parts."
},
"filename":{
"description":"The filename of the attachment. Only present if this message part represents an attachment.",
"type":"string"
},
"headers":{
"description":"List of headers on this message part. For the top-level message part, representing the entire message payload, it will contain the standard RFC 2822 email headers such as To, From, and Subject.",
"items":{
"$ref":"MessagePartHeader"
},
"type":"array"
},
"mimeType":{
"description":"The MIME type of the message part.",
"type":"string"
},
"partId":{
"description":"The immutable ID of the message part.",
"type":"string"
},
"parts":{
"description":"The child MIME message parts of this part. This only applies to container MIME message parts, for example multipart/*. For non- container MIME message part types, such as text/plain, this field is empty. For more information, see RFC 1521.",
"description":"The body of a single MIME message part.",
"id":"MessagePartBody",
"properties":{
"attachmentId":{
"description":"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.",
"type":"string"
},
"data":{
"description":"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.",
"format":"byte",
"type":"string"
},
"size":{
"description":"Number of bytes for the message part data (encoding notwithstanding).",
"description":"Settings associated with a send-as alias, which can be either the primary login address associated with the account or a custom \"from\" address. Send-as aliases correspond to the \"Send Mail As\" feature in the web interface.",
"id":"SendAs",
"properties":{
"displayName":{
"description":"A name that appears in the \"From:\" header for mail sent using this alias. For custom \"from\" addresses, when this is empty, Gmail will populate the \"From:\" header with the name that is used for the primary address associated with the account. If the admin has disabled the ability for users to update their name format, requests to update this field for the primary login will silently fail.",
"type":"string"
},
"isDefault":{
"description":"Whether this address is selected as the default \"From:\" address in situations such as composing a new message or sending a vacation auto-reply. Every Gmail account has exactly one default send-as address, so the only legal value that clients may write to this field is true. Changing this from false to true for an address will result in this field becoming false for the other previous default address.",
"type":"boolean"
},
"isPrimary":{
"description":"Whether this address is the primary address used to login to the account. Every Gmail account has exactly one primary address, and it cannot be deleted from the collection of send-as aliases. This field is read-only.",
"type":"boolean"
},
"replyToAddress":{
"description":"An optional email address that is included in a \"Reply-To:\" header for mail sent using this alias. If this is empty, Gmail will not generate a \"Reply-To:\" header.",
"type":"string"
},
"sendAsEmail":{
"description":"The email address that appears in the \"From:\" header for mail sent using this alias. This is read-only for all operations except create.",
"type":"string"
},
"signature":{
"description":"An optional HTML signature that is included in messages composed with this alias in the Gmail web UI.",
"type":"string"
},
"smtpMsa":{
"$ref":"SmtpMsa",
"description":"An optional SMTP service that will be used as an outbound relay for mail sent using this alias. If this is empty, outbound mail will be sent directly from Gmail's servers to the destination SMTP service. This setting only applies to custom \"from\" aliases."
},
"treatAsAlias":{
"description":"Whether Gmail should treat this address as an alias for the user's primary email address. This setting only applies to custom \"from\" aliases.",
"type":"boolean"
},
"verificationStatus":{
"description":"Indicates whether this address has been verified for use as a send-as alias. Read-only. This setting only applies to custom \"from\" aliases.",
"description":"The immutable ID for the SmimeInfo.",
"type":"string"
},
"isDefault":{
"description":"Whether this SmimeInfo is the default one for this user's send-as address.",
"type":"boolean"
},
"issuerCn":{
"description":"The S/MIME certificate issuer's common name.",
"type":"string"
},
"pem":{
"description":"PEM formatted X509 concatenated certificate string (standard base64 encoding). Format used for returning key, which includes public key as well as certificate chain (not private key).",
"type":"string"
},
"pkcs12":{
"description":"PKCS#12 format containing a single private/public key pair and certificate chain. This format is only accepted from client for creating a new SmimeInfo and is never returned, because the private key is not intended to be exported. PKCS#12 may be encrypted, in which case encryptedKeyPassword should be set appropriately.",
"description":"The password that will be used for authentication with the SMTP service. This is a write-only field that can be specified in requests to create or update SendAs settings; it is never populated in responses.",
"type":"string"
},
"port":{
"description":"The port of the SMTP service. Required.",
"format":"int32",
"type":"integer"
},
"securityMode":{
"description":"The protocol that will be used to secure communication with the SMTP service. Required.",
"enum":[
"none",
"securityModeUnspecified",
"ssl",
"starttls"
],
"enumDescriptions":[
"",
"",
"",
""
],
"type":"string"
},
"username":{
"description":"The username that will be used for authentication with the SMTP service. This is a write-only field that can be specified in requests to create or update SendAs settings; it is never populated in responses.",
"description":"Vacation auto-reply settings for an account. These settings correspond to the \"Vacation responder\" feature in the web interface.",
"id":"VacationSettings",
"properties":{
"enableAutoReply":{
"description":"Flag that controls whether Gmail automatically replies to messages.",
"type":"boolean"
},
"endTime":{
"description":"An optional end time for sending auto-replies (epoch ms). When this is specified, Gmail will automatically reply only to messages that it receives before the end time. If both startTime and endTime are specified, startTime must precede endTime.",
"format":"int64",
"type":"string"
},
"responseBodyHtml":{
"description":"Response body in HTML format. Gmail will sanitize the HTML before storing it.",
"type":"string"
},
"responseBodyPlainText":{
"description":"Response body in plain text format.",
"type":"string"
},
"responseSubject":{
"description":"Optional text to prepend to the subject line in vacation responses. In order to enable auto-replies, either the response subject or the response body must be nonempty.",
"type":"string"
},
"restrictToContacts":{
"description":"Flag that determines whether responses are sent to recipients who are not in the user's list of contacts.",
"type":"boolean"
},
"restrictToDomain":{
"description":"Flag that determines whether responses are sent to recipients who are outside of the user's domain. This feature is only available for G Suite users.",
"type":"boolean"
},
"startTime":{
"description":"An optional start time for sending auto-replies (epoch ms). When this is specified, Gmail will automatically reply only to messages that it receives after the start time. If both startTime and endTime are specified, startTime must precede endTime.",
"description":"Set up or update a new push notification watch on this user's mailbox.",
"id":"WatchRequest",
"properties":{
"labelFilterAction":{
"description":"Filtering behavior of labelIds list specified.",
"enum":[
"exclude",
"include"
],
"enumDescriptions":[
"",
""
],
"type":"string"
},
"labelIds":{
"description":"List of label_ids to restrict notifications about. By default, if unspecified, all changes are pushed out. If specified then dictates which labels are required for a push notification to be generated.",
"items":{
"type":"string"
},
"type":"array"
},
"topicName":{
"description":"A fully qualified Google Cloud Pub/Sub API topic name to publish the events to. This topic name **must** already exist in Cloud Pub/Sub and you **must** have already granted gmail \"publish\" permission on it. For example, \"projects/my-project-identifier/topics/my-topic-name\" (using the Cloud Pub/Sub \"v1\" topic naming format).\n\nNote that the \"my-project-identifier\" portion must exactly match your Google developer project id (the one executing this watch request).",