---
title: "List earlier versions of a page you own, newest first."
method: GET
path: "/sites/{idOrSlug}/versions"
tags: ["Sites"]
---

# List earlier versions of a page you own, newest first.

`GET /sites/{idOrSlug}/versions`

## Request

- Base URL: `https://api.stacktr.ee`
- URL: `https://api.stacktr.ee/sites/{idOrSlug}/versions`
- Auth: one of:
  - HTTP bearer
  - OAuth 2 (authorization code, authorization URL `https://api.stacktr.ee/oauth/authorize`, token URL `https://api.stacktr.ee/oauth/token`, scopes: `sites:read`)

Every update replaces a page in place, and the content it replaced is kept here: one snapshot per update, taken the moment before the new bytes landed. Use this, then POST /sites/{idOrSlug}/versions/{versionId}/restore, to undo a bad update instead of republishing. Owner-authed. `source` says how the update that produced each snapshot arrived: dashboard, api, agent, wallet, claim, beautify, or restore. SINGLE-FILE ONLY: on a page with more than one file only index.html is snapshotted and `partial` is true, so restoring one puts index.html back and leaves the page's other files at their current state; end-to-end encrypted pages are not snapshotted at all, because their index.html is a static bootstrap. Retention is per plan: the last 5 versions on free, 50 on paid, oldest pruned after each update. An empty list is not an error, and means one of three things: the page has never been updated, every version has aged past the cap, or the deployment predates the feature.

## Response `200`

The page's versions, newest first.

- object
  - `versions` object[], required
    - `id` string, required: Pass this as versionId to the restore route.
    - `created_at` integer, required: Unix epoch seconds. When the update that replaced this content happened.
    - `size_bytes` integer: Size of the snapshotted index.html, not of the whole page.
    - `source` 'dashboard' | 'api' | 'agent' | 'wallet' | 'claim' | 'beautify' | 'restore' | 'merge', required: How the update that produced this snapshot arrived. `merge`: another copy of this page, folded in by POST /sites/{idOrSlug}/merge (its `note` names the link it came from).
    - `partial` 0 | 1: 1 when the page had other files and only index.html was kept.
    - `note` string, nullable

## Other responses

- `401`: Missing or invalid credentials.
- `404`: Resource not found.

---

[API](https://skmtc.dev/stacktr/apis/stacktree-api.md) · [All operations](https://skmtc.dev/stacktr/apis/stacktree-api/llms.txt) · [OpenAPI document](https://skmtc.dev/stacktr/apis/stacktree-api/revisions/5878cce46977?raw)
