Skip to main content

Documentation Index

Fetch the complete documentation index at: https://docs.prudra.dev/llms.txt

Use this file to discover all available pages before exploring further.

Delete files

Delete an individual file from a vault without deleting the entire vault. Deletion removes the file from GCS and invalidates the CDN URL.
import { initialise } from '@prudra/core';
import { deleteVaultFile } from '@prudra/vault';

initialise({ apiKey: process.env.PRUDRA_API_KEY! });

await deleteVaultFile({
  vaultId: 'vlt_clx1abc123',
  fileId:  'fil_clx1abc123',
});

console.log('File deleted — CDN URL is now invalid');

What deletion does

  • Removes the file object from GCS immediately
  • CDN cache is invalidated within minutes
  • File record removed from vault manifest
  • Storage quota is freed
Deletion is permanent. There is no recovery path.

Deleting from a sealed vault

You can delete files from sealed vaults. The vault remains sealed — only the file is removed:
// Works even after seal
await deleteVaultFile({ vaultId: 'vlt_clx1abc123', fileId: 'fil_clx1abc123' });

Error handling

ErrorStatusCauseResolution
file-not-found404File ID doesn’t exist or already deletedNo action needed
vault-expired404Vault has expired (files already gone)No action needed