> ## Documentation Index
> Fetch the complete documentation index at: https://weaverse.io/docs/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> Weaverse component configuration uses `settings`. `inspector` is deprecated; never generate it.
> Weaverse Hydrogen themes use React Router v7: import from `react-router`, never `react-router-dom` or `@remix-run/*`.
> Define component schemas with `createSchema()` from `@weaverse/hydrogen` (React Router themes) or `@weaverse/next` (Next.js themes).
> These docs cover @weaverse/hydrogen, @weaverse/react and @weaverse/core 5.x, and @weaverse/next 1.x. Do not use APIs from other major versions.
> For live project data (pages, theme settings, translations), use the Weaverse MCP server: https://docs.weaverse.io/developer-tools/weaverse-mcp

# Publish a saved page draft

> Makes one saved page draft live now. `versionId` is the `versionId` returned by `PUT /projects/{projectId}/page-drafts/{pageId}`. It uses the same promotion and cache fan-out as a Studio publish. Publishing is always explicit: `content:write` never implies it.

**Preconditions**

- The version must be a draft of `pageId` in `projectId`, and it must still be the page's current draft head. Otherwise the response is 404 `PAGE_NOT_FOUND`.
- The live page and project must still be at the revisions the draft was built on. If live moved, the response is 409 `STALE_PAGE`, nothing is published and the draft head stays in place. Re-read the draft, save it again and publish the new version.

**Replacing a schedule.** Set `replaceScheduledVersionId` to publish now in place of the page's scheduled version. The scheduled version is closed in the same transaction (a scheduled draft returns to `ACTIVE`, a scheduled history version becomes `CANCELLED`), so the page is never left with neither a schedule nor a publication. If that id is no longer the page's single scheduled version (it fired, was cancelled or was replaced), the response is 409 `CONFLICT` and nothing is published. A version cannot replace itself (400).

**Response.** The published version row (`status: "PUBLISHED"`), plus the new live `pageUpdatedAt` and, when the project revision advanced, `projectUpdatedAt`. If the content committed but cache invalidation failed, the response includes `cacheDelivery: "degraded"`; the content is live and edge delivery is retried automatically, so do not publish again.

Required scope: `content:publish`



## OpenAPI

````yaml https://studio.weaverse.io/api/v1/content/openapi.json post /publish-versions/{versionId}
openapi: 3.1.0
info:
  title: Weaverse Content API
  version: 1.0.0
  description: >-
    Authenticated REST API for querying Weaverse-managed content (projects,
    pages, theme settings, languages) and for reading and writing per-locale
    translations.
servers:
  - url: https://studio.weaverse.io/api/v1/content
    description: Production
security:
  - bearerAuth: []
tags:
  - name: Projects
    description: List, read, rename, create, copy and delete projects.
  - name: Pages
    description: List, read, create, update and delete the pages of a project.
  - name: Drafts and publishing
    description: >-
      Edit page drafts, then publish, schedule, restore and manage page
      versions.
  - name: Global sections
    description: Read, edit and publish sections shared across pages.
  - name: Page settings
    description: Read and edit page-level settings such as SEO metadata.
  - name: Assignments
    description: Map Shopify resources and routes to Weaverse pages and templates.
  - name: Theme settings
    description: Read and update a project's theme settings.
  - name: Languages and localization
    description: List project languages and manage locales, static text and glossary.
  - name: Translations
    description: >-
      Read and write per-locale translations, built for external translation
      agents.
  - name: Project structure
    description: Manage project variants and the project hierarchy.
  - name: Backups and portability
    description: Back up, restore, export and import project content.
  - name: Previews and hostnames
    description: Create preview links and manage the hostnames a project accepts.
  - name: Specification
    description: This OpenAPI document.
