Restore branch to a historical state

Restores a branch to an earlier state in its own or another branch's history
by specifying an LSN or timestamp.
Creates a new branch from the historical state.

Path Params
string
required
^[a-z0-9-]{1,60}$

The Neon project ID

string
required
^[a-z0-9-]{1,60}$

The branch ID

Body Params
string
required
^[a-z0-9-]{1,60}$

The branch_id of the restore source branch.
If source_timestamp and source_lsn are omitted, the branch will be restored to head.
If source_branch_id is equal to the branch's id, source_timestamp or source_lsn is required.

string

A Postgres LSN (for example, 0/1A2B3C4) on the source branch to restore from.
Mutually exclusive with source_timestamp. Omit both to restore to head.

date-time

A point in time on the source branch to restore from, in RFC 3339 format. When omitted alongside source_lsn, the branch is restored to the latest available state of the source branch.

string

Name under which to save the current branch state before restoring. Required when the branch has children or when source_branch_id equals the branch being restored; in those cases all existing child branches are moved to the newly created branch. If omitted and not required, the previous state is not preserved.

Responses

Language
Credentials
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json