- [JSON representation](https://developers.google.com/workspace/vault/reference/rest/v1/Query#SCHEMA_REPRESENTATION)
- [DataScope](https://developers.google.com/workspace/vault/reference/rest/v1/Query#DataScope)
- [SearchMethod](https://developers.google.com/workspace/vault/reference/rest/v1/Query#SearchMethod)
- [AccountInfo](https://developers.google.com/workspace/vault/reference/rest/v1/Query#AccountInfo)
  - [JSON representation](https://developers.google.com/workspace/vault/reference/rest/v1/Query#AccountInfo.SCHEMA_REPRESENTATION)
- [OrgUnitInfo](https://developers.google.com/workspace/vault/reference/rest/v1/Query#OrgUnitInfo)
  - [JSON representation](https://developers.google.com/workspace/vault/reference/rest/v1/Query#OrgUnitInfo.SCHEMA_REPRESENTATION)
- [SharedDriveInfo](https://developers.google.com/workspace/vault/reference/rest/v1/Query#SharedDriveInfo)
  - [JSON representation](https://developers.google.com/workspace/vault/reference/rest/v1/Query#SharedDriveInfo.SCHEMA_REPRESENTATION)
- [HangoutsChatInfo](https://developers.google.com/workspace/vault/reference/rest/v1/Query#HangoutsChatInfo)
  - [JSON representation](https://developers.google.com/workspace/vault/reference/rest/v1/Query#HangoutsChatInfo.SCHEMA_REPRESENTATION)
- [SitesUrlInfo](https://developers.google.com/workspace/vault/reference/rest/v1/Query#SitesUrlInfo)
  - [JSON representation](https://developers.google.com/workspace/vault/reference/rest/v1/Query#SitesUrlInfo.SCHEMA_REPRESENTATION)
- [DriveDocumentInfo](https://developers.google.com/workspace/vault/reference/rest/v1/Query#DriveDocumentInfo)
  - [JSON representation](https://developers.google.com/workspace/vault/reference/rest/v1/Query#DriveDocumentInfo.SCHEMA_REPRESENTATION)
- [DriveDocumentIds](https://developers.google.com/workspace/vault/reference/rest/v1/Query#DriveDocumentIds)
  - [JSON representation](https://developers.google.com/workspace/vault/reference/rest/v1/Query#DriveDocumentIds.SCHEMA_REPRESENTATION)
- [TeamDriveInfo](https://developers.google.com/workspace/vault/reference/rest/v1/Query#TeamDriveInfo)
  - [JSON representation](https://developers.google.com/workspace/vault/reference/rest/v1/Query#TeamDriveInfo.SCHEMA_REPRESENTATION)
- [MailOptions](https://developers.google.com/workspace/vault/reference/rest/v1/Query#MailOptions)
  - [JSON representation](https://developers.google.com/workspace/vault/reference/rest/v1/Query#MailOptions.SCHEMA_REPRESENTATION)
- [ClientSideEncryptedOption](https://developers.google.com/workspace/vault/reference/rest/v1/Query#ClientSideEncryptedOption)
- [DriveOptions](https://developers.google.com/workspace/vault/reference/rest/v1/Query#DriveOptions)
  - [JSON representation](https://developers.google.com/workspace/vault/reference/rest/v1/Query#DriveOptions.SCHEMA_REPRESENTATION)
- [SharedDrivesOption](https://developers.google.com/workspace/vault/reference/rest/v1/Query#SharedDrivesOption)
- [HangoutsChatOptions](https://developers.google.com/workspace/vault/reference/rest/v1/Query#HangoutsChatOptions)
  - [JSON representation](https://developers.google.com/workspace/vault/reference/rest/v1/Query#HangoutsChatOptions.SCHEMA_REPRESENTATION)
- [VoiceOptions](https://developers.google.com/workspace/vault/reference/rest/v1/Query#VoiceOptions)
  - [JSON representation](https://developers.google.com/workspace/vault/reference/rest/v1/Query#VoiceOptions.SCHEMA_REPRESENTATION)
- [CalendarOptions](https://developers.google.com/workspace/vault/reference/rest/v1/Query#CalendarOptions)
  - [JSON representation](https://developers.google.com/workspace/vault/reference/rest/v1/Query#CalendarOptions.SCHEMA_REPRESENTATION)
- [AttendeeResponse](https://developers.google.com/workspace/vault/reference/rest/v1/Query#AttendeeResponse)
- [GeminiOptions](https://developers.google.com/workspace/vault/reference/rest/v1/Query#GeminiOptions)
- [GeminiInWorkspaceOptions](https://developers.google.com/workspace/vault/reference/rest/v1/Query#GeminiInWorkspaceOptions)

The query definition used for search and export.

| JSON representation |
|---|
| ``` { "corpus": enum (`https://developers.google.com/workspace/vault/reference/rest/v1/CorpusType`), "dataScope": enum (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#DataScope`), "searchMethod": enum (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#SearchMethod`), "method": enum (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#SearchMethod`), "terms": string, "startTime": string, "endTime": string, "teamDriveInfo": { object (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#TeamDriveInfo`) }, "timeZone": string, "accountInfo": { object (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#AccountInfo`) }, "orgUnitInfo": { object (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#OrgUnitInfo`) }, "sharedDriveInfo": { object (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#SharedDriveInfo`) }, "hangoutsChatInfo": { object (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#HangoutsChatInfo`) }, "sitesUrlInfo": { object (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#SitesUrlInfo`) }, "driveDocumentInfo": { object (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#DriveDocumentInfo`) } "mailOptions": { object (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#MailOptions`) }, "driveOptions": { object (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#DriveOptions`) }, "hangoutsChatOptions": { object (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#HangoutsChatOptions`) }, "voiceOptions": { object (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#VoiceOptions`) }, "calendarOptions": { object (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#CalendarOptions`) }, "geminiOptions": { object (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#GeminiOptions`) }, "geminiInWorkspaceOptions": { object (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#GeminiInWorkspaceOptions`) } } ``` |

| Fields ||
|---|---|
| `corpus` | ``enum (`https://developers.google.com/workspace/vault/reference/rest/v1/CorpusType`)`` The Google Workspace service to search. |
| `dataScope` | ``enum (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#DataScope`)`` The data source to search. |
| `searchMethod (deprecated)` | ``enum (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#SearchMethod`)`` > [!WARNING] > This field was deprecated on June 10, 2019. Please use **method** instead. Support for this field will end on June 1, 2020. The search method to use. |
| `method` | ``enum (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#SearchMethod`)`` The entity to search. This field replaces **searchMethod** to support shared drives. When **searchMethod** is **TEAM_DRIVE** , the response of this field is **SHARED_DRIVE**. |
| `terms` | `string` Service-specific [search operators](https://support.google.com/vault/answer/2474474) to filter search results. |
| `startTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` The start time for the search query. Specify in GMT. The value is rounded to 12 AM on the specified date. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `endTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` The end time for the search query. Specify in GMT. The value is rounded to 12 AM on the specified date. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `teamDriveInfo (deprecated)` | ``object (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#TeamDriveInfo`)`` > [!WARNING] > This field was deprecated on June 10, 2019. Please use **SharedDriveInfo** instead. Support for this field will end on June 1, 2020. Required when **SearchMethod** is **TEAM_DRIVE**. |
| `timeZone` | `string` The time zone name. It should be an IANA TZ name, such as "America/Los_Angeles". For a list of time zone names, see [Time Zone](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). For more information about how Vault uses time zones, see [the Vault help center](https://support.google.com/vault/answer/6092995#time). |
| Specifies the details of the entities to search, when required. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `accountInfo` | ``object (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#AccountInfo`)`` Required when **SearchMethod** is **ACCOUNT**. |
| `orgUnitInfo` | ``object (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#OrgUnitInfo`)`` Required when **SearchMethod** is **ORG_UNIT**. |
| `sharedDriveInfo` | ``object (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#SharedDriveInfo`)`` Required when **SearchMethod** is **SHARED_DRIVE**. |
| `hangoutsChatInfo` | ``object (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#HangoutsChatInfo`)`` Required when **SearchMethod** is **ROOM**. (read-only) |
| `sitesUrlInfo` | ``object (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#SitesUrlInfo`)`` Required when **SearchMethod** is **SITES_URL**. |
| `driveDocumentInfo` | ``object (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#DriveDocumentInfo`)`` Required when **SearchMethod** is **DRIVE_DOCUMENT**. |
| End of mutually exclusive fields. ||
| Additional search options for specific services. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `mailOptions` | ``object (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#MailOptions`)`` Set Gmail search-specific options. |
| `driveOptions` | ``object (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#DriveOptions`)`` Set Drive search-specific options. |
| `hangoutsChatOptions` | ``object (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#HangoutsChatOptions`)`` Set Chat search-specific options. (read-only) |
| `voiceOptions` | ``object (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#VoiceOptions`)`` Set Voice search-specific options. |
| `calendarOptions` | ``object (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#CalendarOptions`)`` Set Calendar search-specific options. |
| `geminiOptions` | ``object (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#GeminiOptions`)`` Set Gemini app search-specific options. |
| `geminiInWorkspaceOptions` | ``object (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#GeminiInWorkspaceOptions`)`` Set Gemini in Workspace search-specific options. |
| End of mutually exclusive fields. ||

## DataScope

The source of data to search.

| Enums ||
|---|---|
| `DATA_SCOPE_UNSPECIFIED` | No data source specified. |
| `ALL_DATA` | All available data. |
| `HELD_DATA` | Only data on hold. |
| `UNPROCESSED_DATA` | Only data not yet processed by Vault. (Gmail and Groups only) |

## SearchMethod

The entity type for the search.

| Enums ||
|---|---|
| `SEARCH_METHOD_UNSPECIFIED` | A search method must be specified or else it is rejected. |
| `ACCOUNT` | Search the data of the accounts specified in [AccountInfo](https://developers.google.com/workspace/vault/reference/rest/v1/Query#accountinfo). |
| `ORG_UNIT` | Search the data of all accounts in the organizational unit specified in [OrgUnitInfo](https://developers.google.com/workspace/vault/reference/rest/v1/Query#orgunitinfo). |
| `TEAM_DRIVE` | Search the data in the Team Drive specified in **teamDriveInfo**. > [!WARNING] > This field was deprecated on June 10, 2019. Please use **SHARED_DRIVE** instead. Support for this field will end on June 1, 2020. |
| `ENTIRE_ORG` | Search the data of all accounts in the organization. Supported only for Gmail. When specified, you don't need to specify **AccountInfo** or **OrgUnitInfo**. |
| `ROOM` | Search messages in the Chat spaces specified in [HangoutsChatInfo](https://developers.google.com/workspace/vault/reference/rest/v1/Query#hangoutschatinfo). |
| `SITES_URL` | Search for sites by the published site URLs specified in [SitesUrlInfo](https://developers.google.com/workspace/vault/reference/rest/v1/Query#sitesurlinfo). |
| `SHARED_DRIVE` | Search the files in the shared drives specified in [SharedDriveInfo](https://developers.google.com/workspace/vault/reference/rest/v1/Query#shareddriveinfo). |
| `DRIVE_DOCUMENT` | Retrieve the documents specified in DriveDocumentInfo. |

## AccountInfo

The accounts to search

| JSON representation |
|---|
| ``` { "emails": [ string ] } ``` |

| Fields ||
|---|---|
| `emails[]` | `string` A set of accounts to search. |

## OrgUnitInfo

The organizational unit to search

| JSON representation |
|---|
| ``` { "orgUnitId": string } ``` |

| Fields ||
|---|---|
| `orgUnitId` | `string` The name of the organizational unit to search, as provided by the [Admin SDK Directory API](https://developers.google.com/admin-sdk/directory/). |

## SharedDriveInfo

The shared drives to search

| JSON representation |
|---|
| ``` { "sharedDriveIds": [ string ] } ``` |

| Fields ||
|---|---|
| `sharedDriveIds[]` | `string` A list of shared drive IDs, as provided by the [Drive API](https://developers.google.com/drive). |

## HangoutsChatInfo

The Chat spaces to search

| JSON representation |
|---|
| ``` { "roomId": [ string ] } ``` |

| Fields ||
|---|---|
| `roomId[]` | `string` A list of Chat spaces IDs, as provided by the [Chat API](https://developers.google.com/workspace/chat). There is a limit of exporting from 500 Chat spaces per request. |

## SitesUrlInfo

The published site URLs of new Google Sites to search

| JSON representation |
|---|
| ``` { "urls": [ string ] } ``` |

| Fields ||
|---|---|
| `urls[]` | `string` A list of published site URLs. |

## DriveDocumentInfo

The Drive documents to search.

| JSON representation |
|---|
| ``` { "documentIds": { object (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#DriveDocumentIds`) } } ``` |

| Fields ||
|---|---|
| The format to retrieve the Drive documents. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `documentIds` | ``object (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#DriveDocumentIds`)`` Specify Drive documents by document ID. |
| End of mutually exclusive fields. ||

## DriveDocumentIds

Specify Drive documents by document ID.

| JSON representation |
|---|
| ``` { "ids": [ string ] } ``` |

| Fields ||
|---|---|
| `ids[]` | `string` Required. A list of Drive document IDs. |

## TeamDriveInfo

> [!WARNING]
> This field was deprecated on June 10, 2019. Please use **SharedDriveInfo** instead. Support for this field will end on June 1, 2020.

Team Drives to search

| JSON representation |
|---|
| ``` { "teamDriveIds": [ string ] } ``` |

| Fields ||
|---|---|
| `teamDriveIds[] (deprecated)` | `string` > [!WARNING] > This field was deprecated on June 10, 2019. Please use **sharedDriveIds** instead. Support for this field will end on June 1, 2020. List of Team Drive IDs, as provided by the [Drive API](https://developers.google.com/drive). |

## MailOptions

Additional options for Gmail search

| JSON representation |
|---|
| ``` { "excludeDrafts": boolean, "clientSideEncryptedOption": enum (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#ClientSideEncryptedOption`) } ``` |

| Fields ||
|---|---|
| `excludeDrafts` | `boolean` Set to **true** to exclude drafts. |
| `clientSideEncryptedOption` | ``enum (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#ClientSideEncryptedOption`)`` Specifies whether the results should include encrypted content, unencrypted content, or both. Defaults to including both. |

## ClientSideEncryptedOption

If your organization uses [Google Workspace Client-side encryption](https://support.google.com/a?p=cse_ov), the encryption status of content

| Enums ||
|---|---|
| `CLIENT_SIDE_ENCRYPTED_OPTION_UNSPECIFIED` | Encryption status unspecified. Results include both client-side encrypted and non-encrypted content. |
| `CLIENT_SIDE_ENCRYPTED_OPTION_ANY` | Include both client-side encrypted and unencrypted content in results. |
| `CLIENT_SIDE_ENCRYPTED_OPTION_ENCRYPTED` | Include client-side encrypted content only. |
| `CLIENT_SIDE_ENCRYPTED_OPTION_UNENCRYPTED` | Include unencrypted content only. |

## DriveOptions

Additional options for Drive search.

| JSON representation |
|---|
| ``` { "versionDate": string, "includeTeamDrives": boolean, "includeSharedDrives": boolean, "clientSideEncryptedOption": enum (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#ClientSideEncryptedOption`), "sharedDrivesOption": enum (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#SharedDrivesOption`) } ``` |

| Fields ||
|---|---|
| `versionDate` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Search the current version of the Drive file, but export the contents of the last version saved before 12:00 AM UTC on the specified date. Enter the date in UTC. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |
| `includeTeamDrives (deprecated)` | `boolean` > [!WARNING] > This field was deprecated on June 10, 2019. Please use **includeSharedDrives** instead. Support for this field will end on June 1, 2020. Set to true to include Team Drive. |
| `includeSharedDrives (deprecated)` | `boolean` > [!WARNING] > This field was deprecated on May 27, 2025. Please use **sharedDrivesOption** instead. Support for this field will end on May 27, 2026. Set to **true** to include shared drives. |
| `clientSideEncryptedOption` | ``enum (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#ClientSideEncryptedOption`)`` Set whether the results include only content encrypted with [Google Workspace Client-side encryption](https://support.google.com/a?p=cse_ov) content, only unencrypted content, or both. Defaults to both. Currently supported for Drive. |
| `sharedDrivesOption` | ``enum (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#SharedDrivesOption`)`` Optional. Options to include or exclude documents in shared drives. We recommend using this field over includeSharedDrives. This field overrides includeSharedDrives and includeTeamDrives when set. |

## SharedDrivesOption

Option on the type of shared drive documents to include.

| Enums ||
|---|---|
| `SHARED_DRIVES_OPTION_UNSPECIFIED` | No shared drive option specified. |
| `NOT_INCLUDED` | If a resource is in a shared drive, it isn't included in the search. |
| `INCLUDED_IF_ACCOUNT_IS_NOT_A_MEMBER` | Shared drive resources are only included in instances where the account is a collaborator on a resource but they are not a member of the shared drive. This maps to the **"Included only if documents shared directly (not due to shared drive membership)"** option in the Vault UI. (Previously "includeSharedDrives" off) |
| `INCLUDED` | Resources in shared drives are included in the search. (Previously "includeSharedDrives" on) |

## HangoutsChatOptions

Additional options for Google Chat search

| JSON representation |
|---|
| ``` { "includeRooms": boolean } ``` |

| Fields ||
|---|---|
| `includeRooms` | `boolean` For searches by account or organizational unit, set to **true** to include rooms. |

## VoiceOptions

Additional options for Voice search

| JSON representation |
|---|
| ``` { "coveredData": [ enum (`https://developers.google.com/workspace/vault/reference/rest/v1/VoiceCoveredData`) ] } ``` |

| Fields ||
|---|---|
| `coveredData[]` | ``enum (`https://developers.google.com/workspace/vault/reference/rest/v1/VoiceCoveredData`)`` Datatypes to search |

## CalendarOptions

Additional options for Calendar search

| JSON representation |
|---|
| ``` { "locationQuery": [ string ], "peopleQuery": [ string ], "minusWords": [ string ], "responseStatuses": [ enum (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#AttendeeResponse`) ], "versionDate": string } ``` |

| Fields ||
|---|---|
| `locationQuery[]` | `string` Matches only those events whose location contains all of the words in the given set. If the string contains quoted phrases, this method only matches those events whose location contain the exact phrase. Entries in the set are considered in "and". Word splitting example: \["New Zealand"\] vs \["New","Zealand"\] "New Zealand": matched by both "New and better Zealand": only matched by the later |
| `peopleQuery[]` | `string` Matches only those events whose attendees contain all of the words in the given set. Entries in the set are considered in "and". |
| `minusWords[]` | `string` Matches only those events that do not contain any of the words in the given set in title, description, location, or attendees. Entries in the set are considered in "or". |
| `responseStatuses[]` | ``enum (`https://developers.google.com/workspace/vault/reference/rest/v1/Query#AttendeeResponse`)`` Matches only events for which the custodian gave one of these responses. If the set is empty or contains ATTENDEE_RESPONSE_UNSPECIFIED there will be no filtering on responses. |
| `versionDate` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` Search the current version of the Calendar event, but export the contents of the last version saved before 12:00 AM UTC on the specified date. Enter the date in UTC. Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: `"2014-10-02T15:01:23Z"`, `"2014-10-02T15:01:23.045123456Z"` or `"2014-10-02T15:01:23+05:30"`. |

## AttendeeResponse

User response to an invitation.

| Enums ||
|---|---|
| `ATTENDEE_RESPONSE_UNSPECIFIED` | Attendee response unspecified. If this is set no filtering on responses will be done, all other attendee responses that are part of the query options are ignored. |
| `ATTENDEE_RESPONSE_NEEDS_ACTION` | The participant has been invited but has not responded yet. |
| `ATTENDEE_RESPONSE_ACCEPTED` | The participant plans to attend. |
| `ATTENDEE_RESPONSE_DECLINED` | The participant does not plan to attend. |
| `ATTENDEE_RESPONSE_TENTATIVE` | The participant expects to possibly attend. |

## GeminiOptions

This type has no fields.
Additional options for Gemini app search

## GeminiInWorkspaceOptions

This type has no fields.
Additional options for Gemini in Workspace search