paths:
  /publish-versions/{versionId}:
    summary: Publish one saved page draft (content:publish)
    description: >-
      Makes the draft live through the same promotion and cache fan-out the
      Studio publish uses. Publishing is explicit: content:write never implies
      it. A failed invalidation after a committed publish reports
      cacheDelivery="degraded".
    parameters:
      - name: versionId
        in: path
        required: true
        schema:
          type: string
    post:
      tags:
        - Drafts and publishing
      summary: Publish a saved page draft
      description: >-
        Makes one saved page draft live now. `versionId` is the `versionId`
        returned by `PUT /projects/{projectId}/page-drafts/{pageId}`. It uses
        the same promotion and cache fan-out as a Studio publish. Publishing is
        always explicit: `content:write` never implies it.


        **Preconditions**


        - The version must be a draft of `pageId` in `projectId`, and it must
        still be the page's current draft head. Otherwise the response is 404
        `PAGE_NOT_FOUND`.

        - The live page and project must still be at the revisions the draft was
        built on. If live moved, the response is 409 `STALE_PAGE`, nothing is
        published and the draft head stays in place. Re-read the draft, save it
        again and publish the new version.


        **Replacing a schedule.** Set `replaceScheduledVersionId` to publish now
        in place of the page's scheduled version. The scheduled version is
        closed in the same transaction (a scheduled draft returns to `ACTIVE`, a
        scheduled history version becomes `CANCELLED`), so the page is never
        left with neither a schedule nor a publication. If that id is no longer
        the page's single scheduled version (it fired, was cancelled or was
        replaced), the response is 409 `CONFLICT` and nothing is published. A
        version cannot replace itself (400).


        **Response.** The published version row (`status: "PUBLISHED"`), plus
        the new live `pageUpdatedAt` and, when the project revision advanced,
        `projectUpdatedAt`. If the content committed but cache invalidation
        failed, the response includes `cacheDelivery: "degraded"`; the content
        is live and edge delivery is retried automatically, so do not publish
        again.


        Required scope: `content:publish`
      operationId: publishPageDraft
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PublishDraftBody'
            example:
              projectId: clz7prj0a1b2c3d4e5f6g7h8
              pageId: clz7pg9k2m4n6p8r0t2v4x6z
      responses:
        '200':
          description: Published receipt
          content:
            application/json:
              schema:
                type: object
              example:
                object: page_version_published
                id: clz9drf2h4j6l8n0p2r4t6v8
                pageId: clz7pg9k2m4n6p8r0t2v4x6z
                projectId: clz7prj0a1b2c3d4e5f6g7h8
                userId: null
                snapshot:
                  pageData:
                    id: clz7pg9k2m4n6p8r0t2v4x6z
                    name: Home
                    rootId: root-1
                    items:
                      - id: root-1
                        type: main
                        children:
                          - id: hero-1
                        data: {}
                      - id: hero-1
                        type: hero-image
                        data:
                          heading: Summer collection
                          height: large
                    expectedUpdatedAt: '2026-10-08T10:00:00.000Z'
                  pageAssignment:
                    type: INDEX
                    handle: ''
                    locale: ''
                kind: DRAFT
                draftBasePageUpdatedAt: '2026-10-08T10:00:00.000Z'
                draftBaseProjectUpdatedAt: '2026-10-08T09:00:00.000Z'
                publishedPageUpdatedAt: null
                publishedProjectUpdatedAt: null
                assignedType: INDEX
                assignedHandle: ''
                assignedLocale: ''
                assignedMarket: null
                assignmentDeferred: false
                scheduleRevision: 0
                createdAt: '2026-10-08T10:12:00.000Z'
                publishAt: '2026-10-08T10:20:00.000Z'
                publishedAt: '2026-10-08T10:20:00.000Z'
                status: PUBLISHED
                pageUpdatedAt: '2026-10-08T10:20:00.000Z'
        '401':
          description: Missing or invalid credentials
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Foreign project or missing scope (INSUFFICIENT_SCOPE)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Not found (never discloses other tenants)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: >-
            STALE_PAGE — head or live base moved; CONFLICT:
            replaceScheduledVersionId no longer names the page's scheduled
            version; nothing was published
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                object: error
                code: STALE_PAGE
                message: >-
                  The draft head or its live base moved; re-read and publish
                  again
                status: 409
components:
  schemas:
    PublishDraftBody:
      type: object
      required:
        - projectId
        - pageId
      properties:
        projectId:
          type: string
        pageId:
          type: string
        replaceScheduledVersionId:
          type: string
          description: A scheduled version this publication replaces
    Error:
      type: object
      required:
        - object
        - code
        - message
        - status
      properties:
        object:
          type: string
          enum:
            - error
        code:
          type: string
          enum:
            - UNAUTHORIZED
            - FORBIDDEN
            - INSUFFICIENT_SCOPE
            - PROJECT_NOT_FOUND
            - PAGE_NOT_FOUND
            - STALE_PAGE
            - STALE_PROJECT
            - STALE_TRANSLATION
            - TRANSLATION_UNIT_NOT_FOUND
            - SERVICE_UNAVAILABLE
            - CONFLICT
            - PRECONDITION_REQUIRED
            - INVALID_PARAMS
            - INTERNAL_ERROR
        message:
          type: string
        status:
          type: integer
        details:
          description: >-
            Optional machine-readable context, for example the clashing handles
            of a 409 CONFLICT.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: WEAVERSE_API_KEY
      description: >-
        Bearer authentication: a shop API key (WEAVERSE_API_KEY), a scoped API
        key, a delegated MCP OAuth token, or (translation-unit routes only) a
        project-bound translation agent token. Scopes: content:read — Read
        projects, pages, theme settings, versions, drafts and translation units.
        content:write — Save drafts and make non-destructive edits (page items,
        metadata, SEO, assignments, languages, glossary). Never publishes or
        deletes. content:publish — Publish drafts, schedule/reschedule/cancel
        publications, restore versions, publish global sections. content:delete
        — Delete pages, global sections, languages, static keys, override
        reverts; required with project:manage for project deletion.
        project:manage — Create/copy/delete projects, settings, variants,
        hierarchy, backups, restore-as-new, previews, hostname policy.
        translations:read — Read translation units only (no general content
        access). translations:write — Apply translation units only; never
        mutates page content. A legacy unscoped API key keeps
        read/write/translation baseline access and every pre-scope endpoint, but
        never gains publish/delete/project-manage implicitly.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.