# Google Vault (/integrations/google_vault)





{/* MANUAL-CONTENT-START:intro */}

Use [Google Vault](https://workspace.google.com/products/vault/) in Sim to manage matters, holds, exports, and saved queries. Workflows can create and update matters, manage held accounts and collaborators, start exports, and download exported files.

{/* MANUAL-CONTENT-END */}

## OAuth scopes [#oauth-scopes]

Sim requests these scopes when someone connects a Google Vault account. For a self-hosted deployment, register your own app with the provider using the settings below. See [Integrations and OAuth](/platform/self-hosting/integrations-oauth) for setup.

| Setting | Value |
| - | - |
| Redirect URI | `<NEXT_PUBLIC_APP_URL>/api/auth/oauth2/callback/google-vault` |
| Environment variables | `GOOGLE_CLIENT_ID`, `GOOGLE_CLIENT_SECRET` |

| Scope | Description |
| - | - |
| `https://www.googleapis.com/auth/userinfo.email` | View email address |
| `https://www.googleapis.com/auth/userinfo.profile` | View basic profile info |
| `https://www.googleapis.com/auth/ediscovery` | Manage Google Vault matters, holds, and exports |
| `https://www.googleapis.com/auth/ediscovery.readonly` | View Google Vault matters, holds, and saved queries |
| `https://www.googleapis.com/auth/devstorage.read_only` | Read files from Google Cloud Storage |

## Use the block [#usage-instructions]

Connect Google Vault to manage the full matter lifecycle, create and manage holds and exports, and save reusable search queries for eDiscovery and compliance.

## Actions [#actions]

### Vault Create Export [#vault-create-export]

Create an export in a matter

<ReferenceDetails>
  #### Input [#input]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `matterId` | string | Yes | The matter ID (e.g., "12345678901234567890") |
  | `exportName` | string | Yes | Name for the export (avoid special characters) |
  | `corpus` | string | Yes | Data corpus to export (MAIL, DRIVE, GROUPS, HANGOUTS\_CHAT, VOICE) |
  | `accountEmails` | string | No | Comma-separated list of user emails to scope export (e.g., "[user1@example.com](mailto:user1@example.com), [user2@example.com](mailto:user2@example.com)") |
  | `orgUnitId` | string | No | Organization unit ID to scope export (e.g., "id:03ph8a2z1enx5q0", alternative to emails) |
  | `startTime` | string | No | Start time for date filtering (ISO 8601 format, e.g., "2024-01-01T00:00:00Z") |
  | `endTime` | string | No | End time for date filtering (ISO 8601 format, e.g., "2024-12-31T23:59:59Z") |
  | `terms` | string | No | Search query terms to filter exported content (e.g., "from:[sender@example.com](mailto:sender@example.com) subject:invoice") |

  #### Output [#output]

  | Parameter | Type | Description |
  | - | - | - |
  | `export` | json | Created export object |
</ReferenceDetails>

### Vault List Exports [#vault-list-exports]

List exports for a matter

<ReferenceDetails>
  #### Input [#input-1]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `matterId` | string | Yes | The matter ID (e.g., "12345678901234567890") |
  | `pageSize` | number | No | Number of exports to return per page |
  | `pageToken` | string | No | Token for pagination |
  | `exportId` | string | No | Optional export ID to fetch a specific export (e.g., "exportId123456") |

  #### Output [#output-1]

  | Parameter | Type | Description |
  | - | - | - |
  | `exports` | json | Array of export objects |
  | `export` | json | Single export object (when exportId is provided) |
  | `nextPageToken` | string | Token for fetching next page of results |
</ReferenceDetails>

### Vault Delete Export [#vault-delete-export]

Delete an export from a matter

<ReferenceDetails>
  #### Input [#input-2]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `matterId` | string | Yes | The matter ID (e.g., "12345678901234567890") |
  | `exportId` | string | Yes | The export ID to delete (e.g., "exportId123456") |

  #### Output [#output-2]

  | Parameter | Type | Description |
  | - | - | - |
  | `success` | boolean | Whether the export was deleted |
</ReferenceDetails>

### Vault Download Export File [#vault-download-export-file]

Download a single file from a Google Vault export (GCS object)

<ReferenceDetails>
  #### Input [#input-3]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `matterId` | string | Yes | The matter ID (e.g., "12345678901234567890") |
  | `bucketName` | string | Yes | GCS bucket name from cloudStorageSink.files.bucketName |
  | `objectName` | string | Yes | GCS object name from cloudStorageSink.files.objectName |
  | `fileName` | string | No | Optional filename override for the downloaded file |

  #### Output [#output-3]

  | Parameter | Type | Description |
  | - | - | - |
  | `file` | file | Downloaded Vault export file stored in execution files |
</ReferenceDetails>

### Vault Create Hold [#vault-create-hold]

Create a hold in a matter

<ReferenceDetails>
  #### Input [#input-4]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `matterId` | string | Yes | The matter ID (e.g., "12345678901234567890") |
  | `holdName` | string | Yes | Name for the hold |
  | `corpus` | string | Yes | Data corpus to hold (MAIL, DRIVE, GROUPS, HANGOUTS\_CHAT, VOICE) |
  | `accountEmails` | string | No | Comma-separated list of user emails to put on hold (e.g., "[user1@example.com](mailto:user1@example.com), [user2@example.com](mailto:user2@example.com)") |
  | `orgUnitId` | string | No | Organization unit ID to put on hold (e.g., "id:03ph8a2z1enx5q0", alternative to accounts) |
  | `terms` | string | No | Search terms to filter held content (e.g., "from:[sender@example.com](mailto:sender@example.com) subject:invoice", for MAIL and GROUPS corpus) |
  | `startTime` | string | No | Start time for date filtering (ISO 8601 format, e.g., "2024-01-01T00:00:00Z", for MAIL and GROUPS corpus) |
  | `endTime` | string | No | End time for date filtering (ISO 8601 format, e.g., "2024-12-31T23:59:59Z", for MAIL and GROUPS corpus) |
  | `includeSharedDrives` | boolean | No | Include files in shared drives (for DRIVE corpus) |

  #### Output [#output-4]

  | Parameter | Type | Description |
  | - | - | - |
  | `hold` | json | Created hold object |
</ReferenceDetails>

### Vault List Holds [#vault-list-holds]

List holds for a matter

<ReferenceDetails>
  #### Input [#input-5]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `matterId` | string | Yes | The matter ID (e.g., "12345678901234567890") |
  | `pageSize` | number | No | Number of holds to return per page |
  | `pageToken` | string | No | Token for pagination |
  | `holdId` | string | No | Optional hold ID to fetch a specific hold (e.g., "holdId123456") |

  #### Output [#output-5]

  | Parameter | Type | Description |
  | - | - | - |
  | `holds` | json | Array of hold objects |
  | `hold` | json | Single hold object (when holdId is provided) |
  | `nextPageToken` | string | Token for fetching next page of results |
</ReferenceDetails>

### Vault Update Hold [#vault-update-hold]

Replace the name, query, and scope of an existing hold. This is a full-resource update: fetch the current hold first (Vault List Holds) and resupply every field you want to keep — any field left blank is cleared, not left unchanged.

<ReferenceDetails>
  #### Input [#input-6]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `matterId` | string | Yes | The matter ID (e.g., "12345678901234567890") |
  | `holdId` | string | Yes | The hold ID to update (e.g., "holdId123456") |
  | `holdName` | string | Yes | Name for the hold |
  | `corpus` | string | Yes | Data corpus of the hold (MAIL, DRIVE, GROUPS, HANGOUTS\_CHAT, VOICE) |
  | `accountEmails` | string | No | Comma-separated list of user emails covered by the hold (e.g., "[user1@example.com](mailto:user1@example.com), [user2@example.com](mailto:user2@example.com)") |
  | `orgUnitId` | string | No | Organization unit ID covered by the hold (e.g., "id:03ph8a2z1enx5q0", alternative to accounts) |
  | `terms` | string | No | Search terms to filter held content (e.g., "from:[sender@example.com](mailto:sender@example.com) subject:invoice", for MAIL and GROUPS corpus). Resupply the hold's current terms to keep them — this replaces the hold, so leaving it blank clears any existing filter. |
  | `startTime` | string | No | Start time for date filtering (ISO 8601 format, e.g., "2024-01-01T00:00:00Z", for MAIL and GROUPS corpus). Resupply the hold's current value to keep it — leaving it blank clears any existing date filter. |
  | `endTime` | string | No | End time for date filtering (ISO 8601 format, e.g., "2024-12-31T23:59:59Z", for MAIL and GROUPS corpus). Resupply the hold's current value to keep it — leaving it blank clears any existing date filter. |
  | `includeSharedDrives` | boolean | No | Include files in shared drives (for DRIVE corpus). Resupply true if the hold currently includes shared drives — leaving it false/blank clears that setting. |

  #### Output [#output-6]

  | Parameter | Type | Description |
  | - | - | - |
  | `hold` | json | Updated hold object |
</ReferenceDetails>

### Vault Delete Hold [#vault-delete-hold]

Delete a hold and release its covered accounts

<ReferenceDetails>
  #### Input [#input-7]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `matterId` | string | Yes | The matter ID (e.g., "12345678901234567890") |
  | `holdId` | string | Yes | The hold ID to delete (e.g., "holdId123456") |

  #### Output [#output-7]

  | Parameter | Type | Description |
  | - | - | - |
  | `success` | boolean | Whether the hold was deleted |
</ReferenceDetails>

### Vault Add Held Accounts [#vault-add-held-accounts]

Add accounts to an existing hold

<ReferenceDetails>
  #### Input [#input-8]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `matterId` | string | Yes | The matter ID (e.g., "12345678901234567890") |
  | `holdId` | string | Yes | The hold ID to add accounts to (e.g., "holdId123456") |
  | `accountEmails` | string | Yes | Comma-separated list of user emails to add to the hold (e.g., "[user1@example.com](mailto:user1@example.com), [user2@example.com](mailto:user2@example.com)") |

  #### Output [#output-8]

  | Parameter | Type | Description |
  | - | - | - |
  | `responses` | array | Per-account results of the add operation |
  | ↳ `account` | json | Held account (accountId, email) |
  | ↳ `status` | json | Status (code, message) if the add failed |
</ReferenceDetails>

### Vault Remove Held Accounts [#vault-remove-held-accounts]

Remove accounts from an existing hold

<ReferenceDetails>
  #### Input [#input-9]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `matterId` | string | Yes | The matter ID (e.g., "12345678901234567890") |
  | `holdId` | string | Yes | The hold ID to remove accounts from (e.g., "holdId123456") |
  | `accountIds` | string | Yes | Comma-separated list of Admin SDK account IDs to remove from the hold (e.g., "accountId1, accountId2") |

  #### Output [#output-9]

  | Parameter | Type | Description |
  | - | - | - |
  | `statuses` | array | Per-account removal status, in request order |
</ReferenceDetails>

### Vault Create Matter [#vault-create-matter]

Create a new matter in Google Vault

<ReferenceDetails>
  #### Input [#input-10]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `name` | string | Yes | Name for the new matter |
  | `description` | string | No | Optional description for the matter |

  #### Output [#output-10]

  | Parameter | Type | Description |
  | - | - | - |
  | `matter` | json | Created matter object |
</ReferenceDetails>

### Vault List Matters [#vault-list-matters]

List matters, or get a specific matter if matterId is provided

<ReferenceDetails>
  #### Input [#input-11]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `pageSize` | number | No | Number of matters to return per page |
  | `pageToken` | string | No | Token for pagination |
  | `matterId` | string | No | Optional matter ID to fetch a specific matter (e.g., "12345678901234567890") |

  #### Output [#output-11]

  | Parameter | Type | Description |
  | - | - | - |
  | `matters` | json | Array of matter objects |
  | `matter` | json | Single matter object (when matterId is provided) |
  | `nextPageToken` | string | Token for fetching next page of results |
</ReferenceDetails>

### Vault Update Matter [#vault-update-matter]

Update the name and/or description of a matter

<ReferenceDetails>
  #### Input [#input-12]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `matterId` | string | Yes | The matter ID to update (e.g., "12345678901234567890") |
  | `name` | string | Yes | New name for the matter |
  | `description` | string | No | New description for the matter |

  #### Output [#output-12]

  | Parameter | Type | Description |
  | - | - | - |
  | `matter` | json | Updated matter object |
</ReferenceDetails>

### Vault Close Matter [#vault-close-matter]

Close a matter

<ReferenceDetails>
  #### Input [#input-13]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `matterId` | string | Yes | The matter ID to close (e.g., "12345678901234567890") |

  #### Output [#output-13]

  | Parameter | Type | Description |
  | - | - | - |
  | `matter` | json | Closed matter object |
</ReferenceDetails>

### Vault Reopen Matter [#vault-reopen-matter]

Reopen a closed matter

<ReferenceDetails>
  #### Input [#input-14]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `matterId` | string | Yes | The matter ID to reopen (e.g., "12345678901234567890") |

  #### Output [#output-14]

  | Parameter | Type | Description |
  | - | - | - |
  | `matter` | json | Reopened matter object |
</ReferenceDetails>

### Vault Delete Matter [#vault-delete-matter]

Permanently delete a matter (must be closed first)

<ReferenceDetails>
  #### Input [#input-15]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `matterId` | string | Yes | The matter ID to delete (e.g., "12345678901234567890") |

  #### Output [#output-15]

  | Parameter | Type | Description |
  | - | - | - |
  | `matter` | json | Deleted matter object |
</ReferenceDetails>

### Vault Undelete Matter [#vault-undelete-matter]

Restore a deleted matter

<ReferenceDetails>
  #### Input [#input-16]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `matterId` | string | Yes | The matter ID to restore (e.g., "12345678901234567890") |

  #### Output [#output-16]

  | Parameter | Type | Description |
  | - | - | - |
  | `matter` | json | Restored matter object |
</ReferenceDetails>

### Vault Add Matter Collaborator [#vault-add-matter-collaborator]

Add a collaborator (or transfer ownership) to a matter

<ReferenceDetails>
  #### Input [#input-17]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `matterId` | string | Yes | The matter ID (e.g., "12345678901234567890") |
  | `accountId` | string | Yes | Admin SDK account ID of the user to add as a collaborator/owner |
  | `role` | string | Yes | Permission level to grant: COLLABORATOR or OWNER |
  | `sendEmails` | boolean | No | Send a notification email to the added account |
  | `ccMe` | boolean | No | CC the requestor on the notification email (only relevant if sendEmails is true) |

  #### Output [#output-17]

  | Parameter | Type | Description |
  | - | - | - |
  | `permission` | json | Created matter permission (accountId, role) |
</ReferenceDetails>

### Vault Remove Matter Collaborator [#vault-remove-matter-collaborator]

Remove a collaborator from a matter

<ReferenceDetails>
  #### Input [#input-18]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `matterId` | string | Yes | The matter ID (e.g., "12345678901234567890") |
  | `accountId` | string | Yes | Admin SDK account ID of the collaborator to remove |

  #### Output [#output-18]

  | Parameter | Type | Description |
  | - | - | - |
  | `success` | boolean | Whether the collaborator was removed |
</ReferenceDetails>

### Vault Create Saved Query [#vault-create-saved-query]

Save a reusable search query in a matter

<ReferenceDetails>
  #### Input [#input-19]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `matterId` | string | Yes | The matter ID (e.g., "12345678901234567890") |
  | `displayName` | string | Yes | Name for the saved query |
  | `corpus` | string | Yes | Data corpus to search (MAIL, DRIVE, GROUPS, HANGOUTS\_CHAT, VOICE) |
  | `accountEmails` | string | No | Comma-separated list of user emails to scope the query (e.g., "[user1@example.com](mailto:user1@example.com), [user2@example.com](mailto:user2@example.com)") |
  | `orgUnitId` | string | No | Organization unit ID to scope the query (e.g., "id:03ph8a2z1enx5q0", alternative to emails) |
  | `startTime` | string | No | Start time for date filtering (ISO 8601 format, e.g., "2024-01-01T00:00:00Z") |
  | `endTime` | string | No | End time for date filtering (ISO 8601 format, e.g., "2024-12-31T23:59:59Z") |
  | `terms` | string | No | Search query terms (e.g., "from:[sender@example.com](mailto:sender@example.com) subject:invoice") |

  #### Output [#output-19]

  | Parameter | Type | Description |
  | - | - | - |
  | `savedQuery` | json | Created saved query object |
</ReferenceDetails>

### Vault List Saved Queries [#vault-list-saved-queries]

List saved queries in a matter, or get a specific one if savedQueryId is provided

<ReferenceDetails>
  #### Input [#input-20]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `matterId` | string | Yes | The matter ID (e.g., "12345678901234567890") |
  | `pageSize` | number | No | Number of saved queries to return per page |
  | `pageToken` | string | No | Token for pagination |
  | `savedQueryId` | string | No | Optional saved query ID to fetch a specific saved query |

  #### Output [#output-20]

  | Parameter | Type | Description |
  | - | - | - |
  | `savedQueries` | json | Array of saved query objects |
  | `savedQuery` | json | Single saved query object (when savedQueryId is provided) |
  | `nextPageToken` | string | Token for fetching next page of results |
</ReferenceDetails>

### Vault Delete Saved Query [#vault-delete-saved-query]

Delete a saved query from a matter

<ReferenceDetails>
  #### Input [#input-21]

  | Parameter | Type | Required | Description |
  | - | - | - | - |
  | `matterId` | string | Yes | The matter ID (e.g., "12345678901234567890") |
  | `savedQueryId` | string | Yes | The saved query ID to delete |

  #### Output [#output-21]

  | Parameter | Type | Description |
  | - | - | - |
  | `success` | boolean | Whether the saved query was deleted |
</ReferenceDetails>
