---
title: "Api Restore App Version"
method: POST
path: "/api/apps/{app_id}/versions/{sha}/restore"
tags: ["apps"]
---

# Api Restore App Version

`POST /api/apps/{app_id}/versions/{sha}/restore`

## Request

- Base URL: `https://app.getdot.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://app.getdot.ai/api/apps/{app_id}/versions/{sha}/restore`
- Auth: one of:
  - API key in header `X-API-KEY`
  - API key in cookie `Authorization`
  - OAuth 2 (password, token URL `/api/auth/token`)

Make an earlier version the live one — the counterpart of Publish.

The one write in version history. In the browser it is the "Restore this
version" button on a version being looked at (`/versions/{sha}/build` +
`/runtime/stream` show it first, touching nothing); from the CLI it is `dot
apps restore`. Editors only. Any edit draft stays exactly as it was.

Recorded like any other publish: the bundle is written, built and committed as
a new version, so the version this replaces stays in the history and the
restore itself can be restored. The build reuses the charts of the view the
person just looked at, so what goes live is what they saw.

## Path parameters

- `app_id` string, required
- `sha` string, required

## Response `200`

Successful Response

- object

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/getdot/apis/dot-api-2.md) · [All operations](https://skmtc.dev/getdot/apis/dot-api-2/llms.txt) · [OpenAPI document](https://skmtc.dev/getdot/apis/dot-api-2/revisions/d26fe7163a7f?raw)
