Skip to main content
Preview databases are available on Pro and Business. See Preview databases. Use a namespace-bound dbhci_ key for these endpoints. A full-account dbh_ key cannot substitute for a preview CI key. Previews are for synthetic test data; do not put production or personal data in them.

Create or replay

POST /api/v1/previews accepts ref, optional ttlHours (1–72, default 24) and optional scheduledBackup (none or daily, default none). The server derives the internal name and idempotency key from the CI namespace and ref. Repeating the same ref and choices returns the same preview; changing the choices for that ref conflicts. Creation counts against the existing total database quota. Optionally add "reserveOnly": true to reserve capacity and receive targetDatabaseId without creating the physical database. Repeat the same ref, TTL and backup choice without reserveOnly after the target is available. The retry uses the same operation and does not reserve a second database.
No daily logical backup means there is no daily dump. Host snapshots may still contain the preview; they do not expire with the preview lease. DBHost keeps the three newest host snapshots, so this is not an age limit for a preview’s data. See Backups and retention. Both backup choices require a verified deletion backup and preserve a seven-day recovery window when the preview is deleted.

Inspect and renew

GET /api/v1/previews/{databaseId} returns the database and namespace IDs, lease status and generation, expiry, backup choice and, after deletion, the recovery deadline. The response contains no credentials. POST /api/v1/previews/{databaseId}/extend accepts { "ttlHours": 24 }. The value may be up to 72 hours per renewal. An expired or deleting lease cannot be renewed. To switch between none and daily, use PATCH /api/v1/previews/{databaseId}/backup-policy with { "scheduledBackup": "daily" }.

Delete and recover

DELETE /api/v1/previews/{databaseId} takes no body. Deletion must finish with its own verified backup before the seven-day recovery window begins. Unknown agent outcomes remain held rather than creating a second deletion. The CI key cannot recover a deleted preview. An owner with a full-account key uses POST /api/v1/databases/{databaseId}/recover within seven days. A successful recovery starts a new 24-hour lease; later renewals can again be up to 72 hours. After seven days, the preview and its deletion backup are deleted permanently and automatically.