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.

TTL and expiry

Every vault has a time-to-live (TTL). When the TTL elapses, the vault transitions to expired and all its contents — documents, files, and events — are deleted permanently.

Default TTL by plan

PlanDefault TTL
Hobby24 hours
Pro7 days (168 hours)
EnterpriseUnlimited (no auto-expiry)
TTL starts counting from when the vault is created, not when it is sealed.

Expiry warning webhook

Prudra fires a vault.expiring webhook 1 hour before expiry:
{
  "type":    "vault.expiring",
  "eventId": "evt_clx1abc123",
  "payload": {
    "vaultId":   "vlt_clx1abc123",
    "expiresAt": "2026-05-01T10:00:00.000Z"
  }
}
Use this to prompt users to download their results or to auto-persist if needed.

Extend TTL without persisting

Push the expiry forward using extendVaultTtl(). This does not consume persisted vault quota:
import { extendVaultTtl } from '@prudra/vault';

await extendVaultTtl({
  vaultId:  'vlt_clx1abc123',
  ttlHours: 48,  // new TTL from now — must not exceed plan maximum
});
Each call to extendVaultTtl() sets an absolute TTL from the current time — it doesn’t add to the remaining TTL.

Persist to survive past TTL

To keep a vault permanently (until manually deleted), use persist() instead of extendVaultTtl():
import { persistVault } from '@prudra/vault';
await persistVault({ vaultId: 'vlt_clx1abc123' });
Persisted vaults never auto-expire. They count against your persisted vault quota.

What happens on expiry

When a vault expires:
  1. All documents are deleted from the database
  2. All files are deleted from GCS (CDN URLs become invalid)
  3. All vault events are purged
  4. The vault ID returns 404 on any subsequent request
  5. A vault.expired webhook fires

Error handling

ErrorStatusCauseResolution
vault-expired404Vault TTL elapsedCannot recover — ensure you persist or download before expiry
ttl-exceeds-plan422Requested TTL over plan maxUse a lower TTL or upgrade plan