Sites

Put an earlier version of a page back at the same URL.

Swaps the chosen snapshot back into the live page. Same id, same link, same read history, so nothing needs re-sending. The CURRENT content is snapshotted FIRST, as a new version with source restore, so this is itself undoable and the new version id comes back as new_version. Script hashes and the page title and description are recomputed from the restored HTML, exactly as a normal update does. SINGLE-FILE ONLY: on a multi-file page this puts index.html back and leaves the other files unchanged, and the response carries partial: true saying so. Owner-authed, and only for a page that is currently serving: a retired page answers 409 site_deleted and has to be restored with POST /sites/{idOrSlug}/restore first.

post/sites/{idOrSlug}/versions/{versionId}/restore

Request

  • Base URL: https://api.stacktr.ee
  • URL: https://api.stacktr.ee/sites/{idOrSlug}/versions/{versionId}/restore
  • 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:write)

Response

Restored; the link now serves that version.

okboolean required
restoredstring required

The versionId that is now live.

new_versionstring nullable

The version id holding what was live a moment ago, so this restore can be undone. Null when the snapshot could not be written; the restore still happened.

size_bytesinteger
partialboolean

Present and true only on a multi-file page: index.html was put back, the other files are unchanged.

messagestring

Changes

No recorded changes to this operation across all 1 revision of this API.