APIHub
Back to Explore

Gmail

Flexible, RESTful access to the user's inbox

Business
OAuth
HTTPS
CORS: Unknown
Visit official documentation

Latency

Not monitored yet

Uptime

Not monitored yet

Playground

Verified

live

Endpoints

REST · JSON
GET

/gmail/v1/users/{userId}/drafts

Lists the drafts in the user's mailbox.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
  • includeSpamTrash (query) — Include drafts from `SPAM` and `TRASH` in the results.
  • maxResults (query, limit) — Maximum number of drafts to return. This field defaults to 100. The maximum allowed value for this field is 500.
  • pageToken (query) — Page token to retrieve a specific page of results in the list.
  • q (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 rfc822msgid: is:unread"`.
POST

/gmail/v1/users/{userId}/drafts

Creates a new draft with the `DRAFT` label.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
POST

/gmail/v1/users/{userId}/drafts/send

Sends the specified, existing draft to the recipients in the `To`, `Cc`, and `Bcc` headers.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
DELETE

/gmail/v1/users/{userId}/drafts/{id}

Immediately and permanently deletes the specified draft. Does not simply trash it.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
  • id (path, required) — The ID of the draft to delete.
GET

/gmail/v1/users/{userId}/drafts/{id}

Gets the specified draft.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
  • id (path, required) — The ID of the draft to retrieve.
  • format (query) — The format to return the draft in.
PUT

/gmail/v1/users/{userId}/drafts/{id}

Replaces a draft's content.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
  • id (path, required) — The ID of the draft to update.
POST

/gmail/v1/users/{userId}/messages/import

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.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
  • deleted (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 (query) — Source for Gmail's internal date of the message.
  • neverMarkSpam (query) — Ignore the Gmail spam classifier decision and never mark this email as SPAM in the mailbox.
  • processForCalendar (query) — Process calendar invites in the email and add any extracted meetings to the Google Calendar for this user.
GET

/gmail/v1/users/{userId}/history

Lists the history of all changes to the given mailbox. History results are returned in chronological order (increasing `historyId`).

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
  • historyTypes (query) — History types to be returned by the function
  • labelId (query) — Only return messages with a label matching the ID.
  • maxResults (query, limit) — Maximum number of history records to return. This field defaults to 100. The maximum allowed value for this field is 500.
  • pageToken (query) — Page token to retrieve a specific page of results in the list.
  • startHistoryId (query) — 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.
GET

/gmail/v1/users/{userId}/labels

Lists all labels in the user's mailbox.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
POST

/gmail/v1/users/{userId}/labels

Creates a new label.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
DELETE

/gmail/v1/users/{userId}/labels/{id}

Immediately and permanently deletes the specified label and removes it from any messages and threads that it is applied to.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
  • id (path, required) — The ID of the label to delete.
GET

/gmail/v1/users/{userId}/labels/{id}

Gets the specified label.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
  • id (path, required) — The ID of the label to retrieve.
PATCH

/gmail/v1/users/{userId}/labels/{id}

Patch the specified label.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
  • id (path, required) — The ID of the label to update.
PUT

/gmail/v1/users/{userId}/labels/{id}

Updates the specified label.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
  • id (path, required) — The ID of the label to update.
GET

/gmail/v1/users/{userId}/messages

Lists the messages in the user's mailbox.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
  • includeSpamTrash (query) — Include messages from `SPAM` and `TRASH` in the results.
  • labelIds (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 have. To learn more, see [Manage labels on messages and threads](https://developers.google.com/gmail/api/guides/labels#manage_labels_on_messages_threads).
  • maxResults (query, limit) — Maximum number of messages to return. This field defaults to 100. The maximum allowed value for this field is 500.
  • pageToken (query) — Page token to retrieve a specific page of results in the list.
  • q (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: is:unread"`. Parameter cannot be used when accessing the api using the gmail.metadata scope.
POST

/gmail/v1/users/{userId}/messages

Directly inserts a message into only this user's mailbox similar to `IMAP APPEND`, bypassing most scanning and classification. Does not send a message.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
  • deleted (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 (query) — Source for Gmail's internal date of the message.
POST

/gmail/v1/users/{userId}/messages/batchDelete

Deletes many messages by message ID. Provides no guarantees that messages were not already deleted or even existed at all.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
POST

/gmail/v1/users/{userId}/messages/batchModify

Modifies the labels on the specified messages.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
POST

/gmail/v1/users/{userId}/messages/send

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).

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
DELETE

/gmail/v1/users/{userId}/messages/{id}

Immediately and permanently deletes the specified message. This operation cannot be undone. Prefer `messages.trash` instead.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
  • id (path, required) — The ID of the message to delete.
GET

/gmail/v1/users/{userId}/messages/{id}

Gets the specified message.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
  • id (path, required) — 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 (`messages.insert`) or imported (`messages.import`).
  • format (query) — The format to return the message in.
  • metadataHeaders (query) — When given and format is `METADATA`, only include headers specified.
POST

/gmail/v1/users/{userId}/messages/{id}/modify

Modifies the labels on the specified message.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
  • id (path, required) — The ID of the message to modify.
POST

/gmail/v1/users/{userId}/messages/{id}/trash

Moves the specified message to the trash.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
  • id (path, required) — The ID of the message to Trash.
POST

/gmail/v1/users/{userId}/messages/{id}/untrash

Removes the specified message from the trash.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
  • id (path, required) — The ID of the message to remove from Trash.
GET

/gmail/v1/users/{userId}/messages/{messageId}/attachments/{id}

Gets the specified message attachment.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
  • messageId (path, required) — The ID of the message containing the attachment.
  • id (path, required) — The ID of the attachment.
GET

/gmail/v1/users/{userId}/profile

Gets the current user's Gmail profile.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
GET

/gmail/v1/users/{userId}/settings/autoForwarding

Gets the auto-forwarding setting for the specified account.

  • userId (path, required) — User's email address. The special value "me" can be used to indicate the authenticated user.
PUT

/gmail/v1/users/{userId}/settings/autoForwarding

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.

  • userId (path, required) — User's email address. The special value "me" can be used to indicate the authenticated user.
GET

/gmail/v1/users/{userId}/settings/cse/identities

Lists the client-side encrypted identities for an authenticated user.

  • userId (path, required) — The requester's primary email address. To indicate the authenticated user, you can use the special value `me`.
  • pageSize (query, limit) — The number of identities to return. If not provided, the page size will default to 20 entries.
  • pageToken (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.
POST

/gmail/v1/users/{userId}/settings/cse/identities

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.

  • userId (path, required) — The requester's primary email address. To indicate the authenticated user, you can use the special value `me`.
DELETE

/gmail/v1/users/{userId}/settings/cse/identities/{cseEmailAddress}

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.

  • userId (path, required) — The requester's primary email address. To indicate the authenticated user, you can use the special value `me`.
  • cseEmailAddress (path, required) — The primary email address associated with the client-side encryption identity configuration that's removed.
PUT

/gmail/v1/users/{userId}/settings/vacation

Updates vacation responder settings.

  • userId (path, required) — User's email address. The special value "me" can be used to indicate the authenticated user.
GET

/gmail/v1/users/{userId}/settings/cse/identities/{cseEmailAddress}

Retrieves a client-side encryption identity configuration.

  • userId (path, required) — The requester's primary email address. To indicate the authenticated user, you can use the special value `me`.
  • cseEmailAddress (path, required) — The primary email address associated with the client-side encryption identity configuration that's retrieved.
PATCH

/gmail/v1/users/{userId}/settings/cse/identities/{emailAddress}

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).

  • userId (path, required) — The requester's primary email address. To indicate the authenticated user, you can use the special value `me`.
  • emailAddress (path, required) — The email address of the client-side encryption identity to update.
GET

/gmail/v1/users/{userId}/settings/cse/keypairs

Lists client-side encryption key pairs for an authenticated user.

  • userId (path, required) — The requester's primary email address. To indicate the authenticated user, you can use the special value `me`.
  • pageSize (query, limit) — The number of key pairs to return. If not provided, the page size will default to 20 entries.
  • pageToken (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.
POST

/gmail/v1/users/{userId}/settings/cse/keypairs

Creates and uploads a client-side encryption S/MIME public key certificate chain and private key metadata for the authenticated user.

  • userId (path, required) — The requester's primary email address. To indicate the authenticated user, you can use the special value `me`.
GET

/gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}

Retrieves an existing client-side encryption key pair.

  • userId (path, required) — The requester's primary email address. To indicate the authenticated user, you can use the special value `me`.
  • keyPairId (path, required) — The identifier of the key pair to retrieve.
POST

/gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}:disable

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.

  • userId (path, required) — The requester's primary email address. To indicate the authenticated user, you can use the special value `me`.
  • keyPairId (path, required) — The identifier of the key pair to turn off.
POST

/gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}:enable

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.

  • userId (path, required) — The requester's primary email address. To indicate the authenticated user, you can use the special value `me`.
  • keyPairId (path, required) — The identifier of the key pair to turn on.
POST

/gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}:obliterate

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.

  • userId (path, required) — The requester's primary email address. To indicate the authenticated user, you can use the special value `me`.
  • keyPairId (path, required) — The identifier of the key pair to obliterate.
GET

/gmail/v1/users/{userId}/settings/delegates

Lists the delegates for the specified account. This method is only available to service account clients that have been delegated domain-wide authority.

  • userId (path, required) — User's email address. The special value "me" can be used to indicate the authenticated user.
POST

/gmail/v1/users/{userId}/settings/delegates

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.

  • userId (path, required) — User's email address. The special value "me" can be used to indicate the authenticated user.
DELETE

/gmail/v1/users/{userId}/settings/delegates/{delegateEmail}

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.

  • userId (path, required) — User's email address. The special value "me" can be used to indicate the authenticated user.
  • delegateEmail (path, required) — The email address of the user to be removed as a delegate.
GET

/gmail/v1/users/{userId}/settings/delegates/{delegateEmail}

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.

  • userId (path, required) — User's email address. The special value "me" can be used to indicate the authenticated user.
  • delegateEmail (path, required) — The email address of the user whose delegate relationship is to be retrieved.
GET

/gmail/v1/users/{userId}/settings/filters

Lists the message filters of a Gmail user.

  • userId (path, required) — User's email address. The special value "me" can be used to indicate the authenticated user.
POST

/gmail/v1/users/{userId}/settings/filters

Creates a filter. Note: you can only create a maximum of 1,000 filters.

  • userId (path, required) — User's email address. The special value "me" can be used to indicate the authenticated user.
DELETE

/gmail/v1/users/{userId}/settings/filters/{id}

Immediately and permanently deletes the specified filter.

  • userId (path, required) — User's email address. The special value "me" can be used to indicate the authenticated user.
  • id (path, required) — The ID of the filter to be deleted.
GET

/gmail/v1/users/{userId}/settings/filters/{id}

Gets a filter.

  • userId (path, required) — User's email address. The special value "me" can be used to indicate the authenticated user.
  • id (path, required) — The ID of the filter to be fetched.
GET

/gmail/v1/users/{userId}/settings/forwardingAddresses

Lists the forwarding addresses for the specified account.

  • userId (path, required) — User's email address. The special value "me" can be used to indicate the authenticated user.
POST

/gmail/v1/users/{userId}/settings/forwardingAddresses

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.

  • userId (path, required) — User's email address. The special value "me" can be used to indicate the authenticated user.
DELETE

/gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail}

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.

  • userId (path, required) — User's email address. The special value "me" can be used to indicate the authenticated user.
  • forwardingEmail (path, required) — The forwarding address to be deleted.
GET

/gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail}

