> ## 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

# Manage variants and page overrides

> Runs one hierarchy operation, selected by `op`. A variant is a child project that inherits pages (and optionally the theme) from its parent; customizing a page gives the variant its own override. All operations take effect immediately.

Operations:

- `create-variant`: creates a variant of this project named `name` (1-100 characters), with optional `variantDescription` (max 500) and `inheritTheme` (default `true`). `contentStrategy` is `empty` (default; the variant inherits every page) or `clone-all` (copies every page into the variant). Returns `201` with the new project and `clonedPagesCount`.
- `link-parent`: makes this project a variant of `parentProjectId` (same shop), with optional `variantDescription` and `inheritTheme`. Hierarchies are at most two levels deep.
- `detach-parent` (`confirm` equal to the `projectId`): turns this variant into an independent project, copying inherited content first. Returns `pagesCopied`.
- `customize-page`: copies a page inherited from the parent into this variant as an override. `pageAssignmentId` is the parent's assignment id.
- `revert-page` (`content:delete`, `confirm` equal to `pageAssignmentId`): deletes this variant's override so the page inherits from the parent again. Only allowed when the parent would actually serve a live page for the override's exact market or locale; otherwise it returns `409 CONFLICT` and the override is kept.

A refused transition (maximum depth, project name already taken, circular link, not a variant, page already customized) returns `409 CONFLICT` and changes nothing. A wrong `confirm` value returns `400 INVALID_PARAMS`.

Required scope: `project:manage` (all operations); `revert-page` also needs `content:delete`



## OpenAPI

````yaml https://studio.weaverse.io/api/v1/content/openapi.json post /projects/{projectId}/hierarchy
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:
  /projects/{projectId}/hierarchy:
    summary: Variants, parent link/detach, override customize/revert
    description: >-
      project:manage. GET returns the hierarchy; ?analyzeParent=<id> adds the
      duplicate report. POST op=create-variant/link-parent/customize-page are
      project:manage; op=detach-parent confirms the projectId; op=revert-page is
      destructive (content:delete) and confirms the assignment id.
    parameters:
      - name: projectId
        in: path
        required: true
        schema:
          type: string
      - name: analyzeParent
        in: query
        schema:
          type: string
    post:
      tags:
        - Project structure
      summary: Manage variants and page overrides
      description: >-
        Runs one hierarchy operation, selected by `op`. A variant is a child
        project that inherits pages (and optionally the theme) from its parent;
        customizing a page gives the variant its own override. All operations
        take effect immediately.


        Operations:


        - `create-variant`: creates a variant of this project named `name`
        (1-100 characters), with optional `variantDescription` (max 500) and
        `inheritTheme` (default `true`). `contentStrategy` is `empty` (default;
        the variant inherits every page) or `clone-all` (copies every page into
        the variant). Returns `201` with the new project and `clonedPagesCount`.

        - `link-parent`: makes this project a variant of `parentProjectId` (same
        shop), with optional `variantDescription` and `inheritTheme`.
        Hierarchies are at most two levels deep.

        - `detach-parent` (`confirm` equal to the `projectId`): turns this
        variant into an independent project, copying inherited content first.
        Returns `pagesCopied`.

        - `customize-page`: copies a page inherited from the parent into this
        variant as an override. `pageAssignmentId` is the parent's assignment
        id.

        - `revert-page` (`content:delete`, `confirm` equal to
        `pageAssignmentId`): deletes this variant's override so the page
        inherits from the parent again. Only allowed when the parent would
        actually serve a live page for the override's exact market or locale;
        otherwise it returns `409 CONFLICT` and the override is kept.


        A refused transition (maximum depth, project name already taken,
        circular link, not a variant, page already customized) returns `409
        CONFLICT` and changes nothing. A wrong `confirm` value returns `400
        INVALID_PARAMS`.


        Required scope: `project:manage` (all operations); `revert-page` also
        needs `content:delete`
      operationId: hierarchyOperation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HierarchyOperation'
            example:
              op: create-variant
              name: Staging
            examples:
              create-variant:
                summary: Create a staging variant
                value:
                  op: create-variant
                  name: Staging
                  variantDescription: Pre-release checks
                  inheritTheme: true
                  contentStrategy: empty
              customize-page:
                summary: Override an inherited page
                value:
                  op: customize-page
                  pageAssignmentId: clz8r5t6u0007pa01home0003
              revert-page:
                summary: Revert an override to inheritance
                value:
                  op: revert-page
                  pageAssignmentId: clz8r5t6u0010pa02home0001
                  confirm: clz8r5t6u0010pa02home0001
      responses:
        '200':
          description: Operation result
          content:
            application/json:
              schema:
                type: object
              example:
                object: page_override_reverted
                success: true
                deletedAssignmentId: clz8r5t6u0010pa02home0001
                restoredInheritance: true
                parentPageId: clz8q1m2n0002pg01home0001
        '201':
          description: Variant created
          content:
            application/json:
              schema:
                type: object
              example:
                object: variant_created
                variant:
                  project:
                    id: clz8p2k0q0009ab12cd34stg01
                    weaverseShopId: clz7s0h1p0000shop0000001
                    name: Staging
                    publishedTimestamp: null
                    createdAt: '2026-10-15T11:40:02.000Z'
                    updatedAt: '2026-10-15T11:40:02.000Z'
                    deletedAt: null
                    inheritTheme: true
                    marketFirstEnabled: true
                    parentProjectId: clz8p2k0q0001ab12cd34ef56
                    variantDescription: Pre-release checks
                  clonedPagesCount: 0
        '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: >-
            CONFLICT: invalid hierarchy transition (maximum depth, project name
            already exists, circular link, not a variant, page already
            customized, or no inherited page to revert to); nothing was changed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                object: error
                code: CONFLICT
                message: >-
                  No live inherited page would replace this override for its
                  market/locale; nothing was deleted
                status: 409
components:
  schemas:
    HierarchyOperation:
      type: object
      required:
        - op
      oneOf:
        - type: object
          required:
            - op
            - name
          properties:
            op:
              const: create-variant
            name:
              type: string
            variantDescription:
              type: string
            inheritTheme:
              type: boolean
            contentStrategy:
              type: string
              enum:
                - empty
                - clone-all
        - type: object
          required:
            - op
            - parentProjectId
          properties:
            op:
              const: link-parent
            parentProjectId:
              type: string
            variantDescription:
              type: string
            inheritTheme:
              type: boolean
        - type: object
          required:
            - op
            - confirm
          properties:
            op:
              const: detach-parent
            confirm:
              type: string
        - type: object
          required:
            - op
            - pageAssignmentId
          properties:
            op:
              const: customize-page
            pageAssignmentId:
              type: string
        - type: object
          required:
            - op
            - pageAssignmentId
            - confirm
          properties:
            op:
              const: revert-page
            pageAssignmentId:
              type: string
            confirm:
              type: string
              description: Must equal the pageAssignmentId
          description: >-
            Delete a variant override only when the real storefront resolver
            would serve a live, same-shop inherited page for the override's
            exact market/locale; otherwise 409 CONFLICT and the override is
            kept.
    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.