---
title: "Restore a workbook to a previous version"
method: POST
path: "/v2/workbooks/{workbookId}/restoreVersion"
tags: ["Workbooks"]
---

# Restore a workbook to a previous version

`POST /v2/workbooks/{workbookId}/restoreVersion`

## Request

- Base URL: `https://api.sigmacomputing.com`
- URL: `https://api.sigmacomputing.com/v2/workbooks/{workbookId}/restoreVersion`
- Auth: HTTP bearer

Restore a workbook to a previous version. Restoring publishes a new version with the same contents as the version restored and does not delete or overwrite any versions created.

### Usage notes
- Retrieve the **workbookId** by calling the [/v2/workbooks](https://help.sigmacomputing.com/reference/list-workbooks) endpoint.
- Retrieve available **version** numbers by calling the [/v2/workbooks/{workbookId}/version-history](https://help.sigmacomputing.com/reference/get-version-history) endpoint.

## Path parameters

- `workbookId` string, required

## Request body

- object
  - `version` number, double, required: The document version to restore the workbook to.

## Response `200`

The response body.

- WorkbooksRestoreWorkbookVersionResponse200
  - `workbookId` string, required: Unique identifier of the workbook.
  - `workbookUrlId` string, required
  - `name` string, required
  - `url` string, required
  - `path` string, required
  - `latestVersion` number, double, required: The most recently published document version of the workbook.
  - `ownerId` string, required
  - `createdBy` string, required: The identifier of the user who created this object.
  - `updatedBy` string, required: The identifier of the user or process that last updated this object.
  - `createdAt` string, date-time, required: When the object was created.
  - `updatedAt` string, date-time, required: When the object was last updated.
  - `isArchived` boolean
  - `tags` V2WorkbooksWorkbookIdRestoreVersionPostResponsesContentApplicationJsonSchemaTagsItems[]
    - `versionTagId` string, required: Unique identifier of the tag.
    - `name` string, required
    - `sourceWorkbookVersion` number, double, required
    - `taggedWorkbookId` string, required: Unique identifier of the tagged workbook.
    - `workbookTaggedAt` string, date-time, required
    - `isArchived` boolean: Whether the tagged workbook copy is archived.
  - `description` string
  - `taggedSourceUrlId` string: For a workbook deployed to a tenant organization by a deployment policy with a version tag, the `urlId` of the original source workbook in the parent organization. Only present when `includeTaggedSourceUrlId=true` is included in the request.

---

[API](https://skmtc.dev/sigmacomputing/apis/sigma-rest-api.md) - [All operations](https://skmtc.dev/sigmacomputing/apis/sigma-rest-api/llms.txt) - [OpenAPI document](https://skmtc.dev/sigmacomputing/apis/sigma-rest-api/revisions/fb6036208c49?raw)
