Query

The query definition used for search and export.

JSON representation
{
  "corpus": enum (CorpusType),
  "dataScope": enum (DataScope),
  "searchMethod": enum (SearchMethod),
  "method": enum (SearchMethod),
  "terms": string,
  "startTime": string,
  "endTime": string,
  "teamDriveInfo": {
    object (TeamDriveInfo)
  },
  "timeZone": string,

  // Union field search_method_field can be only one of the following:
  "accountInfo": {
    object (AccountInfo)
  },
  "orgUnitInfo": {
    object (OrgUnitInfo)
  },
  "sharedDriveInfo": {
    object (SharedDriveInfo)
  },
  "hangoutsChatInfo": {
    object (HangoutsChatInfo)
  }
  // End of list of possible types for union field search_method_field.

  // Union field corpus_options_field can be only one of the following:
  "mailOptions": {
    object (MailOptions)
  },
  "driveOptions": {
    object (DriveOptions)
  },
  "hangoutsChatOptions": {
    object (HangoutsChatOptions)
  },
  "voiceOptions": {
    object (VoiceOptions)
  }
  // End of list of possible types for union field corpus_options_field.
}
Fields
corpus

enum (CorpusType)

The Google Workspace service to search.

dataScope

enum (DataScope)

The data source to search.

searchMethod
(deprecated)

enum (SearchMethod)

The search method to use.

method

enum (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 to filter search results.

startTime

string (Timestamp format)

The start time for the search query. Specify in GMT. The value is rounded to 12 AM on the specified date.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

endTime

string (Timestamp format)

The end time for the search query. Specify in GMT. The value is rounded to 12 AM on the specified date.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

teamDriveInfo
(deprecated)

object (TeamDriveInfo)

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. For more information about how Vault uses time zones, see the Vault help center.

Union field search_method_field. When required, the details of the entities to search search_method_field can be only one of the following:
accountInfo

object (AccountInfo)

Required when SearchMethod is ACCOUNT.

orgUnitInfo

object (OrgUnitInfo)

Required when SearchMethod is ORG_UNIT.

sharedDriveInfo

object (SharedDriveInfo)

Required when SearchMethod is SHARED_DRIVE.

hangoutsChatInfo

object (HangoutsChatInfo)

Required when SearchMethod is ROOM. (read-only)

Union field corpus_options_field. Additional search options for specific services. corpus_options_field can be only one of the following:
mailOptions

object (MailOptions)

Set Gmail search-specific options.

driveOptions

object (DriveOptions)

Set Drive search-specific options.

hangoutsChatOptions

object (HangoutsChatOptions)

Set Chat search-specific options. (read-only)

voiceOptions

object (VoiceOptions)

Set Voice search-specific options.

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.
ORG_UNIT Search the data of all accounts in the organizational unit specified in OrgUnitInfo.
TEAM_DRIVE

Search the data in the Team Drive specified in teamDriveInfo.

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.
SHARED_DRIVE Search the files in the shared drives specified in SharedDriveInfo.

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.

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.

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.

TeamDriveInfo

Team Drives to search

JSON representation
{
  "teamDriveIds": [
    string
  ]
}
Fields
teamDriveIds[]
(deprecated)

string

List of Team Drive IDs, as provided by the Drive API.

MailOptions

Additional options for Gmail search

JSON representation
{
  "excludeDrafts": boolean
}
Fields
excludeDrafts

boolean

Set to true to exclude drafts.

DriveOptions

Additional options for Drive search

JSON representation
{
  "versionDate": string,
  "includeTeamDrives": boolean,
  "includeSharedDrives": boolean
}
Fields
versionDate

string (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.

A timestamp in RFC3339 UTC "Zulu" format, with nanosecond resolution and up to nine fractional digits. Examples: "2014-10-02T15:01:23Z" and "2014-10-02T15:01:23.045123456Z".

includeTeamDrives
(deprecated)

boolean

Set to true to include Team Drive.

includeSharedDrives

boolean

Set to true to include shared drives.

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 (VoiceCoveredData)
  ]
}
Fields
coveredData[]

enum (VoiceCoveredData)

Datatypes to search