Gets the specified forwarding address.

  • userId (path, required) — User's email address. The special value "me" can be used to indicate the authenticated user.
  • forwardingEmail (path, required) — The forwarding address to be retrieved.
GET

/gmail/v1/users/{userId}/settings/imap

Gets IMAP settings.

  • userId (path, required) — User's email address. The special value "me" can be used to indicate the authenticated user.
PUT

/gmail/v1/users/{userId}/settings/imap

Updates IMAP settings.

  • userId (path, required) — User's email address. The special value "me" can be used to indicate the authenticated user.
GET

/gmail/v1/users/{userId}/settings/language

Gets language settings.

  • userId (path, required) — User's email address. The special value "me" can be used to indicate the authenticated user.
PUT

/gmail/v1/users/{userId}/settings/language

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.

  • userId (path, required) — User's email address. The special value "me" can be used to indicate the authenticated user.
GET

/gmail/v1/users/{userId}/settings/pop

Gets POP settings.

  • userId (path, required) — User's email address. The special value "me" can be used to indicate the authenticated user.
PUT

/gmail/v1/users/{userId}/settings/pop

Updates POP settings.

  • userId (path, required) — User's email address. The special value "me" can be used to indicate the authenticated user.
GET

/gmail/v1/users/{userId}/settings/sendAs

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.

  • userId (path, required) — User's email address. The special value "me" can be used to indicate the authenticated user.
