Sites

Restore a site's database to a point in time

Changed on

Rewinds the site's database to a restore point or an ISO 8601 timestamp — the undo for data you didn't mean to lose. One of the two is required. Restore points come from db/migrations, where every applied change carries the restore_to it began from; nothing has to capture one in advance.

The restore overwrites current state, but earlier points are retained, so an overshoot can itself be undone via previous_bookmark. Points are kept for 30 days.

This is not how a schema change is removed. A restore rewinds this database's shape too, but the development database still has the newer one — so the next deploy compares them and puts it back. To drop a table for good, remove it from the development database and deploy.

post/sites/{id}/db/restore

Request

  • Base URL
    https://api.crevio.co/v1
  • Auth
    API key in header Authorization

Path parameters

id, string required

The resource's ID, as returned in its id field

Headers

Idempotency-Key, string

Makes this write safe to retry: a repeat with the same key replays the first response instead of creating a second resource. Scoped to the account, remembered for 24 hours; reusing a key with a different payload is an error.

Request body

object required
bookmark, string

A restore point, as returned by db/migrations (restore_to) or by a migration's own response.

timestamp, string

An ISO 8601 timestamp to rewind to (nearest point at or before).

environment, 'development' | 'production'

Which database to use. A site normally has exactly one, production, and that is the default — the live database the site reads. development is only valid if a separate development database has been provisioned for this site; asking for one that doesn't exist is an error rather than a silent fall back to production. The response echoes the environment that was used.

Response

Restore result

object required
object, string
bookmark, string
previous_bookmark, string
message, string

Changes

    • warning

      added the new idempotency_error enum value to the error/type response property for the response status

    • warning

      added the new idempotency_error enum value to the error/type response property for the response status

    • warning

      added the new idempotency_error enum value to the error/type response property for the response status

    2 more changes in this revision