Skip to main content

POST /api/purge

Permanently deletes user or connection data. Supports two modes: purge all data for a user, or purge a single connection. Deletion is irreversible — vault encryption keys are destroyed, making stored credentials mathematically irrecoverable.

Request

Headers

Mode 1: Purge all user data

Deletes all connections and conversations for a user within your app.

Mode 2: Purge a single connection

Deletes one specific connection and its conversations.
Provide either userRef or connectionId, not both.

What gets deleted

For each affected connection:
  1. Vault key destroyed (vault_destroy) — encryption key deleted from connection_keys
  2. Browserbase context released (if present)
  3. Connection set to status: 'revoked', enc_blob: null
  4. Storage files removed from Supabase Storage bucket
  5. Conversations hard-deleted

Response

Webhooks

Errors