POST

/gmail/v1/users/{userId}/stop

Stop receiving push notifications for the given user mailbox.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
POST

/gmail/v1/users/{userId}/settings/sendAs

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.

  • userId (path, required) — User's email address. The special value "me" can be used to indicate the authenticated user.
DELETE

/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}

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.

  • userId (path, required) — User's email address. The special value "me" can be used to indicate the authenticated user.
  • sendAsEmail (path, required) — The send-as alias to be deleted.
GET

/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}

Gets the specified send-as alias. Fails with an HTTP 404 error if the specified address is not a member of the collection.

  • userId (path, required) — User's email address. The special value "me" can be used to indicate the authenticated user.
  • sendAsEmail (path, required) — The send-as alias to be retrieved.
PATCH

/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}

Patch the specified send-as alias.

  • userId (path, required) — User's email address. The special value "me" can be used to indicate the authenticated user.
  • sendAsEmail (path, required) — The send-as alias to be updated.
PUT

/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}

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.

  • userId (path, required) — User's email address. The special value "me" can be used to indicate the authenticated user.
  • sendAsEmail (path, required) — The send-as alias to be updated.
GET

/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo

Lists S/MIME configs for the specified send-as alias.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
  • sendAsEmail (path, required) — The email address that appears in the "From:" header for mail sent using this alias.
