# Gmail API

## API Docs
- users [/gmail/v1/users/{userId}/drafts](https://apidog.com/apidoc/docs-site/346713/api-3533203.md): Lists the drafts in the user's mailbox.
- users [/gmail/v1/users/{userId}/drafts](https://apidog.com/apidoc/docs-site/346713/api-3533185.md): Creates a new draft with the `DRAFT` label.
- users [/gmail/v1/users/{userId}/drafts/send](https://apidog.com/apidoc/docs-site/346713/api-3533186.md): Sends the specified, existing draft to the recipients in the `To`, `Cc`, and `Bcc` headers.
- users [/gmail/v1/users/{userId}/drafts/{id}](https://apidog.com/apidoc/docs-site/346713/api-3533197.md): Immediately and permanently deletes the specified draft. Does not simply trash it.
- users [/gmail/v1/users/{userId}/drafts/{id}](https://apidog.com/apidoc/docs-site/346713/api-3533188.md): Gets the specified draft.
- users [/gmail/v1/users/{userId}/drafts/{id}](https://apidog.com/apidoc/docs-site/346713/api-3533187.md): Replaces a draft's content.
- users [/gmail/v1/users/{userId}/history](https://apidog.com/apidoc/docs-site/346713/api-3533195.md): Lists the history of all changes to the given mailbox. History results are returned in chronological order (increasing `historyId`).
- users [/gmail/v1/users/{userId}/labels](https://apidog.com/apidoc/docs-site/346713/api-3533196.md): Lists all labels in the user's mailbox.
- users [/gmail/v1/users/{userId}/labels](https://apidog.com/apidoc/docs-site/346713/api-3533201.md): Creates a new label.
- users [/gmail/v1/users/{userId}/labels/{id}](https://apidog.com/apidoc/docs-site/346713/api-3533189.md): Immediately and permanently deletes the specified label and removes it from any messages and threads that it is applied to.
- users [/gmail/v1/users/{userId}/labels/{id}](https://apidog.com/apidoc/docs-site/346713/api-3533190.md): Gets the specified label.
- users [/gmail/v1/users/{userId}/labels/{id}](https://apidog.com/apidoc/docs-site/346713/api-3533200.md): Patch the specified label.
- users [/gmail/v1/users/{userId}/labels/{id}](https://apidog.com/apidoc/docs-site/346713/api-3533202.md): Updates the specified label.
- users [/gmail/v1/users/{userId}/messages](https://apidog.com/apidoc/docs-site/346713/api-3533191.md): Lists the messages in the user's mailbox.
- users [/gmail/v1/users/{userId}/messages](https://apidog.com/apidoc/docs-site/346713/api-3533193.md): Directly inserts a message into only this user's mailbox similar to `IMAP APPEND`, bypassing most scanning and classification. Does not send a message.
- users [/gmail/v1/users/{userId}/messages/batchDelete](https://apidog.com/apidoc/docs-site/346713/api-3533198.md): Deletes many messages by message ID. Provides no guarantees that messages were not already deleted or even existed at all.
- users [/gmail/v1/users/{userId}/messages/batchModify](https://apidog.com/apidoc/docs-site/346713/api-3533204.md): Modifies the labels on the specified messages.
- users [/gmail/v1/users/{userId}/messages/import](https://apidog.com/apidoc/docs-site/346713/api-3533192.md): 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 a message. Note: This function doesn't trigger forwarding rules or filters set up by the user.
- users [/gmail/v1/users/{userId}/messages/send](https://apidog.com/apidoc/docs-site/346713/api-3533194.md): Sends the specified message to the recipients in the `To`, `Cc`, and `Bcc` headers. For example usage, see [Sending email](https://developers.google.com/gmail/api/guides/sending).
- users [/gmail/v1/users/{userId}/messages/{id}](https://apidog.com/apidoc/docs-site/346713/api-3533199.md): Immediately and permanently deletes the specified message. This operation cannot be undone. Prefer `messages.trash` instead.
- users [/gmail/v1/users/{userId}/messages/{id}](https://apidog.com/apidoc/docs-site/346713/api-3533205.md): Gets the specified message.
- users [/gmail/v1/users/{userId}/messages/{id}/modify](https://apidog.com/apidoc/docs-site/346713/api-3533208.md): Modifies the labels on the specified message.
- users [/gmail/v1/users/{userId}/messages/{id}/trash](https://apidog.com/apidoc/docs-site/346713/api-3533206.md): Moves the specified message to the trash.
- users [/gmail/v1/users/{userId}/messages/{id}/untrash](https://apidog.com/apidoc/docs-site/346713/api-3533209.md): Removes the specified message from the trash.
- users [/gmail/v1/users/{userId}/messages/{messageId}/attachments/{id}](https://apidog.com/apidoc/docs-site/346713/api-3533207.md): Gets the specified message attachment.
- users [/gmail/v1/users/{userId}/profile](https://apidog.com/apidoc/docs-site/346713/api-3533211.md): Gets the current user's Gmail profile.
- users [/gmail/v1/users/{userId}/settings/autoForwarding](https://apidog.com/apidoc/docs-site/346713/api-3533210.md): Gets the auto-forwarding setting for the specified account.
- users [/gmail/v1/users/{userId}/settings/autoForwarding](https://apidog.com/apidoc/docs-site/346713/api-3533212.md): 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.
- users [/gmail/v1/users/{userId}/settings/cse/identities](https://apidog.com/apidoc/docs-site/346713/api-4079174.md): Lists the client-side encrypted identities for an authenticated user.
- users [/gmail/v1/users/{userId}/settings/cse/identities](https://apidog.com/apidoc/docs-site/346713/api-4079175.md): 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.
- users [/gmail/v1/users/{userId}/settings/cse/identities/{cseEmailAddress}](https://apidog.com/apidoc/docs-site/346713/api-4079176.md): 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.
- users [/gmail/v1/users/{userId}/settings/cse/identities/{cseEmailAddress}](https://apidog.com/apidoc/docs-site/346713/api-4079177.md): Retrieves a client-side encryption identity configuration.
- users [/gmail/v1/users/{userId}/settings/cse/identities/{emailAddress}](https://apidog.com/apidoc/docs-site/346713/api-4079178.md): 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](https://support.google.com/a/answer/7300887).
- users [/gmail/v1/users/{userId}/settings/cse/keypairs](https://apidog.com/apidoc/docs-site/346713/api-4079179.md): Lists client-side encryption key pairs for an authenticated user.
- users [/gmail/v1/users/{userId}/settings/cse/keypairs](https://apidog.com/apidoc/docs-site/346713/api-4079180.md): Creates and uploads a client-side encryption S/MIME public key certificate chain and private key metadata for the authenticated user.
- users [/gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}](https://apidog.com/apidoc/docs-site/346713/api-4079181.md): Retrieves an existing client-side encryption key pair.
- users [/gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}:disable](https://apidog.com/apidoc/docs-site/346713/api-4079182.md): 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 ObliterateCseKeyPair method.
- users [/gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}:enable](https://apidog.com/apidoc/docs-site/346713/api-4079183.md): 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.
- users [/gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}:obliterate](https://apidog.com/apidoc/docs-site/346713/api-4079184.md): 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 obliterated key. Authenticated users and Google Workspace administrators lose access to reading the encrypted messages.
- users [/gmail/v1/users/{userId}/settings/delegates](https://apidog.com/apidoc/docs-site/346713/api-3533213.md): Lists the delegates for the specified account. This method is only available to service account clients that have been delegated domain-wide authority.
- users [/gmail/v1/users/{userId}/settings/delegates](https://apidog.com/apidoc/docs-site/346713/api-3533222.md): 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. Gmail imposes limitations on the number of delegates and delegators each user in a Google Workspace 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.
- users [/gmail/v1/users/{userId}/settings/delegates/{delegateEmail}](https://apidog.com/apidoc/docs-site/346713/api-3533218.md): 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.
- users [/gmail/v1/users/{userId}/settings/delegates/{delegateEmail}](https://apidog.com/apidoc/docs-site/346713/api-3533214.md): 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.
- users [/gmail/v1/users/{userId}/settings/filters](https://apidog.com/apidoc/docs-site/346713/api-3533219.md): Lists the message filters of a Gmail user.
- users [/gmail/v1/users/{userId}/settings/filters](https://apidog.com/apidoc/docs-site/346713/api-3533221.md): Creates a filter. Note: you can only create a maximum of 1,000 filters.
- users [/gmail/v1/users/{userId}/settings/filters/{id}](https://apidog.com/apidoc/docs-site/346713/api-3533220.md): Immediately and permanently deletes the specified filter.
- users [/gmail/v1/users/{userId}/settings/filters/{id}](https://apidog.com/apidoc/docs-site/346713/api-3533216.md): Gets a filter.
- users [/gmail/v1/users/{userId}/settings/forwardingAddresses](https://apidog.com/apidoc/docs-site/346713/api-3533215.md): Lists the forwarding addresses for the specified account.
- users [/gmail/v1/users/{userId}/settings/forwardingAddresses](https://apidog.com/apidoc/docs-site/346713/api-3533223.md): 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.
- users [/gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail}](https://apidog.com/apidoc/docs-site/346713/api-3533224.md): 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.
- users [/gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail}](https://apidog.com/apidoc/docs-site/346713/api-3533217.md): Gets the specified forwarding address.
- users [/gmail/v1/users/{userId}/settings/imap](https://apidog.com/apidoc/docs-site/346713/api-3533225.md): Gets IMAP settings.
- users [/gmail/v1/users/{userId}/settings/imap](https://apidog.com/apidoc/docs-site/346713/api-3533227.md): Updates IMAP settings.
- users [/gmail/v1/users/{userId}/settings/language](https://apidog.com/apidoc/docs-site/346713/api-3533226.md): Gets language settings.
- users [/gmail/v1/users/{userId}/settings/language](https://apidog.com/apidoc/docs-site/346713/api-3533230.md): 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.
- users [/gmail/v1/users/{userId}/settings/pop](https://apidog.com/apidoc/docs-site/346713/api-3533228.md): Gets POP settings.
- users [/gmail/v1/users/{userId}/settings/pop](https://apidog.com/apidoc/docs-site/346713/api-3533231.md): Updates POP settings.
- users [/gmail/v1/users/{userId}/settings/sendAs](https://apidog.com/apidoc/docs-site/346713/api-3533229.md): 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.
- users [/gmail/v1/users/{userId}/settings/sendAs](https://apidog.com/apidoc/docs-site/346713/api-3533233.md): 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. This method is only available to service account clients that have been delegated domain-wide authority.
- users [/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}](https://apidog.com/apidoc/docs-site/346713/api-3533232.md): Deletes the specified send-as alias. Revokes any verification that may have been required for using it. This method is only available to service account clients that have been delegated domain-wide authority.
- users [/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}](https://apidog.com/apidoc/docs-site/346713/api-3533234.md): Gets the specified send-as alias. Fails with an HTTP 404 error if the specified address is not a member of the collection.
- users [/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}](https://apidog.com/apidoc/docs-site/346713/api-3533240.md): Patch the specified send-as alias.
- users [/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}](https://apidog.com/apidoc/docs-site/346713/api-3533242.md): Updates a send-as alias. If a signature is provided, Gmail will sanitize the HTML before saving it with the alias. Addresses other than the primary address for the account can only be updated by service account clients that have been delegated domain-wide authority.
- users [/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo](https://apidog.com/apidoc/docs-site/346713/api-3533244.md): Lists S/MIME configs for the specified send-as alias.
- users [/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo](https://apidog.com/apidoc/docs-site/346713/api-3533241.md): Insert (upload) the given S/MIME config for the specified send-as alias. Note that pkcs12 format is required for the key.
- users [/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}](https://apidog.com/apidoc/docs-site/346713/api-3533237.md): Deletes the specified S/MIME config for the specified send-as alias.
- users [/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}](https://apidog.com/apidoc/docs-site/346713/api-3533235.md): Gets the specified S/MIME config for the specified send-as alias.
- users [/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}/setDefault](https://apidog.com/apidoc/docs-site/346713/api-3533238.md): Sets the default S/MIME config for the specified send-as alias.
- users [/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/verify](https://apidog.com/apidoc/docs-site/346713/api-3533239.md): Sends a verification email to the specified send-as alias address. The verification status must be `pending`. This method is only available to service account clients that have been delegated domain-wide authority.
- users [/gmail/v1/users/{userId}/settings/vacation](https://apidog.com/apidoc/docs-site/346713/api-3533236.md): Gets vacation responder settings.
- users [/gmail/v1/users/{userId}/settings/vacation](https://apidog.com/apidoc/docs-site/346713/api-3533243.md): Updates vacation responder settings.
- users [/gmail/v1/users/{userId}/stop](https://apidog.com/apidoc/docs-site/346713/api-3533248.md): Stop receiving push notifications for the given user mailbox.
- users [/gmail/v1/users/{userId}/threads](https://apidog.com/apidoc/docs-site/346713/api-3533251.md): Lists the threads in the user's mailbox.
- users [/gmail/v1/users/{userId}/threads/{id}](https://apidog.com/apidoc/docs-site/346713/api-3533249.md): 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.
- users [/gmail/v1/users/{userId}/threads/{id}](https://apidog.com/apidoc/docs-site/346713/api-3533245.md): Gets the specified thread.
- users [/gmail/v1/users/{userId}/threads/{id}/modify](https://apidog.com/apidoc/docs-site/346713/api-3533250.md): Modifies the labels applied to the thread. This applies to all messages in the thread.
- users [/gmail/v1/users/{userId}/threads/{id}/trash](https://apidog.com/apidoc/docs-site/346713/api-3533246.md): Moves the specified thread to the trash. Any messages that belong to the thread are also moved to the trash.
- users [/gmail/v1/users/{userId}/threads/{id}/untrash](https://apidog.com/apidoc/docs-site/346713/api-3533247.md): Removes the specified thread from the trash. Any messages that belong to the thread are also removed from the trash.
- users [/gmail/v1/users/{userId}/watch](https://apidog.com/apidoc/docs-site/346713/api-3533252.md): Set up or update a push notification watch on the given user mailbox.