Skip to content
getgeolens.com

Restore a kept version

POST
/datasets/{dataset_id}/previous-versions/{version_number}/restore
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.

dataset_id
required
Dataset Id
string format: uuid
version_number
required
Version Number
integer

Successful Response

Media type application/json
RestorePreviousVersionResponse
object
job_id
required
Job Id
string format: uuid
run_id
required
Run Id
string format: uuid

Example generated

{
"job_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"run_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
}

Bad request — invalid payload

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string

Example

{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Unauthorized — missing or invalid credentials

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string

Example

{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Forbidden — caller lacks write access

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string

Example

{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Not found

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string

Example

{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Conflict — resource state prevents the operation

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string

Example

{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Validation error

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string

Example

{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Too many requests — retry after the advertised interval

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string

Example

{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}
Retry-After
integer

Seconds until the request may be retried

Internal server error

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string

Example

{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}

Service unavailable — the database could not serve the request

Media type application/problem+json
ProblemDetail
object
type
Type
string
default: about:blank
title
required
Title
string
status
required
Status
integer
detail
required
Any of:
string

Example

{
"detail": "Dataset not found",
"status": 404,
"title": "Not Found",
"type": "about:blank"
}