Restore a kept version
const url = 'https://example.com/api/datasets/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/previous-versions/1/restore';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/datasets/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/previous-versions/1/restore \ --header 'Authorization: Bearer <token>'Publish one of the dataset’s kept previous versions as its live data again.
The dataset detail lists the kept versions in previous_versions. The
restore runs as a job and a refresh run with origin kind restore, and
publishes a new version that names the restored one in
restored_from_version. The data it replaces, including any feature
edits made since, becomes a kept version in turn. Scheduled refreshes of
the dataset are held afterwards.
Refuses with 422 restore_not_applicable for a dataset without a
feature table, 404 no_previous_version when the dataset does not keep
version_number, and 409 dataset_busy while another refresh,
replacement or restore is active.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Responses
Section titled “ Responses ”Successful Response
object
Example generated
{ "job_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "run_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}Bad request — invalid payload
Unauthorized — missing or invalid credentials
Forbidden — caller lacks write access
Not found
Conflict — resource state prevents the operation
Validation error
Too many requests — retry after the advertised interval
Headers
Section titled “ Headers ”Seconds until the request may be retried
Internal server error
Service unavailable — the database could not serve the request