GCP.Vault reference
Matter
Section titled “Matter”Source:
src/GCP/Vault/Matter.ts
A Google Vault matter (eDiscovery case).
Vault matters have no labels field, so Alchemy stamps ownership into
description for list / nuke. The server-assigned id and data region
are identity — changing either replaces the matter. Name and description
update in place. Delete closes the matter first, then soft-deletes it.
Matter: Creating a Matter
Section titled “Matter: Creating a Matter”Generated name
const matter = yield* GCP.Vault.Matter("Case", {});Explicit name and description
const matter = yield* GCP.Vault.Matter("Case", { name: "Acme v Contoso", description: "litigation hold", matterRegion: "US",});Matter: Updating a Matter
Section titled “Matter: Updating a Matter”// Same logical id, changed props: the engine updates it in place.const matter = yield* GCP.Vault.Matter("Case", { name: "Acme v Contoso 2026", description: "litigation hold",});MattersExport
Section titled “MattersExport”Source:
src/GCP/Vault/MattersExport.ts
A Google Vault export on a matter.
Vault exports have no labels field, so Alchemy stamps ownership into
name for list / nuke. There is no update API — changing the query,
options, or name replaces the export (delete-first).
MattersExport: Creating an Export
Section titled “MattersExport: Creating an Export”Mail export
const exported = yield* GCP.Vault.MattersExport("Mail", { matterId: matter.matterId, query: { corpus: "MAIL", dataScope: "ALL_DATA", searchMethod: "ACCOUNT", accountInfo: { emails: ["user@example.com"] }, }, exportOptions: { mailOptions: { exportFormat: "MBOX" } },});Drive export with a name
const exported = yield* GCP.Vault.MattersExport("Drive", { matterId: matter.matterId, name: "drive-dump", query: { corpus: "DRIVE", dataScope: "HELD_DATA", searchMethod: "ENTIRE_ORG", },});MattersHold
Section titled “MattersHold”Source:
src/GCP/Vault/MattersHold.ts
A Google Vault hold on a matter.
Vault holds have no labels field, so Alchemy stamps ownership into
name for list / nuke. Parent matter, hold id, corpus, and name are
identity. Query, accounts, and org unit update in place. Switching
between accounts and an org unit replaces the hold.
MattersHold: Creating a Hold
Section titled “MattersHold: Creating a Hold”Mail hold on accounts
const hold = yield* GCP.Vault.MattersHold("Mail", { matterId: matter.matterId, corpus: "MAIL", accounts: [{ email: "user@example.com" }], query: { mailQuery: { terms: "subject:contract" } },});Drive hold on an org unit
const hold = yield* GCP.Vault.MattersHold("Drive", { matterId: matter.matterId, name: "Drive OU", corpus: "DRIVE", orgUnit: { orgUnitId: "id:ou" }, query: { driveQuery: { includeSharedDriveFiles: true } },});MattersHold: Updating a Hold
Section titled “MattersHold: Updating a Hold”// Same logical id, changed props: the engine updates it in place.const hold = yield* GCP.Vault.MattersHold("Mail", { matterId: matter.matterId, corpus: "MAIL", accounts: [{ email: "user@example.com" }], query: { mailQuery: { terms: "subject:contract 2026" } },});MattersSavedQuery
Section titled “MattersSavedQuery”Source:
src/GCP/Vault/MattersSavedQuery.ts
A Google Vault saved query on a matter.
Vault saved queries have no labels field, so Alchemy stamps ownership
into displayName for list / nuke. There is no update API — changing
the query or display name replaces the saved query (delete-first).
MattersSavedQuery: Creating a Saved Query
Section titled “MattersSavedQuery: Creating a Saved Query”Mail search
const saved = yield* GCP.Vault.MattersSavedQuery("Contracts", { matterId: matter.matterId, query: { corpus: "MAIL", dataScope: "ALL_DATA", searchMethod: "ACCOUNT", accountInfo: { emails: ["user@example.com"] }, terms: "subject:contract", },});Named Drive search
const saved = yield* GCP.Vault.MattersSavedQuery("Drive", { matterId: matter.matterId, displayName: "shared-drives", query: { corpus: "DRIVE", dataScope: "ALL_DATA", searchMethod: "ENTIRE_ORG", },});