Skip to main content
Deleted-database lifecycle endpoints require a full-account API key.

List recently deleted databases

GET /api/v1/databases/deleted Returns unpurged tombstones owned by the API-key owner. Each item includes deletedAt, purgeAfter, recoveryStatus and metadata for the exact verified deletion backup:
recoveryStatus is recoverable, unavailable, or expired. An incomplete backup or access-snapshot binding is reported as unavailable rather than being offered for recovery. deletionBackup.downloadUrl is null after purgeAfter, even while metadata remains visible during a short purge retry.

Download the deletion backup

GET /api/v1/databases/{id}/deletion-backup Returns the exact operation-bound deletion artifact as a download or short-lived redirect. The caller cannot select a filename. The route returns 404 DELETION_BACKUP_NOT_AVAILABLE after expiry, purge, ownership mismatch or any database, operation, backup, verification or retention-binding mismatch.

Recover the database

POST /api/v1/databases/{id}/recover When an older deletion has no recorded connection cap and native database caps are enabled, the endpoint returns 409 RECOVERY_CAP_SELECTION_REQUIRED with the currently allowed range. Retry with the same required Idempotency-Key and { "serverConnectionCap": 2 } (choose a value within that range). This records a new customer choice for the recovered database; it does not claim to reconstruct the previous cap. A supplied cap cannot override a saved cap or an invalid or conflicting identity/OID binding. The CLI accepts the same choice with --connection-cap N. If native caps are explicitly disabled, recovery keeps the current uncapped server policy; that is not evidence of the database’s previous cap. Unknown native mode or conflicting identity/OID evidence stops recovery. Returns 202 Accepted with an operation. Recovery requires available plan quota and restores the isolated PostgreSQL generation, active team memberships, the IP allowlist and still-existing selected-database API-key bindings. Missing users or keys are skipped and reported in the completed operation. Pending invitations are not restored. A deleted preview uses this same endpoint and a full-account key; a CI preview key cannot recover a deleted database. A successful recovery starts a new 24-hour preview lease. Later lease renewals can request up to 72 hours. Repeated requests reuse the recovery operation for that deletion. Refusals return 409 with a code: RECOVERY_CAPACITY_UNAVAILABLE (your current or pending plan has no free database slot; a recovery that already completed never holds a slot again, even after the database is deleted a second time), RECOVERY_WINDOW_CLOSED, RECOVERY_BACKUP_UNAVAILABLE, RECOVERY_NOT_ENABLED, RECOVERY_OPERATION_TERMINAL, RECOVERY_CAP_SELECTION_INVALID, RECOVERY_CAP_SELECTION_NOT_ALLOWED, RECOVERY_CAP_SELECTION_REPLAY_CONFLICT or RECOVERY_SETTINGS_RECONCILIATION_REQUIRED. Other refusals use RECOVERY_NOT_AVAILABLE. After purgeAfter, download and recovery are disabled and DBHost permanently deletes the database and its deletion backup automatically. Permanent deletion can be briefly delayed by a safe retry; both are removed before the item disappears from this list.