pages.createVersion
Puck Pages is experimental and may change in a future release.
Create a new version of a page.
await puck.pages.createVersion("page_123", { data });
// { id: "page_123", path: "/about", data: { root: { props: {} }, content: [] }, version: 4, publishedVersion: 2, status: "draft", createdAt: "2026-10-30T12:00:00.000Z", createdBy: "user_123" }Returns the Page at its new version.
Args
| Param | Example | Type | Status |
|---|---|---|---|
id | "page_123" | String | Required |
params | { data: {} } | Object | Required |
options | { auth: {} } | Object | - |
id
The page’s id.
params
The page’s new version.
| Param | Example | Type | Status |
|---|---|---|---|
data | data: { root: {}, content: [] } | Data | Required |
previousVersion | previousVersion: 2 | Number | - |
data
The data for the new version.
previousVersion
The version you based the data on. Puck Cloud refuses the save if a newer version exists.
const page = await puck.pages.createVersion("page_123", {
data,
previousVersion: 2,
});options
Set the request options for this call.