---
title: "Replace a version's pending content"
method: PUT
path: "/versions/{versionId}"
tags: ["Drafts and publishing"]
---

# Replace a version's pending content

`PUT /versions/{versionId}`

## Request

- Base URL: `https://studio.weaverse.io/api/v1/content`
- URL: `https://studio.weaverse.io/api/v1/content/versions/{versionId}`
- Auth: HTTP bearer

Replaces the stored content of a version, typically one that is scheduled, so the new content goes live when the schedule fires. The schedule time stays the same. Send `projectId` and `type` in the body, not the query. `type` chooses the shape:

- `type: "page"`: a full page `snapshot` (`pageData` with `name`, `rootId`, `items`, and `pageAssignment`). `snapshot.pageData` is the page itself, not a `{ page }` wrapper. The write is fenced on `snapshot.pageData.expectedUpdatedAt`: if the version's page changed since then, the response is 409 `STALE_PAGE` and the stored snapshot stays the same.
- `type: "theme"`: a full theme `snapshot` (`theme`, `recentColors`, `previewHost`, `defaultLocale`), fenced on `expectedProjectUpdatedAt`. If the project revision moved, the response is 409 `STALE_PROJECT`.
- `type: "deferred-page"`: for a catch-all page version that has no live assignment yet. Send the page save payload as `pageData` (`page` and `pageAssignment`; `page.id` and `page.expectedUpdatedAt` are required), optional `translations` and `staticTextChanges`, the version's current `scheduleRevision` as `expectedScheduleRevision`, and `expectedProjectUpdatedAt`. The response is `version_recaptured`, and its `versionId` may name a new successor version; use that id from then on.

**Refusals (409 `CONFLICT`).** Draft versions cannot be changed; save a new draft through `PUT /projects/{projectId}/page-drafts/{pageId}` instead. Sending `page` for a deferred version, or `deferred-page` for a normal one, is also refused. An invalid snapshot is 400.

Required scope: `content:publish`

## Request body

- union
  - object
    - `type` 'theme', required
    - `projectId` string, required
    - `snapshot` object, required
    - `expectedProjectUpdatedAt` string, date-time, required
  - object
    - `type` 'page', required
    - `projectId` string, required
    - `snapshot` object, required
  - object
    - `type` 'deferred-page', required
    - `projectId` string, required
    - `expectedScheduleRevision` integer, required
    - `pageData` object, required
    - `translations` object[]
    - `staticTextChanges` object
    - `expectedProjectUpdatedAt` string, date-time, required

## Response `200`

Updated version

- object

## Other responses

- `400`: Invalid snapshot or body
- `401`: Missing or invalid credentials
- `403`: Foreign project or missing scope (INSUFFICIENT_SCOPE)
- `404`: Not found (never discloses other tenants)
- `409`: STALE_PAGE / STALE_PROJECT / CONFLICT (draft or wrong type)

---

[API](https://skmtc.dev/weaverse/apis/weaverse-content-api.md) - [All operations](https://skmtc.dev/weaverse/apis/weaverse-content-api/llms.txt) - [OpenAPI document](https://skmtc.dev/weaverse/apis/weaverse-content-api/revisions/d189794169bb?raw)
