openapi: "3.0"
info:
title: Gmail API
description: The Gmail API lets you view and manage Gmail mailbox data like threads, messages, and labels.
version: v1
servers:
- url: https://gmail.googleapis.com/
paths:
/gmail/v1/users/{userId}/profile:
get:
description: Gets the current user's Gmail profile.
operationId: gmail.users.getProfile
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/Profile'
/gmail/v1/users/{userId}/watch:
post:
description: Set up or update a push notification watch on the given user mailbox.
operationId: gmail.users.watch
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/definitions/WatchRequest'
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/WatchResponse'
/gmail/v1/users/{userId}/stop:
post:
description: Stop receiving push notifications for the given user mailbox.
operationId: gmail.users.stop
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
responses:
default:
description: Successful operation
/gmail/v1/users/{userId}/drafts/{id}:
get:
description: Gets the specified draft.
operationId: gmail.users.drafts.get
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: id
in: path
description: The ID of the draft to retrieve.
required: true
schema:
type: string
- name: format
in: query
description: The format to return the draft in.
schema:
type: string
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/Draft'
put:
description: Replaces a draft's content.
operationId: gmail.users.drafts.update
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: id
in: path
description: The ID of the draft to update.
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/definitions/Draft'
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/Draft'
delete:
description: Immediately and permanently deletes the specified draft. Does not simply trash it.
operationId: gmail.users.drafts.delete
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: id
in: path
description: The ID of the draft to delete.
required: true
schema:
type: string
responses:
default:
description: Successful operation
/gmail/v1/users/{userId}/drafts:
get:
description: Lists the drafts in the user's mailbox.
operationId: gmail.users.drafts.list
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: maxResults
in: query
description: Maximum number of drafts to return. This field defaults to 100. The maximum allowed value for this field is 500.
schema:
type: integer
format: uint32
- name: pageToken
in: query
description: Page token to retrieve a specific page of results in the list.
schema:
type: string
- name: q
in: query
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"`.'
schema:
type: string
- name: includeSpamTrash
in: query
description: Include drafts from `SPAM` and `TRASH` in the results.
schema:
type: boolean
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/ListDraftsResponse'
post:
description: Creates a new draft with the `DRAFT` label.
operationId: gmail.users.drafts.create
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/definitions/Draft'
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/Draft'
/gmail/v1/users/{userId}/drafts/send:
post:
description: Sends the specified, existing draft to the recipients in the `To`, `Cc`, and `Bcc` headers.
operationId: gmail.users.drafts.send
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/definitions/Draft'
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/Message'
/gmail/v1/users/{userId}/history:
get:
description: Lists the history of all changes to the given mailbox. History results are returned in chronological order (increasing `historyId`).
operationId: gmail.users.history.list
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: maxResults
in: query
description: Maximum number of history records to return. This field defaults to 100. The maximum allowed value for this field is 500.
schema:
type: integer
format: uint32
- name: pageToken
in: query
description: Page token to retrieve a specific page of results in the list.
schema:
type: string
- name: startHistoryId
in: query
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.
schema:
type: string
format: uint64
- name: labelId
in: query
description: Only return messages with a label matching the ID.
schema:
type: string
- name: historyTypes
in: query
description: History types to be returned by the function
schema:
type: string
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/ListHistoryResponse'
/gmail/v1/users/{userId}/messages/{id}/trash:
post:
description: Moves the specified message to the trash.
operationId: gmail.users.messages.trash
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: id
in: path
description: The ID of the message to Trash.
required: true
schema:
type: string
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/Message'
/gmail/v1/users/{userId}/messages/{id}/untrash:
post:
description: Removes the specified message from the trash.
operationId: gmail.users.messages.untrash
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: id
in: path
description: The ID of the message to remove from Trash.
required: true
schema:
type: string
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/Message'
/gmail/v1/users/{userId}/messages/{id}:
get:
description: Gets the specified message.
operationId: gmail.users.messages.get
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: id
in: path
description: 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`).
required: true
schema:
type: string
- name: format
in: query
description: The format to return the message in.
schema:
type: string
- name: metadataHeaders
in: query
description: When given and format is `METADATA`, only include headers specified.
schema:
type: string
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/Message'
delete:
description: Immediately and permanently deletes the specified message. This operation cannot be undone. Prefer `messages.trash` instead.
operationId: gmail.users.messages.delete
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: id
in: path
description: The ID of the message to delete.
required: true
schema:
type: string
responses:
default:
description: Successful operation
/gmail/v1/users/{userId}/messages/batchDelete:
post:
description: Deletes many messages by message ID. Provides no guarantees that messages were not already deleted or even existed at all.
operationId: gmail.users.messages.batchDelete
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/definitions/BatchDeleteMessagesRequest'
responses:
default:
description: Successful operation
/gmail/v1/users/{userId}/messages/import:
post:
description: 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 that the maximum size of the message is 150MB.
operationId: gmail.users.messages.import
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: internalDateSource
in: query
description: Source for Gmail's internal date of the message.
schema:
type: string
- name: neverMarkSpam
in: query
description: Ignore the Gmail spam classifier decision and never mark this email as SPAM in the mailbox.
schema:
type: boolean
- name: processForCalendar
in: query
description: Process calendar invites in the email and add any extracted meetings to the Google Calendar for this user.
schema:
type: boolean
- name: deleted
in: query
description: Mark the email as permanently deleted (not TRASH) and only visible in Google Vault to a Vault administrator. Only used for Google Workspace accounts.
schema:
type: boolean
requestBody:
content:
application/json:
schema:
$ref: '#/definitions/Message'
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/Message'
/gmail/v1/users/{userId}/messages:
get:
description: Lists the messages in the user's mailbox. For example usage, see [List Gmail messages](https://developers.google.com/workspace/gmail/api/guides/list-messages).
operationId: gmail.users.messages.list
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: maxResults
in: query
description: Maximum number of messages to return. This field defaults to 100. The maximum allowed value for this field is 500.
schema:
type: integer
format: uint32
- name: pageToken
in: query
description: Page token to retrieve a specific page of results in the list.
schema:
type: string
- name: q
in: 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"`. Parameter cannot be used when accessing the api using the gmail.metadata scope.'
schema:
type: string
- name: labelIds
in: query
description: 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/workspace/gmail/api/guides/labels#manage_labels_on_messages_threads).
schema:
type: string
- name: includeSpamTrash
in: query
description: Include messages from `SPAM` and `TRASH` in the results.
schema:
type: boolean
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/ListMessagesResponse'
post:
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.
operationId: gmail.users.messages.insert
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: internalDateSource
in: query
description: Source for Gmail's internal date of the message.
schema:
type: string
- name: deleted
in: query
description: Mark the email as permanently deleted (not TRASH) and only visible in Google Vault to a Vault administrator. Only used for Google Workspace accounts.
schema:
type: boolean
requestBody:
content:
application/json:
schema:
$ref: '#/definitions/Message'
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/Message'
/gmail/v1/users/{userId}/messages/send:
post:
description: Sends the specified message to the recipients in the `To`, `Cc`, and `Bcc` headers. For example usage, see [Sending email](https://developers.google.com/workspace/gmail/api/guides/sending).
operationId: gmail.users.messages.send
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/definitions/Message'
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/Message'
/gmail/v1/users/{userId}/messages/{id}/modify:
post:
description: Modifies the labels on the specified message.
operationId: gmail.users.messages.modify
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: id
in: path
description: The ID of the message to modify.
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/definitions/ModifyMessageRequest'
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/Message'
/gmail/v1/users/{userId}/messages/batchModify:
post:
description: Modifies the labels on the specified messages.
operationId: gmail.users.messages.batchModify
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/definitions/BatchModifyMessagesRequest'
responses:
default:
description: Successful operation
/gmail/v1/users/{userId}/messages/{messageId}/attachments/{id}:
get:
description: Gets the specified message attachment.
operationId: gmail.users.messages.attachments.get
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: messageId
in: path
description: The ID of the message containing the attachment.
required: true
schema:
type: string
- name: id
in: path
description: The ID of the attachment.
required: true
schema:
type: string
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/MessagePartBody'
/gmail/v1/users/{userId}/labels:
get:
description: Lists all labels in the user's mailbox.
operationId: gmail.users.labels.list
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/ListLabelsResponse'
post:
description: Creates a new label.
operationId: gmail.users.labels.create
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/definitions/Label'
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/Label'
/gmail/v1/users/{userId}/labels/{id}:
get:
description: Gets the specified label.
operationId: gmail.users.labels.get
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: id
in: path
description: The ID of the label to retrieve.
required: true
schema:
type: string
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/Label'
put:
description: Updates the specified label.
operationId: gmail.users.labels.update
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: id
in: path
description: The ID of the label to update.
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/definitions/Label'
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/Label'
delete:
description: Immediately and permanently deletes the specified label and removes it from any messages and threads that it is applied to.
operationId: gmail.users.labels.delete
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: id
in: path
description: The ID of the label to delete.
required: true
schema:
type: string
responses:
default:
description: Successful operation
patch:
description: Patch the specified label.
operationId: gmail.users.labels.patch
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: id
in: path
description: The ID of the label to update.
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/definitions/Label'
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/Label'
/gmail/v1/users/{userId}/threads/{id}/trash:
post:
description: Moves the specified thread to the trash. Any messages that belong to the thread are also moved to the trash.
operationId: gmail.users.threads.trash
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: id
in: path
description: The ID of the thread to Trash.
required: true
schema:
type: string
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/Thread'
/gmail/v1/users/{userId}/threads/{id}/untrash:
post:
description: Removes the specified thread from the trash. Any messages that belong to the thread are also removed from the trash.
operationId: gmail.users.threads.untrash
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: id
in: path
description: The ID of the thread to remove from Trash.
required: true
schema:
type: string
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/Thread'
/gmail/v1/users/{userId}/threads/{id}:
get:
description: Gets the specified thread.
operationId: gmail.users.threads.get
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: id
in: path
description: The ID of the thread to retrieve.
required: true
schema:
type: string
- name: format
in: query
description: The format to return the messages in.
schema:
type: string
- name: metadataHeaders
in: query
description: When given and format is METADATA, only include headers specified.
schema:
type: string
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/Thread'
delete:
description: 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.
operationId: gmail.users.threads.delete
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: id
in: path
description: ID of the Thread to delete.
required: true
schema:
type: string
responses:
default:
description: Successful operation
/gmail/v1/users/{userId}/threads:
get:
description: Lists the threads in the user's mailbox.
operationId: gmail.users.threads.list
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: maxResults
in: query
description: Maximum number of threads to return. This field defaults to 100. The maximum allowed value for this field is 500.
schema:
type: integer
format: uint32
- name: pageToken
in: query
description: Page token to retrieve a specific page of results in the list.
schema:
type: string
- name: q
in: query
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.'
schema:
type: string
- name: labelIds
in: query
description: Only return threads with labels that match all of the specified label IDs.
schema:
type: string
- name: includeSpamTrash
in: query
description: Include threads from `SPAM` and `TRASH` in the results.
schema:
type: boolean
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/ListThreadsResponse'
/gmail/v1/users/{userId}/threads/{id}/modify:
post:
description: Modifies the labels applied to the thread. This applies to all messages in the thread.
operationId: gmail.users.threads.modify
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: id
in: path
description: The ID of the thread to modify.
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/definitions/ModifyThreadRequest'
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/Thread'
/gmail/v1/users/{userId}/settings/imap:
get:
description: Gets IMAP settings.
operationId: gmail.users.settings.getImap
parameters:
- name: userId
in: path
description: User's email address. The special value "me" can be used to indicate the authenticated user.
required: true
schema:
type: string
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/ImapSettings'
put:
description: Updates IMAP settings.
operationId: gmail.users.settings.updateImap
parameters:
- name: userId
in: path
description: User's email address. The special value "me" can be used to indicate the authenticated user.
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/definitions/ImapSettings'
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/ImapSettings'
/gmail/v1/users/{userId}/settings/pop:
get:
description: Gets POP settings.
operationId: gmail.users.settings.getPop
parameters:
- name: userId
in: path
description: User's email address. The special value "me" can be used to indicate the authenticated user.
required: true
schema:
type: string
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/PopSettings'
put:
description: Updates POP settings.
operationId: gmail.users.settings.updatePop
parameters:
- name: userId
in: path
description: User's email address. The special value "me" can be used to indicate the authenticated user.
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/definitions/PopSettings'
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/PopSettings'
/gmail/v1/users/{userId}/settings/vacation:
get:
description: Gets vacation responder settings.
operationId: gmail.users.settings.getVacation
parameters:
- name: userId
in: path
description: User's email address. The special value "me" can be used to indicate the authenticated user.
required: true
schema:
type: string
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/VacationSettings'
put:
description: Updates vacation responder settings.
operationId: gmail.users.settings.updateVacation
parameters:
- name: userId
in: path
description: User's email address. The special value "me" can be used to indicate the authenticated user.
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/definitions/VacationSettings'
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/VacationSettings'
/gmail/v1/users/{userId}/settings/language:
get:
description: Gets language settings.
operationId: gmail.users.settings.getLanguage
parameters:
- name: userId
in: path
description: User's email address. The special value "me" can be used to indicate the authenticated user.
required: true
schema:
type: string
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/LanguageSettings'
put:
description: 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.
operationId: gmail.users.settings.updateLanguage
parameters:
- name: userId
in: path
description: User's email address. The special value "me" can be used to indicate the authenticated user.
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/definitions/LanguageSettings'
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/LanguageSettings'
/gmail/v1/users/{userId}/settings/autoForwarding:
get:
description: Gets the auto-forwarding setting for the specified account.
operationId: gmail.users.settings.getAutoForwarding
parameters:
- name: userId
in: path
description: User's email address. The special value "me" can be used to indicate the authenticated user.
required: true
schema:
type: string
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/AutoForwarding'
put:
description: 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.
operationId: gmail.users.settings.updateAutoForwarding
parameters:
- name: userId
in: path
description: User's email address. The special value "me" can be used to indicate the authenticated user.
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/definitions/AutoForwarding'
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/AutoForwarding'
/gmail/v1/users/{userId}/settings/sendAs:
get:
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.
operationId: gmail.users.settings.sendAs.list
parameters:
- name: userId
in: path
description: User's email address. The special value "me" can be used to indicate the authenticated user.
required: true
schema:
type: string
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/ListSendAsResponse'
post:
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. This method is only available to service account clients that have been delegated domain-wide authority.
operationId: gmail.users.settings.sendAs.create
parameters:
- name: userId
in: path
description: User's email address. The special value "me" can be used to indicate the authenticated user.
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/definitions/SendAs'
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/SendAs'
/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}:
get:
description: Gets the specified send-as alias. Fails with an HTTP 404 error if the specified address is not a member of the collection.
operationId: gmail.users.settings.sendAs.get
parameters:
- name: userId
in: path
description: User's email address. The special value "me" can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: sendAsEmail
in: path
description: The send-as alias to be retrieved.
required: true
schema:
type: string
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/SendAs'
put:
description: 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.
operationId: gmail.users.settings.sendAs.update
parameters:
- name: userId
in: path
description: User's email address. The special value "me" can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: sendAsEmail
in: path
description: The send-as alias to be updated.
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/definitions/SendAs'
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/SendAs'
delete:
description: 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.
operationId: gmail.users.settings.sendAs.delete
parameters:
- name: userId
in: path
description: User's email address. The special value "me" can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: sendAsEmail
in: path
description: The send-as alias to be deleted.
required: true
schema:
type: string
responses:
default:
description: Successful operation
patch:
description: Patch the specified send-as alias.
operationId: gmail.users.settings.sendAs.patch
parameters:
- name: userId
in: path
description: User's email address. The special value "me" can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: sendAsEmail
in: path
description: The send-as alias to be updated.
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/definitions/SendAs'
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/SendAs'
/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/verify:
post:
description: 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.
operationId: gmail.users.settings.sendAs.verify
parameters:
- name: userId
in: path
description: User's email address. The special value "me" can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: sendAsEmail
in: path
description: The send-as alias to be verified.
required: true
schema:
type: string
responses:
default:
description: Successful operation
/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo:
get:
description: Lists S/MIME configs for the specified send-as alias.
operationId: gmail.users.settings.sendAs.smimeInfo.list
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: sendAsEmail
in: path
description: The email address that appears in the "From:" header for mail sent using this alias.
required: true
schema:
type: string
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/ListSmimeInfoResponse'
post:
description: Insert (upload) the given S/MIME config for the specified send-as alias. Note that pkcs12 format is required for the key.
operationId: gmail.users.settings.sendAs.smimeInfo.insert
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: sendAsEmail
in: path
description: The email address that appears in the "From:" header for mail sent using this alias.
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/definitions/SmimeInfo'
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/SmimeInfo'
/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}:
get:
description: Gets the specified S/MIME config for the specified send-as alias.
operationId: gmail.users.settings.sendAs.smimeInfo.get
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: sendAsEmail
in: path
description: The email address that appears in the "From:" header for mail sent using this alias.
required: true
schema:
type: string
- name: id
in: path
description: The immutable ID for the SmimeInfo.
required: true
schema:
type: string
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/SmimeInfo'
delete:
description: Deletes the specified S/MIME config for the specified send-as alias.
operationId: gmail.users.settings.sendAs.smimeInfo.delete
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: sendAsEmail
in: path
description: The email address that appears in the "From:" header for mail sent using this alias.
required: true
schema:
type: string
- name: id
in: path
description: The immutable ID for the SmimeInfo.
required: true
schema:
type: string
responses:
default:
description: Successful operation
/gmail/v1/users/{userId}/settings/sendAs/{sendAsEmail}/smimeInfo/{id}/setDefault:
post:
description: Sets the default S/MIME config for the specified send-as alias.
operationId: gmail.users.settings.sendAs.smimeInfo.setDefault
parameters:
- name: userId
in: path
description: The user's email address. The special value `me` can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: sendAsEmail
in: path
description: The email address that appears in the "From:" header for mail sent using this alias.
required: true
schema:
type: string
- name: id
in: path
description: The immutable ID for the SmimeInfo.
required: true
schema:
type: string
responses:
default:
description: Successful operation
/gmail/v1/users/{userId}/settings/cse/identities:
get:
description: 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](https://developers.google.com/identity/protocols/OAuth2ServiceAccount) that has [domain-wide delegation authority](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#delegatingauthority) to impersonate users with the `https://www.googleapis.com/auth/gmail.settings.basic` scope. For users managing their own identities and keypairs, requests require [hardware key encryption](https://support.google.com/a/answer/14153163) turned on and configured.
operationId: gmail.users.settings.cse.identities.list
parameters:
- name: userId
in: path
description: The requester's primary email address. To indicate the authenticated user, you can use the special value `me`.
required: true
schema:
type: string
- name: pageToken
in: query
description: 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.
schema:
type: string
- name: pageSize
in: query
description: The number of identities to return. If not provided, the page size will default to 20 entries.
schema:
type: integer
format: int32
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/ListCseIdentitiesResponse'
post:
description: 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 managing identities and keypairs for users in their organization, requests require authorization with a [service account](https://developers.google.com/identity/protocols/OAuth2ServiceAccount) that has [domain-wide delegation authority](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#delegatingauthority) to impersonate users with the `https://www.googleapis.com/auth/gmail.settings.basic` scope. For users managing their own identities and keypairs, requests require [hardware key encryption](https://support.google.com/a/answer/14153163) turned on and configured.
operationId: gmail.users.settings.cse.identities.create
parameters:
- name: userId
in: path
description: The requester's primary email address. To indicate the authenticated user, you can use the special value `me`.
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/definitions/CseIdentity'
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/CseIdentity'
/gmail/v1/users/{userId}/settings/cse/identities/{cseEmailAddress}:
get:
description: 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](https://developers.google.com/identity/protocols/OAuth2ServiceAccount) that has [domain-wide delegation authority](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#delegatingauthority) to impersonate users with the `https://www.googleapis.com/auth/gmail.settings.basic` scope. For users managing their own identities and keypairs, requests require [hardware key encryption](https://support.google.com/a/answer/14153163) turned on and configured.
operationId: gmail.users.settings.cse.identities.get
parameters:
- name: userId
in: path
description: The requester's primary email address. To indicate the authenticated user, you can use the special value `me`.
required: true
schema:
type: string
- name: cseEmailAddress
in: path
description: The primary email address associated with the client-side encryption identity configuration that's retrieved.
required: true
schema:
type: string
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/CseIdentity'
delete:
description: 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 managing identities and keypairs for users in their organization, requests require authorization with a [service account](https://developers.google.com/identity/protocols/OAuth2ServiceAccount) that has [domain-wide delegation authority](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#delegatingauthority) to impersonate users with the `https://www.googleapis.com/auth/gmail.settings.basic` scope. For users managing their own identities and keypairs, requests require [hardware key encryption](https://support.google.com/a/answer/14153163) turned on and configured.
operationId: gmail.users.settings.cse.identities.delete
parameters:
- name: userId
in: path
description: The requester's primary email address. To indicate the authenticated user, you can use the special value `me`.
required: true
schema:
type: string
- name: cseEmailAddress
in: path
description: The primary email address associated with the client-side encryption identity configuration that's removed.
required: true
schema:
type: string
responses:
default:
description: Successful operation
/gmail/v1/users/{userId}/settings/cse/identities/{emailAddress}:
patch:
description: 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). For administrators managing identities and keypairs for users in their organization, requests require authorization with a [service account](https://developers.google.com/identity/protocols/OAuth2ServiceAccount) that has [domain-wide delegation authority](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#delegatingauthority) to impersonate users with the `https://www.googleapis.com/auth/gmail.settings.basic` scope. For users managing their own identities and keypairs, requests require [hardware key encryption](https://support.google.com/a/answer/14153163) turned on and configured.
operationId: gmail.users.settings.cse.identities.patch
parameters:
- name: userId
in: path
description: The requester's primary email address. To indicate the authenticated user, you can use the special value `me`.
required: true
schema:
type: string
- name: emailAddress
in: path
description: The email address of the client-side encryption identity to update.
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/definitions/CseIdentity'
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/CseIdentity'
/gmail/v1/users/{userId}/settings/cse/keypairs:
get:
description: 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](https://developers.google.com/identity/protocols/OAuth2ServiceAccount) that has [domain-wide delegation authority](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#delegatingauthority) to impersonate users with the `https://www.googleapis.com/auth/gmail.settings.basic` scope. For users managing their own identities and keypairs, requests require [hardware key encryption](https://support.google.com/a/answer/14153163) turned on and configured.
operationId: gmail.users.settings.cse.keypairs.list
parameters:
- name: userId
in: path
description: The requester's primary email address. To indicate the authenticated user, you can use the special value `me`.
required: true
schema:
type: string
- name: pageToken
in: query
description: 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.
schema:
type: string
- name: pageSize
in: query
description: The number of key pairs to return. If not provided, the page size will default to 20 entries.
schema:
type: integer
format: int32
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/ListCseKeyPairsResponse'
post:
description: 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.com/identity/protocols/OAuth2ServiceAccount) that has [domain-wide delegation authority](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#delegatingauthority) to impersonate users with the `https://www.googleapis.com/auth/gmail.settings.basic` scope. For users managing their own identities and keypairs, requests require [hardware key encryption](https://support.google.com/a/answer/14153163) turned on and configured.
operationId: gmail.users.settings.cse.keypairs.create
parameters:
- name: userId
in: path
description: The requester's primary email address. To indicate the authenticated user, you can use the special value `me`.
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/definitions/CseKeyPair'
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/CseKeyPair'
/gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}:disable:
post:
description: 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. For administrators managing identities and keypairs for users in their organization, requests require authorization with a [service account](https://developers.google.com/identity/protocols/OAuth2ServiceAccount) that has [domain-wide delegation authority](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#delegatingauthority) to impersonate users with the `https://www.googleapis.com/auth/gmail.settings.basic` scope. For users managing their own identities and keypairs, requests require [hardware key encryption](https://support.google.com/a/answer/14153163) turned on and configured.
operationId: gmail.users.settings.cse.keypairs.disable
parameters:
- name: userId
in: path
description: The requester's primary email address. To indicate the authenticated user, you can use the special value `me`.
required: true
schema:
type: string
- name: keyPairId
in: path
description: The identifier of the key pair to turn off.
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/definitions/DisableCseKeyPairRequest'
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/CseKeyPair'
/gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}:enable:
post:
description: 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://developers.google.com/identity/protocols/OAuth2ServiceAccount) that has [domain-wide delegation authority](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#delegatingauthority) to impersonate users with the `https://www.googleapis.com/auth/gmail.settings.basic` scope. For users managing their own identities and keypairs, requests require [hardware key encryption](https://support.google.com/a/answer/14153163) turned on and configured.
operationId: gmail.users.settings.cse.keypairs.enable
parameters:
- name: userId
in: path
description: The requester's primary email address. To indicate the authenticated user, you can use the special value `me`.
required: true
schema:
type: string
- name: keyPairId
in: path
description: The identifier of the key pair to turn on.
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/definitions/EnableCseKeyPairRequest'
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/CseKeyPair'
/gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}:
get:
description: 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](https://developers.google.com/identity/protocols/OAuth2ServiceAccount) that has [domain-wide delegation authority](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#delegatingauthority) to impersonate users with the `https://www.googleapis.com/auth/gmail.settings.basic` scope. For users managing their own identities and keypairs, requests require [hardware key encryption](https://support.google.com/a/answer/14153163) turned on and configured.
operationId: gmail.users.settings.cse.keypairs.get
parameters:
- name: userId
in: path
description: The requester's primary email address. To indicate the authenticated user, you can use the special value `me`.
required: true
schema:
type: string
- name: keyPairId
in: path
description: The identifier of the key pair to retrieve.
required: true
schema:
type: string
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/CseKeyPair'
/gmail/v1/users/{userId}/settings/cse/keypairs/{keyPairId}:obliterate:
post:
description: 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. For administrators managing identities and keypairs for users in their organization, requests require authorization with a [service account](https://developers.google.com/identity/protocols/OAuth2ServiceAccount) that has [domain-wide delegation authority](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#delegatingauthority) to impersonate users with the `https://www.googleapis.com/auth/gmail.settings.basic` scope. For users managing their own identities and keypairs, requests require [hardware key encryption](https://support.google.com/a/answer/14153163) turned on and configured.
operationId: gmail.users.settings.cse.keypairs.obliterate
parameters:
- name: userId
in: path
description: The requester's primary email address. To indicate the authenticated user, you can use the special value `me`.
required: true
schema:
type: string
- name: keyPairId
in: path
description: The identifier of the key pair to obliterate.
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/definitions/ObliterateCseKeyPairRequest'
responses:
default:
description: Successful operation
/gmail/v1/users/{userId}/settings/filters:
get:
description: Lists the message filters of a Gmail user.
operationId: gmail.users.settings.filters.list
parameters:
- name: userId
in: path
description: User's email address. The special value "me" can be used to indicate the authenticated user.
required: true
schema:
type: string
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/ListFiltersResponse'
post:
description: 'Creates a filter. Note: you can only create a maximum of 1,000 filters.'
operationId: gmail.users.settings.filters.create
parameters:
- name: userId
in: path
description: User's email address. The special value "me" can be used to indicate the authenticated user.
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/definitions/Filter'
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/Filter'
/gmail/v1/users/{userId}/settings/filters/{id}:
get:
description: Gets a filter.
operationId: gmail.users.settings.filters.get
parameters:
- name: userId
in: path
description: User's email address. The special value "me" can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: id
in: path
description: The ID of the filter to be fetched.
required: true
schema:
type: string
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/Filter'
delete:
description: Immediately and permanently deletes the specified filter.
operationId: gmail.users.settings.filters.delete
parameters:
- name: userId
in: path
description: User's email address. The special value "me" can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: id
in: path
description: The ID of the filter to be deleted.
required: true
schema:
type: string
responses:
default:
description: Successful operation
/gmail/v1/users/{userId}/settings/forwardingAddresses:
get:
description: Lists the forwarding addresses for the specified account.
operationId: gmail.users.settings.forwardingAddresses.list
parameters:
- name: userId
in: path
description: User's email address. The special value "me" can be used to indicate the authenticated user.
required: true
schema:
type: string
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/ListForwardingAddressesResponse'
post:
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`. This method is only available to service account clients that have been delegated domain-wide authority.
operationId: gmail.users.settings.forwardingAddresses.create
parameters:
- name: userId
in: path
description: User's email address. The special value "me" can be used to indicate the authenticated user.
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/definitions/ForwardingAddress'
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/ForwardingAddress'
/gmail/v1/users/{userId}/settings/forwardingAddresses/{forwardingEmail}:
get:
description: Gets the specified forwarding address.
operationId: gmail.users.settings.forwardingAddresses.get
parameters:
- name: userId
in: path
description: User's email address. The special value "me" can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: forwardingEmail
in: path
description: The forwarding address to be retrieved.
required: true
schema:
type: string
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/ForwardingAddress'
delete:
description: 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.
operationId: gmail.users.settings.forwardingAddresses.delete
parameters:
- name: userId
in: path
description: User's email address. The special value "me" can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: forwardingEmail
in: path
description: The forwarding address to be deleted.
required: true
schema:
type: string
responses:
default:
description: Successful operation
/gmail/v1/users/{userId}/settings/delegates:
get:
description: Lists the delegates for the specified account. This method is only available to service account clients that have been delegated domain-wide authority.
operationId: gmail.users.settings.delegates.list
parameters:
- name: userId
in: path
description: User's email address. The special value "me" can be used to indicate the authenticated user.
required: true
schema:
type: string
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/ListDelegatesResponse'
post:
description: 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.
operationId: gmail.users.settings.delegates.create
parameters:
- name: userId
in: path
description: User's email address. The special value "me" can be used to indicate the authenticated user.
required: true
schema:
type: string
requestBody:
content:
application/json:
schema:
$ref: '#/definitions/Delegate'
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/Delegate'
/gmail/v1/users/{userId}/settings/delegates/{delegateEmail}:
get:
description: 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.
operationId: gmail.users.settings.delegates.get
parameters:
- name: userId
in: path
description: User's email address. The special value "me" can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: delegateEmail
in: path
description: The email address of the user whose delegate relationship is to be retrieved.
required: true
schema:
type: string
responses:
default:
description: Successful operation
content:
application/json:
schema:
$ref: '#/definitions/Delegate'
delete:
description: 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.
operationId: gmail.users.settings.delegates.delete
parameters:
- name: userId
in: path
description: User's email address. The special value "me" can be used to indicate the authenticated user.
required: true
schema:
type: string
- name: delegateEmail
in: path
description: The email address of the user to be removed as a delegate.
required: true
schema:
type: string
responses:
default:
description: Successful operation
components:
schemas:
Draft:
type: object
properties:
id:
type: string
description: The immutable ID of the draft.
message:
$ref: '#/definitions/Message'
description: A draft email in the user's mailbox.
Message:
type: object
properties:
id:
type: string
description: The immutable ID of the message.
threadId:
type: string
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: 1. The requested `threadId` must be specified on the `Message` or `Draft.Message` you supply with your request. 2. The `References` and `In-Reply-To` headers must be set in compliance with the [RFC 2822](https://tools.ietf.org/html/rfc2822) standard. 3. The `Subject` headers must match. '
labelIds:
type: array
items:
type: string
description: List of IDs of labels applied to this message.
snippet:
type: string
description: A short part of the message text.
historyId:
type: string
description: The ID of the last history record that modified this message.
internalDate:
type: string
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.
payload:
$ref: '#/definitions/MessagePart'
sizeEstimate:
type: integer
description: Estimated size in bytes of the message.
raw:
type: string
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.
classificationLabelValues:
type: array
items:
$ref: '#/definitions/ClassificationLabelValue'
description: Classification Label values on the message. Available Classification Label schemas can be queried using the Google Drive Labels API. Each classification label ID must be unique. If duplicate IDs are provided, only one will be retained, and the selection is arbitrary. Only used for Google Workspace accounts.
description: An email message.
MessagePart:
type: object
properties:
partId:
type: string
description: The immutable ID of the message part.
mimeType:
type: string
description: The MIME type of the message part.
filename:
type: string
description: The filename of the attachment. Only present if this message part represents an attachment.
headers:
type: array
items:
$ref: '#/definitions/MessagePartHeader'
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`.
body:
$ref: '#/definitions/MessagePartBody'
parts:
type: array
items:
$ref: '#/definitions/MessagePart'
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: A single MIME message part.
MessagePartHeader:
type: object
properties:
name:
type: string
description: The name of the header before the `:` separator. For example, `To`.
value:
type: string
description: The value of the header after the `:` separator. For example, `someuser@example.com`.
MessagePartBody:
type: object
properties:
attachmentId:
type: string
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.
size:
type: integer
description: Number of bytes for the message part data (encoding notwithstanding).
data:
type: string
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.
description: The body of a single MIME message part.
ClassificationLabelValue:
type: object
properties:
labelId:
type: string
description: Required. The canonical or raw alphanumeric classification label ID. Maps to the ID field of the Google Drive Label resource.
fields:
type: array
items:
$ref: '#/definitions/ClassificationLabelFieldValue'
description: Field values for the given classification label ID.
description: Classification Labels applied to the email message. Classification Labels are different from Gmail inbox labels. Only used for Google Workspace accounts. [Learn more about classification labels](https://support.google.com/a/answer/9292382).
ClassificationLabelFieldValue:
type: object
properties:
fieldId:
type: string
description: Required. The field ID for the Classification Label Value. Maps to the ID field of the Google Drive `Label.Field` object.
selection:
type: string
description: Selection choice ID for the selection option. Should only be set if the field type is `SELECTION` in the Google Drive `Label.Field` object. Maps to the id field of the Google Drive `Label.Field.SelectionOptions` resource.
description: Field values for a classification label.
ListDraftsResponse:
type: object
properties:
drafts:
type: array
items:
$ref: '#/definitions/Draft'
description: List of drafts. Note that the `Message` property in each `Draft` resource only contains an `id` and a `threadId`. The [`messages.get`](https://developers.google.com/workspace/gmail/api/v1/reference/users/messages/get) method can fetch additional message details.
nextPageToken:
type: string
description: Token to retrieve the next page of results in the list.
resultSizeEstimate:
type: integer
description: Estimated total number of results.
ListHistoryResponse:
type: object
properties:
history:
type: array
items:
$ref: '#/definitions/History'
description: List of history records. Any `messages` contained in the response will typically only have `id` and `threadId` fields populated.
nextPageToken:
type: string
description: Page token to retrieve the next page of results in the list.
historyId:
type: string
description: The ID of the mailbox's current history record.
History:
type: object
properties:
id:
type: string
description: The mailbox sequence ID.
messages:
type: array
items:
$ref: '#/definitions/Message'
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.
messagesAdded:
type: array
items:
$ref: '#/definitions/HistoryMessageAdded'
description: Messages added to the mailbox in this history record.
messagesDeleted:
type: array
items:
$ref: '#/definitions/HistoryMessageDeleted'
description: Messages deleted (not Trashed) from the mailbox in this history record.
labelsAdded:
type: array
items:
$ref: '#/definitions/HistoryLabelAdded'
description: Labels added to messages in this history record.
labelsRemoved:
type: array
items:
$ref: '#/definitions/HistoryLabelRemoved'
description: Labels removed from messages in this history record.
description: A record of a change to the user's mailbox. Each history change may affect multiple messages in multiple ways.
HistoryMessageAdded:
type: object
properties:
message:
$ref: '#/definitions/Message'
HistoryMessageDeleted:
type: object
properties:
message:
$ref: '#/definitions/Message'
HistoryLabelAdded:
type: object
properties:
message:
$ref: '#/definitions/Message'
labelIds:
type: array
items:
type: string
description: Label IDs added to the message.
HistoryLabelRemoved:
type: object
properties:
message:
$ref: '#/definitions/Message'
labelIds:
type: array
items:
type: string
description: Label IDs removed from the message.
BatchDeleteMessagesRequest:
type: object
properties:
ids:
type: array
items:
type: string
description: The IDs of the messages to delete.
ListMessagesResponse:
type: object
properties:
messages:
type: array
items:
$ref: '#/definitions/Message'
description: List of messages. Note that each message resource contains only an `id` and a `threadId`. Additional message details can be fetched using the messages.get method.
nextPageToken:
type: string
description: Token to retrieve the next page of results in the list.
resultSizeEstimate:
type: integer
description: Estimated total number of results.
ModifyMessageRequest:
type: object
properties:
addLabelIds:
type: array
items:
type: string
description: A list of IDs of labels to add to this message. You can add up to 100 labels with each update.
removeLabelIds:
type: array
items:
type: string
description: A list IDs of labels to remove from this message. You can remove up to 100 labels with each update.
BatchModifyMessagesRequest:
type: object
properties:
ids:
type: array
items:
type: string
description: The IDs of the messages to modify. There is a limit of 1000 ids per request.
addLabelIds:
type: array
items:
type: string
description: A list of label IDs to add to messages.
removeLabelIds:
type: array
items:
type: string
description: A list of label IDs to remove from messages.
Label:
type: object
properties:
id:
type: string
description: The immutable ID of the label.
name:
type: string
description: The display name of the label.
messageListVisibility:
enum:
- show
- hide
type: string
description: The visibility of messages with this label in the message list in the Gmail web interface.
labelListVisibility:
enum:
- labelShow
- labelShowIfUnread
- labelHide
type: string
description: The visibility of the label in the label list in the Gmail web interface.
type:
enum:
- system
- user
type: string
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.
messagesTotal:
type: integer
description: The total number of messages with the label.
messagesUnread:
type: integer
description: The number of unread messages with the label.
threadsTotal:
type: integer
description: The total number of threads with the label.
threadsUnread:
type: integer
description: The number of unread threads with the label.
color:
$ref: '#/definitions/LabelColor'
description: Labels are used to categorize messages and threads within the user's mailbox. The maximum number of labels supported for a user's mailbox is 10,000.
LabelColor:
type: object
properties:
textColor:
type: string
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: \#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 \#464646, #e7e7e7, #0d3472, #b6cff5, #0d3b44, #98d7e4, #3d188e, #e3d7ff, \#711a36, #fbd3e0, #8a1c0a, #f2b2a8, #7a2e0b, #ffc8af, #7a4706, #ffdeb5, \#594c05, #fbe983, #684e07, #fdedc1, #0b4f30, #b3efd3, #04502e, #a2dcc1, \#c2c2c2, #4986e7, #2da2bb, #b99aff, #994a64, #f691b2, #ff7537, #ffad46, \#662e37, #ebdbde, #cca6ac, #094228, #42d692, #16a765'
backgroundColor:
type: string
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: \#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 \#464646, #e7e7e7, #0d3472, #b6cff5, #0d3b44, #98d7e4, #3d188e, #e3d7ff, \#711a36, #fbd3e0, #8a1c0a, #f2b2a8, #7a2e0b, #ffc8af, #7a4706, #ffdeb5, \#594c05, #fbe983, #684e07, #fdedc1, #0b4f30, #b3efd3, #04502e, #a2dcc1, \#c2c2c2, #4986e7, #2da2bb, #b99aff, #994a64, #f691b2, #ff7537, #ffad46, \#662e37, #ebdbde, #cca6ac, #094228, #42d692, #16a765'
ListLabelsResponse:
type: object
properties:
labels:
type: array
items:
$ref: '#/definitions/Label'
description: List of labels. Note that each label resource only contains an `id`, `name`, `messageListVisibility`, `labelListVisibility`, and `type`. The [`labels.get`](https://developers.google.com/workspace/gmail/api/v1/reference/users/labels/get) method can fetch additional label details.
Profile:
type: object
properties:
emailAddress:
type: string
description: The user's email address.
messagesTotal:
type: integer
description: The total number of messages in the mailbox.
threadsTotal:
type: integer
description: The total number of threads in the mailbox.
historyId:
type: string
description: The ID of the mailbox's current history record.
description: Profile for a Gmail user.
WatchRequest:
type: object
properties:
labelIds:
type: array
items:
type: string
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.
labelFilterAction:
enum:
- include
- exclude
type: string
description: Filtering behavior of `labelIds list` specified. This field is deprecated because it caused incorrect behavior in some cases; use `label_filter_behavior` instead.
labelFilterBehavior:
enum:
- include
- exclude
type: string
description: Filtering behavior of `labelIds list` specified. This field replaces `label_filter_action`; if set, `label_filter_action` is ignored.
topicName:
type: string
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). Note that the "my-project-identifier" portion must exactly match your Google developer project id (the one executing this watch request).
description: Set up or update a new push notification watch on this user's mailbox.
WatchResponse:
type: object
properties:
historyId:
type: string
description: The ID of the mailbox's current history record.
expiration:
type: string
description: When Gmail will stop sending notifications for mailbox updates (epoch millis). Call `watch` again before this time to renew the watch.
description: Push notification watch response.
Thread:
type: object
properties:
id:
type: string
description: The unique ID of the thread.
snippet:
type: string
description: A short part of the message text.
historyId:
type: string
description: The ID of the last history record that modified this thread.
messages:
type: array
items:
$ref: '#/definitions/Message'
description: The list of messages in the thread.
description: A collection of messages representing a conversation.
ListThreadsResponse:
type: object
properties:
threads:
type: array
items:
$ref: '#/definitions/Thread'
description: List of threads. Note that each thread resource does not contain a list of `messages`. The list of `messages` for a given thread can be fetched using the [`threads.get`](https://developers.google.com/workspace/gmail/api/v1/reference/users/threads/get) method.
nextPageToken:
type: string
description: Page token to retrieve the next page of results in the list.
resultSizeEstimate:
type: integer
description: Estimated total number of results.
ModifyThreadRequest:
type: object
properties:
addLabelIds:
type: array
items:
type: string
description: A list of IDs of labels to add to this thread. You can add up to 100 labels with each update.
removeLabelIds:
type: array
items:
type: string
description: A list of IDs of labels to remove from this thread. You can remove up to 100 labels with each update.
ListSendAsResponse:
type: object
properties:
sendAs:
type: array
items:
$ref: '#/definitions/SendAs'
description: List of send-as aliases.
description: Response for the ListSendAs method.
SendAs:
type: object
properties:
sendAsEmail:
type: string
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.
displayName:
type: string
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.
replyToAddress:
type: string
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.
signature:
type: string
description: An optional HTML signature that is included in messages composed with this alias in the Gmail web UI. This signature is added to new emails only.
isPrimary:
type: boolean
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.
isDefault:
type: boolean
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.
treatAsAlias:
type: boolean
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.
smtpMsa:
$ref: '#/definitions/SmtpMsa'
verificationStatus:
enum:
- verificationStatusUnspecified
- accepted
- pending
type: string
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: 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.
SmtpMsa:
type: object
properties:
host:
type: string
description: The hostname of the SMTP service. Required.
port:
type: integer
description: The port of the SMTP service. Required.
username:
type: string
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.
password:
type: string
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.
securityMode:
enum:
- securityModeUnspecified
- none
- ssl
- starttls
type: string
description: The protocol that will be used to secure communication with the SMTP service. Required.
description: Configuration for communication with an SMTP service.
ListSmimeInfoResponse:
type: object
properties:
smimeInfo:
type: array
items:
$ref: '#/definitions/SmimeInfo'
description: List of SmimeInfo.
SmimeInfo:
type: object
properties:
id:
type: string
description: The immutable ID for the SmimeInfo.
issuerCn:
type: string
description: The S/MIME certificate issuer's common name.
isDefault:
type: boolean
description: Whether this SmimeInfo is the default one for this user's send-as address.
expiration:
type: string
description: When the certificate expires (in milliseconds since epoch).
pem:
type: string
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).
pkcs12:
type: string
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.
encryptedKeyPassword:
type: string
description: Encrypted key password, when key is encrypted.
description: An S/MIME email config.
CseIdentity:
type: object
properties:
emailAddress:
type: string
description: The email address for the sending identity. The email address must be the primary email address of the authenticated user.
primaryKeyPairId:
type: string
description: If a key pair is associated, the ID of the key pair, CseKeyPair.
signAndEncryptKeyPairs:
$ref: '#/definitions/SignAndEncryptKeyPairs'
description: The client-side encryption (CSE) configuration for the email address of an authenticated user. Gmail uses CSE configurations to save drafts of client-side encrypted email messages, and to sign and send encrypted email messages. For administrators managing identities and keypairs for users in their organization, requests require authorization with a [service account](https://developers.google.com/identity/protocols/OAuth2ServiceAccount) that has [domain-wide delegation authority](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#delegatingauthority) to impersonate users with the `https://www.googleapis.com/auth/gmail.settings.basic` scope. For users managing their own identities and keypairs, requests require [hardware key encryption](https://support.google.com/a/answer/14153163) turned on and configured.
SignAndEncryptKeyPairs:
type: object
properties:
signingKeyPairId:
type: string
description: The ID of the CseKeyPair that signs outgoing mail.
encryptionKeyPairId:
type: string
description: The ID of the CseKeyPair that encrypts signed outgoing mail.
description: The configuration of a CSE identity that uses different key pairs for signing and encryption.
CseKeyPair:
type: object
properties:
keyPairId:
type: string
description: Output only. The immutable ID for the client-side encryption S/MIME key pair.
pkcs7:
type: string
description: Input only. The public key and its certificate chain. The chain must be in [PKCS#7](https://en.wikipedia.org/wiki/PKCS_7) format and use PEM encoding and ASCII armor.
pem:
type: string
description: Output only. The public key and its certificate chain, in [PEM](https://en.wikipedia.org/wiki/Privacy-Enhanced_Mail) format.
subjectEmailAddresses:
type: array
items:
type: string
description: Output only. The email address identities that are specified on the leaf certificate.
enablementState:
enum:
- stateUnspecified
- enabled
- disabled
type: string
description: Output only. The current state of the key pair.
disableTime:
type: string
description: Output only. If a key pair is set to `DISABLED`, the time that the key pair's state changed from `ENABLED` to `DISABLED`. This field is present only when the key pair is in state `DISABLED`.
privateKeyMetadata:
type: array
items:
$ref: '#/definitions/CsePrivateKeyMetadata'
description: Metadata for instances of this key pair's private key.
description: 'A client-side encryption S/MIME key pair, which is comprised of a public key, its certificate chain, and metadata for its paired private key. Gmail uses the key pair to complete the following tasks: - Sign outgoing client-side encrypted messages. - Save and reopen drafts of client-side encrypted messages. - Save and reopen sent messages. - Decrypt incoming or archived S/MIME messages. For administrators managing identities and keypairs for users in their organization, requests require authorization with a [service account](https://developers.google.com/identity/protocols/OAuth2ServiceAccount) that has [domain-wide delegation authority](https://developers.google.com/identity/protocols/OAuth2ServiceAccount#delegatingauthority) to impersonate users with the `https://www.googleapis.com/auth/gmail.settings.basic` scope. For users managing their own identities and keypairs, requests require [hardware key encryption](https://support.google.com/a/answer/14153163) turned on and configured.'
CsePrivateKeyMetadata:
type: object
properties:
privateKeyMetadataId:
type: string
description: Output only. The immutable ID for the private key metadata instance.
kaclsKeyMetadata:
$ref: '#/definitions/KaclsKeyMetadata'
hardwareKeyMetadata:
$ref: '#/definitions/HardwareKeyMetadata'
description: Metadata for a private key instance.
KaclsKeyMetadata:
type: object
properties:
kaclsUri:
type: string
description: The URI of the key access control list service that manages the private key.
kaclsData:
type: string
description: 'Opaque data generated and used by the key access control list service. Maximum size: 8 KiB.'
description: Metadata for private keys managed by an external key access control list service. For details about managing key access, see [Google Workspace CSE API Reference](https://developers.google.com/workspace/cse/reference).
HardwareKeyMetadata:
type: object
properties:
description:
type: string
description: Description about the hardware key.
description: Metadata for hardware keys. If [hardware key encryption](https://support.google.com/a/answer/14153163) is set up for the Google Workspace organization, users can optionally store their private key on their smart card and use it to sign and decrypt email messages in Gmail by inserting their smart card into a reader attached to their Windows device.
DisableCseKeyPairRequest:
type: object
description: Requests to turn off a client-side encryption key pair.
EnableCseKeyPairRequest:
type: object
description: Requests to turn on a client-side encryption key pair.
ListCseIdentitiesResponse:
type: object
properties:
cseIdentities:
type: array
items:
$ref: '#/definitions/CseIdentity'
description: One page of the list of CSE identities configured for the user.
nextPageToken:
type: string
description: Pagination token to be passed to a subsequent ListCseIdentities call in order to retrieve the next page of identities. If this value is not returned or is the empty string, then no further pages remain.
ListCseKeyPairsResponse:
type: object
properties:
cseKeyPairs:
type: array
items:
$ref: '#/definitions/CseKeyPair'
description: One page of the list of CSE key pairs installed for the user.
nextPageToken:
type: string
description: Pagination token to be passed to a subsequent ListCseKeyPairs call in order to retrieve the next page of key pairs. If this value is not returned, then no further pages remain.
ObliterateCseKeyPairRequest:
type: object
description: Request to obliterate a CSE key pair.
ListFiltersResponse:
type: object
properties:
filter:
type: array
items:
$ref: '#/definitions/Filter'
description: List of a user's filters.
description: Response for the ListFilters method.
Filter:
type: object
properties:
id:
type: string
description: The server assigned ID of the filter.
criteria:
$ref: '#/definitions/FilterCriteria'
action:
$ref: '#/definitions/FilterAction'
description: Resource definition for Gmail filters. Filters apply to specific messages instead of an entire email thread.
FilterCriteria:
type: object
properties:
from:
type: string
description: The sender's display name or email address.
to:
type: string
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.
subject:
type: string
description: Case-insensitive phrase found in the message's subject. Trailing and leading whitespace are be trimmed and adjacent spaces are collapsed.
query:
type: string
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"`.'
negatedQuery:
type: string
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"`.'
hasAttachment:
type: boolean
description: Whether the message has any attachment.
excludeChats:
type: boolean
description: Whether the response should exclude chats.
size:
type: integer
description: The size of the entire RFC822 message in bytes, including all headers and attachments.
sizeComparison:
enum:
- unspecified
- smaller
- larger
type: string
description: How the message size in bytes should be in relation to the size field.
description: Message matching criteria.
FilterAction:
type: object
properties:
addLabelIds:
type: array
items:
type: string
description: List of labels to add to the message.
removeLabelIds:
type: array
items:
type: string
description: List of labels to remove from the message.
forward:
type: string
description: Email address that the message should be forwarded to.
description: A set of actions to perform on a message.
ImapSettings:
type: object
properties:
enabled:
type: boolean
description: Whether IMAP is enabled for the account.
autoExpunge:
type: boolean
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.
expungeBehavior:
enum:
- expungeBehaviorUnspecified
- archive
- trash
- deleteForever
type: string
description: The action that will be executed on a message when it is marked as deleted and expunged from the last visible IMAP folder.
maxFolderSize:
type: integer
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: IMAP settings for an account.
PopSettings:
type: object
properties:
accessWindow:
enum:
- accessWindowUnspecified
- disabled
- fromNowOn
- allMail
type: string
description: The range of messages which are accessible via POP.
disposition:
enum:
- dispositionUnspecified
- leaveInInbox
- archive
- trash
- markRead
type: string
description: The action that will be executed on a message after it has been fetched via POP.
description: POP settings for an account.
VacationSettings:
type: object
properties:
enableAutoReply:
type: boolean
description: Flag that controls whether Gmail automatically replies to messages.
responseSubject:
type: string
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.
responseBodyPlainText:
type: string
description: Response body in plain text format. If both `response_body_plain_text` and `response_body_html` are specified, `response_body_html` will be used.
responseBodyHtml:
type: string
description: Response body in HTML format. Gmail will sanitize the HTML before storing it. If both `response_body_plain_text` and `response_body_html` are specified, `response_body_html` will be used.
restrictToContacts:
type: boolean
description: Flag that determines whether responses are sent to recipients who are not in the user's list of contacts.
restrictToDomain:
type: boolean
description: Flag that determines whether responses are sent to recipients who are outside of the user's domain. This feature is only available for Google Workspace users.
startTime:
type: string
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`.
endTime:
type: string
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`.
description: Vacation auto-reply settings for an account. These settings correspond to the "Vacation responder" feature in the web interface.
LanguageSettings:
type: object
properties:
displayLanguage:
type: string
description: The language to display Gmail in, formatted as an RFC 3066 Language Tag (for example `en-GB`, `fr` or `ja` for British English, French, or Japanese respectively). The set of languages supported by Gmail evolves over time, so please refer to the "Language" dropdown in the Gmail settings for all available options, as described in the language settings help article. For a table of sample values, see [Manage language settings](https://developers.google.com/workspace/gmail/api/guides/language-settings). Not all Gmail clients can display the same set of languages. In the case that a user's display language is not available for use on a particular client, said client automatically chooses to display in the closest supported variant (or a reasonable default).
description: Language settings for an account. These settings correspond to the "Language settings" feature in the web interface.
ListForwardingAddressesResponse:
type: object
properties:
forwardingAddresses:
type: array
items:
$ref: '#/definitions/ForwardingAddress'
description: List of addresses that may be used for forwarding.
description: Response for the ListForwardingAddresses method.
ForwardingAddress:
type: object
properties:
forwardingEmail:
type: string
description: An email address to which messages can be forwarded.
verificationStatus:
enum:
- verificationStatusUnspecified
- accepted
- pending
type: string
description: Indicates whether this address has been verified and is usable for forwarding. Read-only.
description: Settings for a forwarding address.
AutoForwarding:
type: object
properties:
enabled:
type: boolean
description: Whether all incoming mail is automatically forwarded to another address.
emailAddress:
type: string
description: Email address to which all incoming messages are forwarded. This email address must be a verified member of the forwarding addresses.
disposition:
enum:
- dispositionUnspecified
- leaveInInbox
- archive
- trash
- markRead
type: string
description: The state that a message should be left in after it has been forwarded.
description: Auto-forwarding settings for an account.
ListDelegatesResponse:
type: object
properties:
delegates:
type: array
items:
$ref: '#/definitions/Delegate'
description: List of the user's delegates (with any verification status). If an account doesn't have delegates, this field doesn't appear.
description: Response for the ListDelegates method.
Delegate:
type: object
properties:
delegateEmail:
type: string
description: The email address of the delegate.
verificationStatus:
enum:
- verificationStatusUnspecified
- accepted
- pending
- rejected
- expired
type: string
description: Indicates whether this address has been verified and can act as a delegate for the account. Read-only.
description: Settings for a delegate. Delegates can read, send, and delete messages, as well as view and add contacts, for the delegator's account. See "Set up mail delegation" for more information about delegates.