Skip to content

GCP.Vault reference

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.

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",
});
// 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",
});

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).

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",
},
});

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.

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 } },
});
// 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" } },
});

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).

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",
},
});