---
title: "Rollback page to previous version"
method: POST
path: "/papi/project/{projectId}/pages/{pageSlug}/rollback"
tags: ["Pages"]
---

# Rollback page to previous version

`POST /papi/project/{projectId}/pages/{pageSlug}/rollback`

## Request

- Base URL: `https://api.websitepublisher.ai`
- URL: `https://api.websitepublisher.ai/papi/project/{projectId}/pages/{pageSlug}/rollback`
- Auth: OAuth 2 (authorization code, authorization URL `https://api.websitepublisher.ai/dapi/oauth/authorize`, token URL `https://api.websitepublisher.ai/dapi/oauth/token`, scopes: `read`, `write`)

Creates a new version with the content from a previous version (forward-only, audit trail preserved). Specify target_version (number) or target_version_hash. Use getPageVersions to find available versions.

## Path parameters

- `projectId` integer, required
- `pageSlug` string, required

## Request body

- PageRollback
  - `target_version` integer: Version number to rollback to (use this OR target_version_hash)
  - `target_version_hash` string: Version hash to rollback to (use this OR target_version)

## Response `200`

Rollback successful. Returns new version number and hash.

## Other responses

- `404`: Target version not found.
- `422`: Cannot rollback — page has no version history or target is current version.

---

[API](https://skmtc.dev/websitepublisher/apis/websitepublisher-ai-api.md) · [All operations](https://skmtc.dev/websitepublisher/apis/websitepublisher-ai-api/llms.txt) · [OpenAPI document](https://skmtc.dev/websitepublisher/apis/websitepublisher-ai-api/revisions/e9df1ef10551?raw)
