All 79 methods of the Gmail API, rendered at build time from the committed Discovery index the grr binary embeds — the same data grr api describe reads at runtime. Flags are kebab-cased parameter names: userId is --user-id.
Lists the drafts in the user's mailbox. For more information, see Create and send draft emails.
Parameter
Type
Required
Repeated
Location
Description
Enum values
includeSpamTrash
boolean
—
—
query
Include drafts from `SPAM` and `TRASH` in the results.
—
maxResults
integer
—
—
query
Maximum number of drafts to return. This field defaults to 100. The maximum allowed value for this field is 500.
—
pageToken
string
—
—
query
Page token to retrieve a specific page of results in the list.
—
q
string
—
—
query
Only return draft messages matching the specified query. Supports the same query format as the Gmail search box. For example, `"from:someuser@example.com rfc822
—
userId
string
yes
—
path
The user's email address. The special value `me` can be used to indicate the authenticated user.
grr gmail users watch --user-id me --body-file ./body.json
gmail.users.history
1 method
gmail.users.history.list
GET
grr gmail users history listgmail/v1/users/{userId}/history
Lists the history of all changes to the given mailbox. History results are returned in chronological order (increasing `historyId`). For more information, see Synchronize clients with Gmail.
Only return messages with a label matching the ID.
—
maxResults
integer
—
—
query
Maximum number of history records to return. This field defaults to 100. The maximum allowed value for this field is 500.
—
pageToken
string
—
—
query
Page token to retrieve a specific page of results in the list.
—
startHistoryId
string
—
—
query
Required. Returns history records after the specified `startHistoryId`. The supplied `startHistoryId` should be obtained from the `historyId` of a message, thre
—
userId
string
yes
—
path
The user's email address. The special value `me` can be used to indicate the authenticated user.
Immediately and permanently deletes the specified label and removes it from any messages and threads that it's applied to. For more information, see Manage labels.
Parameter
Type
Required
Repeated
Location
Description
Enum values
id
string
yes
—
path
The ID of the label to delete.
—
userId
string
yes
—
path
The user's email address. The special value `me` can be used to indicate the authenticated user.
Modifies the labels and the Classification Label values on the specified messages. For administrators modifying messages for users in their organization, requests require authorization with a service account that has [domain-wi
Parameter
Type
Required
Repeated
Location
Description
Enum values
userId
string
yes
—
path
The user's email address. The special value `me` can be used to indicate the authenticated user.
The ID of the message to retrieve. This ID is usually retrieved using `messages.list`. The ID is also contained in the result when a message is inserted (`messa
—
metadataHeaders
string
—
yes
query
When given and format is `METADATA`, only include headers specified.
—
userId
string
yes
—
path
The user's email address. The special value `me` can be used to indicate the authenticated user.
Imports a message into only this user's mailbox, with standard email delivery scanning and classification similar to receiving via SMTP. This method doesn't perform SPF checks, so it might not work for some spam messages, such as those attempting to perform domain spoofing. This method does not send
Parameter
Type
Required
Repeated
Location
Description
Enum values
deleted
boolean
—
—
query
Mark the email as permanently deleted (not TRASH) and only visible in Google Vault to a Vault administrator. Only used for Google Workspace accounts.
—
internalDateSource
string
—
—
query
Source for Gmail's internal date of the message.
receivedTime · dateHeader
neverMarkSpam
boolean
—
—
query
Ignore the Gmail spam classifier decision and never mark this email as SPAM in the mailbox.
—
processForCalendar
boolean
—
—
query
Process calendar invites in the email and add any extracted meetings to the Google Calendar for this user.
—
userId
string
yes
—
path
The user's email address. The special value `me` can be used to indicate the authenticated user.
Directly inserts a message into only this user's mailbox similar to `IMAP APPEND`, bypassing most scanning and classification. Does not send a message. For more information, see Create and send email messages.
Parameter
Type
Required
Repeated
Location
Description
Enum values
deleted
boolean
—
—
query
Mark the email as permanently deleted (not TRASH) and only visible in Google Vault to a Vault administrator. Only used for Google Workspace accounts.
—
internalDateSource
string
—
—
query
Source for Gmail's internal date of the message.
receivedTime · dateHeader
userId
string
yes
—
path
The user's email address. The special value `me` can be used to indicate the authenticated user.
Lists the messages in the user's mailbox. For more information, see List Gmail messages.
Parameter
Type
Required
Repeated
Location
Description
Enum values
includeSpamTrash
boolean
—
—
query
Include messages from `SPAM` and `TRASH` in the results.
—
labelIds
string
—
yes
query
Only return messages with labels that match all of the specified label IDs. Messages in a thread might have labels that other messages in the same thread don't
—
maxResults
integer
—
—
query
Maximum number of messages to return. This field defaults to 100. The maximum allowed value for this field is 500.
—
pageToken
string
—
—
query
Page token to retrieve a specific page of results in the list.
—
q
string
—
—
query
Only return messages matching the specified query. Supports the same query format as the Gmail search box. For example, `"from:someuser@example.com rfc822msgid:
—
userId
string
yes
—
path
The user's email address. The special value `me` can be used to indicate the authenticated user.
Modifies the labels and the Classification Label values on the specified message. For administrators modifying message for users in their organization, requests require authorization with a service account that has [domain-wide
Parameter
Type
Required
Repeated
Location
Description
Enum values
id
string
yes
—
path
The ID of the message to modify.
—
userId
string
yes
—
path
The user's email address. The special value `me` can be used to indicate the authenticated user.
Creates and configures a client-side encryption identity that's authorized to send mail from the user account. Google publishes the S/MIME certificate to a shared domain-wide directory so that people within a Google Workspace organization can encrypt and send mail to the identity. For administrators
Parameter
Type
Required
Repeated
Location
Description
Enum values
userId
string
yes
—
path
The requester's primary email address. To indicate the authenticated user, you can use the special value `me`.
Deletes a client-side encryption identity. The authenticated user can no longer use the identity to send encrypted messages. You cannot restore the identity after you delete it. Instead, use the CreateCseIdentity method to create another identity with the same configuration. For administrators manag
Parameter
Type
Required
Repeated
Location
Description
Enum values
cseEmailAddress
string
yes
—
path
The primary email address associated with the client-side encryption identity configuration that's removed.
—
userId
string
yes
—
path
The requester's primary email address. To indicate the authenticated user, you can use the special value `me`.
Retrieves a client-side encryption identity configuration. For administrators managing identities and keypairs for users in their organization, requests require authorization with a service account that has [domain-wide delegat
Parameter
Type
Required
Repeated
Location
Description
Enum values
cseEmailAddress
string
yes
—
path
The primary email address associated with the client-side encryption identity configuration that's retrieved.
—
userId
string
yes
—
path
The requester's primary email address. To indicate the authenticated user, you can use the special value `me`.
Lists the client-side encrypted identities for an authenticated user. For administrators managing identities and keypairs for users in their organization, requests require authorization with a service account that has [domain-w
Parameter
Type
Required
Repeated
Location
Description
Enum values
pageSize
integer
—
—
query
The number of identities to return. If not provided, the page size will default to 20 entries.
—
pageToken
string
—
—
query
Pagination token indicating which page of identities to return. If the token is not supplied, then the API will return the first page of results.
—
userId
string
yes
—
path
The requester's primary email address. To indicate the authenticated user, you can use the special value `me`.
Associates a different key pair with an existing client-side encryption identity. The updated key pair must validate against Google's S/MIME certificate profiles. For administrators managing identities and keypairs for users in their organization, reque
Parameter
Type
Required
Repeated
Location
Description
Enum values
emailAddress
string
yes
—
path
The email address of the client-side encryption identity to update.
—
userId
string
yes
—
path
The requester's primary email address. To indicate the authenticated user, you can use the special value `me`.
Creates and uploads a client-side encryption S/MIME public key certificate chain and private key metadata for the authenticated user. For administrators managing identities and keypairs for users in their organization, requests require authorization with a [service account](https://developers.google
Parameter
Type
Required
Repeated
Location
Description
Enum values
chainValidation
string
—
—
query
The type of certificate chain validation to perform at creation. The request will be rejected if the uploaded chain fails to satisfy the requested validation ch
all · none
userId
string
yes
—
path
The requester's primary email address. To indicate the authenticated user, you can use the special value `me`.
Turns off a client-side encryption key pair. The authenticated user can no longer use the key pair to decrypt incoming CSE message texts or sign outgoing CSE mail. To regain access, use the EnableCseKeyPair to turn on the key pair. After 30 days, you can permanently delete the key pair by using the
Parameter
Type
Required
Repeated
Location
Description
Enum values
keyPairId
string
yes
—
path
The identifier of the key pair to turn off.
—
userId
string
yes
—
path
The requester's primary email address. To indicate the authenticated user, you can use the special value `me`.
Turns on a client-side encryption key pair that was turned off. The key pair becomes active again for any associated client-side encryption identities. For administrators managing identities and keypairs for users in their organization, requests require authorization with a [service account](https:/
Parameter
Type
Required
Repeated
Location
Description
Enum values
keyPairId
string
yes
—
path
The identifier of the key pair to turn on.
—
userId
string
yes
—
path
The requester's primary email address. To indicate the authenticated user, you can use the special value `me`.
Retrieves an existing client-side encryption key pair. For administrators managing identities and keypairs for users in their organization, requests require authorization with a service account that has [domain-wide delegation
Parameter
Type
Required
Repeated
Location
Description
Enum values
keyPairId
string
yes
—
path
The identifier of the key pair to retrieve.
—
userId
string
yes
—
path
The requester's primary email address. To indicate the authenticated user, you can use the special value `me`.
Lists client-side encryption key pairs for an authenticated user. For administrators managing identities and keypairs for users in their organization, requests require authorization with a service account that has [domain-wide
Parameter
Type
Required
Repeated
Location
Description
Enum values
pageSize
integer
—
—
query
The number of key pairs to return. If not provided, the page size will default to 20 entries.
—
pageToken
string
—
—
query
Pagination token indicating which page of key pairs to return. If the token is not supplied, then the API will return the first page of results.
—
userId
string
yes
—
path
The requester's primary email address. To indicate the authenticated user, you can use the special value `me`.
Deletes a client-side encryption key pair permanently and immediately. You can only permanently delete key pairs that have been turned off for more than 30 days. To turn off a key pair, use the DisableCseKeyPair method. Gmail can't restore or decrypt any messages that were encrypted by an obliterate
Parameter
Type
Required
Repeated
Location
Description
Enum values
keyPairId
string
yes
—
path
The identifier of the key pair to obliterate.
—
userId
string
yes
—
path
The requester's primary email address. To indicate the authenticated user, you can use the special value `me`.
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 Google Workspace organization as the delegator user. For more information, see [Manage delegates](https://developers.google.com/workspace/gm
Parameter
Type
Required
Repeated
Location
Description
Enum values
userId
string
yes
—
path
User's email address. The special value "me" can be used to indicate the authenticated user.
Removes the specified delegate (which can be of any verification status), and revokes any verification that may have been required for using it. For more information, see Manage delegates. A delegate user must be referred
Parameter
Type
Required
Repeated
Location
Description
Enum values
delegateEmail
string
yes
—
path
The email address of the user to be removed as a delegate.
—
userId
string
yes
—
path
User's email address. The special value "me" can be used to indicate the authenticated user.
Gets the specified delegate. For more information, see Manage delegates. 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
Parameter
Type
Required
Repeated
Location
Description
Enum values
delegateEmail
string
yes
—
path
The email address of the user whose delegate relationship is to be retrieved.
—
userId
string
yes
—
path
User's email address. The special value "me" can be used to indicate the authenticated user.
Lists the delegates for the specified account. For more information, see Manage delegates. This method is only available to service account clients that have been delegated domain-wide authority.
Parameter
Type
Required
Repeated
Location
Description
Enum values
userId
string
yes
—
path
User's email address. The special value "me" can be used to indicate the authenticated user.
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`. For more information, see [Manage email fo
Parameter
Type
Required
Repeated
Location
Description
Enum values
userId
string
yes
—
path
User's email address. The special value "me" can be used to indicate the authenticated user.
Deletes the specified forwarding address and revokes any verification that may have been required. For more information, see Manage email forwarding. This method is only available to service account clients that have bee
Parameter
Type
Required
Repeated
Location
Description
Enum values
forwardingEmail
string
yes
—
path
The forwarding address to be deleted.
—
userId
string
yes
—
path
User's email address. The special value "me" can be used to indicate the authenticated user.
Updates the auto-forwarding setting for the specified account. A verified forwarding address must be specified when auto-forwarding is enabled. For more information, see Manage email forwarding. This method is only avail
Parameter
Type
Required
Repeated
Location
Description
Enum values
userId
string
yes
—
path
User's email address. The special value "me" can be used to indicate the authenticated user.
Updates language settings. For more information, see Manage 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 re
Parameter
Type
Required
Repeated
Location
Description
Enum values
userId
string
yes
—
path
User's email address. The special value "me" can be used to indicate the authenticated user.
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 verificat
Parameter
Type
Required
Repeated
Location
Description
Enum values
userId
string
yes
—
path
User's email address. The special value "me" can be used to indicate the authenticated user.
Deletes the specified send-as alias. Revokes any verification that may have been required for using it. For more information, see Manage aliases and signatures with the Gmail API. This method is only available t
Parameter
Type
Required
Repeated
Location
Description
Enum values
sendAsEmail
string
yes
—
path
The send-as alias to be deleted.
—
userId
string
yes
—
path
User's email address. The special value "me" can be used to indicate the authenticated user.
Gets the specified send-as alias. Fails with an HTTP 404 error if the specified address is not a member of the collection. For more information, see Manage aliases and signatures with the Gmail API.
Parameter
Type
Required
Repeated
Location
Description
Enum values
sendAsEmail
string
yes
—
path
The send-as alias to be retrieved.
—
userId
string
yes
—
path
User's email address. The special value "me" can be used to indicate the authenticated user.
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. For more information, see [Manage aliases and signatures with the Gmail API](https://developers.google.com/workspace/gmail/api/guides
Parameter
Type
Required
Repeated
Location
Description
Enum values
userId
string
yes
—
path
User's email address. The special value "me" can be used to indicate the authenticated user.
Updates a send-as alias. If a signature is provided, Gmail will sanitize the HTML before saving it with the alias. For more information, see Manage aliases and signatures with the Gmail API. Addresses other than
Parameter
Type
Required
Repeated
Location
Description
Enum values
sendAsEmail
string
yes
—
path
The send-as alias to be updated.
—
userId
string
yes
—
path
User's email address. The special value "me" can be used to indicate the authenticated user.
Sends a verification email to the specified send-as alias address. The verification status must be `pending`. For more information, see Manage aliases and signatures with the Gmail API. This method is only avail
Parameter
Type
Required
Repeated
Location
Description
Enum values
sendAsEmail
string
yes
—
path
The send-as alias to be verified.
—
userId
string
yes
—
path
User's email address. The special value "me" can be used to indicate the authenticated user.
Insert (upload) the given S/MIME config for the specified send-as alias. Note that `pkcs12` format is required for the key. For more information, see Manage S/MIME certificates with the Gmail API.
Parameter
Type
Required
Repeated
Location
Description
Enum values
sendAsEmail
string
yes
—
path
The email address that appears in the "From:" header for mail sent using this alias.
—
userId
string
yes
—
path
The user's email address. The special value `me` can be used to indicate the authenticated user.
Immediately and permanently deletes the specified thread. Any messages that belong to the thread are also deleted. This operation cannot be undone. Prefer `threads.trash` instead. For more information, see Manage threads.
Parameter
Type
Required
Repeated
Location
Description
Enum values
id
string
yes
—
path
ID of the Thread to delete.
—
userId
string
yes
—
path
The user's email address. The special value `me` can be used to indicate the authenticated user.
—
https://mail.google.com/least privilege 1 scope
https://mail.google.com/
grr gmail users threads delete
grr gmail users threads delete --id <id> --user-id me
Lists the threads in the user's mailbox. For more information, see Manage threads.
Parameter
Type
Required
Repeated
Location
Description
Enum values
includeSpamTrash
boolean
—
—
query
Include threads from `SPAM` and `TRASH` in the results.
—
labelIds
string
—
yes
query
Only return threads with labels that match all of the specified label IDs.
—
maxResults
integer
—
—
query
Maximum number of threads to return. This field defaults to 100. The maximum allowed value for this field is 500.
—
pageToken
string
—
—
query
Page token to retrieve a specific page of results in the list.
—
q
string
—
—
query
Only return threads matching the specified query. Supports the same query format as the Gmail search box. For example, `"from:someuser@example.com rfc822msgid:
—
userId
string
yes
—
path
The user's email address. The special value `me` can be used to indicate the authenticated user.
Removes the specified thread from the trash. Any messages that belong to the thread are also removed from the trash. For more information, see Manage threads.
Parameter
Type
Required
Repeated
Location
Description
Enum values
id
string
yes
—
path
The ID of the thread to remove from Trash.
—
userId
string
yes
—
path
The user's email address. The special value `me` can be used to indicate the authenticated user.