---
title: "restore a version"
method: POST
path: "/api/workspaces/{workspaceName}/restore"
tags: ["workspace"]
---

# restore a version

`POST /api/workspaces/{workspaceName}/restore`

## Request

- The document declares no server URL.
- Auth: none declared

Puts the workspace back the way the given version left it. Leaving the scope out restores the whole workspace by stepping through the history, which writes nothing and leaves the changes stepped over to be redone. A scope holding the restore to certain graphs is recorded as a new change instead, which discards whatever could still be redone. With expectedCurrentChangeId, only if the workspace still stands on that change, and with expectedNewestChangeId, only if that is still the newest recorded change, undone or not; otherwise nothing is restored and 409 is returned. A restore that cannot be carried out, such as one held to a schema that did not exist yet at that version, is refused with 422.

## Path parameters

- `workspaceName` string, required

## Headers

- `Origin` string

## Request body

- RestoreVersionDTO
  - `expectedCurrentChangeId` string
  - `expectedNewestChangeId` string
  - `schemaNames` string[]
  - `versionId` string

## Response `200`

OK

- HistoryStepDTO
  - `canRedo` boolean
  - `canUndo` boolean
  - `change` ChangeLogEntryDTO
    - `affectedKinds` string[]
    - `affectedSchemaNames` string[]
    - `changeId` string
    - `contextDeltas` ContextDeltaDTO[]
      - `additions` TripleDTO[]
        - `object` string
        - `predicate` string
        - `subject` string
      - `contextName` string
      - `deletions` TripleDTO[]
        - `object` string
        - `predicate` string
        - `subject` string
      - `schemaName` string
      - `values` ValueChangeDTO[]
        - `after` string
        - `before` string
        - `key` string
    - `message` string
    - `removedOnUndo` string[]
    - `restorableSchemaNames` string[]
    - `restoreTargetSchemaNames` string[]
    - `timestamp` string
    - `undone` boolean

## Other responses

- `409`: The workspace has moved in its history since.
- `422`: The restore cannot be carried out as asked.

## Changes

- **2026-11-23** `91d142ef001a`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/soptim/apis/rdfarchitect-backend/changes/api/workspaces/:workspaceName/restore/post.md)

---

[API](https://skmtc.dev/soptim/apis/rdfarchitect-backend.md) - [All operations](https://skmtc.dev/soptim/apis/rdfarchitect-backend/llms.txt) - [OpenAPI document](https://skmtc.dev/soptim/apis/rdfarchitect-backend/revisions/21e6477d8dd8?raw)
