---
title: "Restore an owned deck to a previous version"
method: POST
path: "/api/decks/{id}/restore"
tags: ["Publish"]
---

# Restore an owned deck to a previous version

`POST /api/decks/{id}/restore`

## Request

- Base URL: `https://slidesfly.com`
- URL: `https://slidesfly.com/api/decks/{id}/restore`
- Auth: HTTP bearer

Copies R2 objects from the source version prefix into a new MAX+1 version
(serving always uses the highest version integer). Works for single-file and
multi-file decks. No-ops if the target is already current. Rejects quarantined
and content-purged decks.

## Path parameters

- `id` string, required

## Headers

- `Idempotency-Key` string

## Request body

- object
  - `version` integer, required: Source version to restore

## Response `200`

Restored (or already current)

- RestoreOwnedSuccess
  - `ok` unknown, required
  - `data` object, required
    - `deck_id` string, required
    - `version_id` string, required
    - `version` integer, required: New live version (or unchanged if already current)
    - `restored_from` integer, required
    - `size_bytes` integer, required
    - `sha256` string, required
    - `title` string, required

## Other responses

- `401`: Missing or invalid credentials
- `403`: Not allowed
- `404`: Deck not found
- `409`: Idempotency-Key reused with a different body (or still in flight)
- `410`: Content purged after expiry

---

[API](https://skmtc.dev/slidesfly/apis/slidesfly-http-api.md) · [All operations](https://skmtc.dev/slidesfly/apis/slidesfly-http-api/llms.txt) · [OpenAPI document](https://skmtc.dev/slidesfly/apis/slidesfly-http-api/revisions/9da38f802ead?raw)
