- [Resource: Hold](https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#Hold)
  - [JSON representation](https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#Hold.SCHEMA_REPRESENTATION)
- [HeldOrgUnit](https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#HeldOrgUnit)
  - [JSON representation](https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#HeldOrgUnit.SCHEMA_REPRESENTATION)
- [CorpusQuery](https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#CorpusQuery)
  - [JSON representation](https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#CorpusQuery.SCHEMA_REPRESENTATION)
- [HeldDriveQuery](https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#HeldDriveQuery)
  - [JSON representation](https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#HeldDriveQuery.SCHEMA_REPRESENTATION)
- [HeldMailQuery](https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#HeldMailQuery)
  - [JSON representation](https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#HeldMailQuery.SCHEMA_REPRESENTATION)
- [HeldGroupsQuery](https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#HeldGroupsQuery)
  - [JSON representation](https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#HeldGroupsQuery.SCHEMA_REPRESENTATION)
- [HeldHangoutsChatQuery](https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#HeldHangoutsChatQuery)
  - [JSON representation](https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#HeldHangoutsChatQuery.SCHEMA_REPRESENTATION)
- [HeldVoiceQuery](https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#HeldVoiceQuery)
  - [JSON representation](https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#HeldVoiceQuery.SCHEMA_REPRESENTATION)
- [HeldCalendarQuery](https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#HeldCalendarQuery)
- [HeldGeminiQuery](https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#HeldGeminiQuery)
- [Methods](https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#METHODS_SUMMARY)

## Resource: Hold

A hold. A hold prevents the specified Google Workspace service from purging data for specific accounts or all members of an organizational unit.

To work with Vault resources, the account must have the [required Vault privileges](https://support.google.com/vault/answer/2799699) and access to the matter. To access a matter, the account must have created the matter, have the matter shared with them, or have the **View All Matters** privilege.

| JSON representation |
|---|
| ``` { "holdId": string, "name": string, "updateTime": string, "accounts": [ { object (`https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds.accounts#HeldAccount`) } ], "orgUnit": { object (`https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#HeldOrgUnit`) }, "corpus": enum (`https://developers.google.com/workspace/vault/reference/rest/v1/CorpusType`), "query": { object (`https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#CorpusQuery`) } } ``` |

| Fields ||
|---|---|
| `holdId` | `string` The unique immutable ID of the hold. Assigned during creation. |
| `name` | `string` The name of the hold. |
| `updateTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` The last time this hold was modified. 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"`. |
| `accounts[]` | ``object (`https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds.accounts#HeldAccount`)`` If set, the hold applies to the specified accounts and **orgUnit** must be empty. |
| `orgUnit` | ``object (`https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#HeldOrgUnit`)`` If set, the hold applies to all members of the organizational unit and **accounts** must be empty. This property is mutable. For Groups holds, set **accounts**. |
| `corpus` | ``enum (`https://developers.google.com/workspace/vault/reference/rest/v1/CorpusType`)`` The service to be searched. |
| `query` | ``object (`https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#CorpusQuery`)`` Service-specific options. If set, **CorpusQuery** must match **CorpusType**. |

## HeldOrgUnit

The organizational unit covered by a hold. This structure is immutable.

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

| Fields ||
|---|---|
| `orgUnitId` | `string` The organizational unit's immutable ID as provided by the [Admin SDK](https://developers.google.com/admin-sdk/). |
| `holdTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` When the organizational unit was put on hold. This property is immutable. 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"`. |

## CorpusQuery

Service-specific options for holds.

| JSON representation |
|---|
| ``` { "driveQuery": { object (`https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#HeldDriveQuery`) }, "mailQuery": { object (`https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#HeldMailQuery`) }, "groupsQuery": { object (`https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#HeldGroupsQuery`) }, "hangoutsChatQuery": { object (`https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#HeldHangoutsChatQuery`) }, "voiceQuery": { object (`https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#HeldVoiceQuery`) }, "calendarQuery": { object (`https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#HeldCalendarQuery`) }, "geminiQuery": { object (`https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#HeldGeminiQuery`) } } ``` |

| Fields ||
|---|---|
| If set, this must match the service type. The following is a list of mutually exclusive fields. At most one of the fields will be set in a response: ||
| `driveQuery` | ``object (`https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#HeldDriveQuery`)`` Service-specific options for Drive holds. If set, **CorpusType** must be **DRIVE**. |
| `mailQuery` | ``object (`https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#HeldMailQuery`)`` Service-specific options for Gmail holds. If set, **CorpusType** must be **MAIL**. |
| `groupsQuery` | ``object (`https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#HeldGroupsQuery`)`` Service-specific options for Groups holds. If set, **CorpusType** must be **GROUPS**. |
| `hangoutsChatQuery` | ``object (`https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#HeldHangoutsChatQuery`)`` Service-specific options for Chat holds. If set, **CorpusType** must be **HANGOUTS_CHAT**. |
| `voiceQuery` | ``object (`https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#HeldVoiceQuery`)`` Service-specific options for Voice holds. If set, **CorpusType** must be **VOICE**. |
| `calendarQuery` | ``object (`https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#HeldCalendarQuery`)`` Service-specific options for Calendar holds. If set, **CorpusType** must be **CALENDAR**. |
| `geminiQuery` | ``object (`https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds#HeldGeminiQuery`)`` Service-specific options for Gemini app holds. If set, **CorpusType** must be **GEMINI**. |
| End of mutually exclusive fields. ||

## HeldDriveQuery

Options for Drive holds.

| JSON representation |
|---|
| ``` { "includeTeamDriveFiles": boolean, "includeSharedDriveFiles": boolean } ``` |

| Fields ||
|---|---|
| `includeTeamDriveFiles (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. To include files in Team Drives in the hold, set to **true**. |
| `includeSharedDriveFiles` | `boolean` To include files in shared drives in the hold, set to **true**. |

## HeldMailQuery

Query options for Gmail holds.

| JSON representation |
|---|
| ``` { "terms": string, "startTime": string, "endTime": string } ``` |

| Fields ||
|---|---|
| `terms` | `string` The [search operators](https://support.google.com/vault/answer/2474474) used to refine the messages covered by the hold. |
| `startTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` The start time for the 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 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"`. |

## HeldGroupsQuery

Query options for group holds.

| JSON representation |
|---|
| ``` { "terms": string, "startTime": string, "endTime": string } ``` |

| Fields ||
|---|---|
| `terms` | `string` The [search operators](https://support.google.com/vault/answer/2474474) used to refine the messages covered by the hold. |
| `startTime` | ``string (`https://protobuf.dev/reference/protobuf/google.protobuf#timestamp` format)`` The start time for the 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 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"`. |

## HeldHangoutsChatQuery

Options for Chat holds.

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

| Fields ||
|---|---|
| `includeRooms` | `boolean` To include messages in Chat spaces the user was a member of, set to **true**. |

## HeldVoiceQuery

Options for Voice holds.

| 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`)`` A list of data types covered by the hold. Should be non-empty. Order does not matter and duplicates are ignored. |

## HeldCalendarQuery

This type has no fields.
Options for Calendar holds.

## HeldGeminiQuery

This type has no fields.
Options for Gemini app holds.

| ## Methods ||
|---|---|
| ### `https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds/addHeldAccounts` | Adds accounts to a hold. |
| ### `https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds/create` | Creates a hold in the specified matter. |
| ### `https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds/delete` | Removes the specified hold and releases the accounts or organizational unit covered by the hold. |
| ### `https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds/get` | Gets the specified hold. |
| ### `https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds/list` | Lists the holds in a matter. |
| ### `https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds/removeHeldAccounts` | Removes the specified accounts from a hold. |
| ### `https://developers.google.com/workspace/vault/reference/rest/v1/matters.holds/update` | Updates the scope (organizational unit or accounts) and query parameters of a hold. |