POST

/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo

Insert (upload) the given S/MIME config for the specified send-as alias. Note that pkcs12 format is required for the key.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
  • sendAsEmail (path, required) — The email address that appears in the "From:" header for mail sent using this alias.
DELETE

/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}

Deletes the specified S/MIME config for the specified send-as alias.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
  • sendAsEmail (path, required) — The email address that appears in the "From:" header for mail sent using this alias.
  • id (path, required) — The immutable ID for the SmimeInfo.
GET

/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}

Gets the specified S/MIME config for the specified send-as alias.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
  • sendAsEmail (path, required) — The email address that appears in the "From:" header for mail sent using this alias.
  • id (path, required) — The immutable ID for the SmimeInfo.
POST

/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}/setDefault

Sets the default S/MIME config for the specified send-as alias.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
  • sendAsEmail (path, required) — The email address that appears in the "From:" header for mail sent using this alias.
  • id (path, required) — The immutable ID for the SmimeInfo.
POST

/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/verify

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.

  • userId (path, required) — User's email address. The special value "me" can be used to indicate the authenticated user.
  • sendAsEmail (path, required) — The send-as alias to be verified.
GET

/gmail/v1/users/{userId}/settings/vacation

Gets vacation responder settings.

  • userId (path, required) — User's email address. The special value "me" can be used to indicate the authenticated user.
GET

/gmail/v1/users/{userId}/threads

Lists the threads in the user's mailbox.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
  • includeSpamTrash (query) — Include threads from `SPAM` and `TRASH` in the results.
  • labelIds (query) — Only return threads with labels that match all of the specified label IDs.
  • maxResults (query, limit) — Maximum number of threads to return. This field defaults to 100. The maximum allowed value for this field is 500.
  • pageToken (query) — Page token to retrieve a specific page of results in the list.
  • q (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: is:unread"`. Parameter cannot be used when accessing the api using the gmail.metadata scope.
DELETE

/gmail/v1/users/{userId}/threads/{id}

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.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
  • id (path, required) — ID of the Thread to delete.
GET

/gmail/v1/users/{userId}/threads/{id}

Gets the specified thread.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
  • id (path, required) — The ID of the thread to retrieve.
  • format (query) — The format to return the messages in.
  • metadataHeaders (query) — When given and format is METADATA, only include headers specified.
POST

/gmail/v1/users/{userId}/threads/{id}/modify

Modifies the labels applied to the thread. This applies to all messages in the thread.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
  • id (path, required) — The ID of the thread to modify.
POST

/gmail/v1/users/{userId}/threads/{id}/trash

Moves the specified thread to the trash. Any messages that belong to the thread are also moved to the trash.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
  • id (path, required) — The ID of the thread to Trash.
POST

/gmail/v1/users/{userId}/threads/{id}/untrash

Removes the specified thread from the trash. Any messages that belong to the thread are also removed from the trash.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.
  • id (path, required) — The ID of the thread to remove from Trash.
POST

/gmail/v1/users/{userId}/watch

Set up or update a push notification watch on the given user mailbox.

  • userId (path, required) — The user's email address. The special value `me` can be used to indicate the authenticated user.

79 endpoints auto-detected

Authentication

This API requires authentication: OAuth.

curl -X GET \
  "https://developers.google.com/gmail/api//gmail/v1/users/{userId}/drafts"

developers.google.com · HTTPS only