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

# Run a project lifecycle operation

> Shop-scoped project lifecycle. The body's `op` field selects the operation:

- `create`: creates a project in the caller's shop. `name` is required (1-100 characters). Set `config.themeName` to seed it from a theme; omit it or pass `blank` for a blank project with generated storefront pages. If the theme seed fails, a blank project is created instead and the response carries a `warning`. Returns `201` with `object: "project_created"`.
- `copy`: clones `sourceProjectId` into the caller's shop. The source must be this shop's own project or a public demo-store project; any other shop's project returns `404`. The clone runs in the background: the response is `202` with `object: "project_copy_started"` and the `targetProjectId`. Observe completion by listing the target project's pages. `name` defaults to `Copy of <source name>`.
- `delete`: soft-deletes `projectId` (a backup is taken first) and purges its caches. `confirm` must equal the `projectId`, otherwise `400`. A project that still has variant (child) projects returns `409 CONFLICT` (`HAS_VARIANTS`). Returns `200` with `object: "project_deleted"`.
- `set-settings`: revision-fenced write of non-secret settings (`name`, `defaultLocale`). Pass the project's current `revision` (from `GET /projects/{projectId}`) as `expectedUpdatedAt`; if the project changed since, the request returns `409 STALE_PROJECT` and writes nothing. `defaultLocale` is the full Hydrogen i18n object Studio stores (`label`, `language`, `country`, `pathPrefix`). Returns `200` with `object: "project_settings_updated"` and the new `projectRevision`.
- `purge-cache`: the Studio "Clear cache" action. Invalidates the project's caches without touching content. Returns `200` with `object: "cache_purged"`.

Every operation other than `create` and `copy` must target a live project owned by the caller's shop; otherwise `404`.

Required scope: `project:manage` (`delete` also requires `content:delete`)



## OpenAPI

````yaml https://studio.weaverse.io/api/v1/content/openapi.json post /projects
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:
    post:
      tags:
        - Projects
      summary: Run a project lifecycle operation
      description: >-
        Shop-scoped project lifecycle. The body's `op` field selects the
        operation:


        - `create`: creates a project in the caller's shop. `name` is required
        (1-100 characters). Set `config.themeName` to seed it from a theme; omit
        it or pass `blank` for a blank project with generated storefront pages.
        If the theme seed fails, a blank project is created instead and the
        response carries a `warning`. Returns `201` with `object:
        "project_created"`.

        - `copy`: clones `sourceProjectId` into the caller's shop. The source
        must be this shop's own project or a public demo-store project; any
        other shop's project returns `404`. The clone runs in the background:
        the response is `202` with `object: "project_copy_started"` and the
        `targetProjectId`. Observe completion by listing the target project's
        pages. `name` defaults to `Copy of <source name>`.

        - `delete`: soft-deletes `projectId` (a backup is taken first) and
        purges its caches. `confirm` must equal the `projectId`, otherwise
        `400`. A project that still has variant (child) projects returns `409
        CONFLICT` (`HAS_VARIANTS`). Returns `200` with `object:
        "project_deleted"`.

        - `set-settings`: revision-fenced write of non-secret settings (`name`,
        `defaultLocale`). Pass the project's current `revision` (from `GET
        /projects/{projectId}`) as `expectedUpdatedAt`; if the project changed
        since, the request returns `409 STALE_PROJECT` and writes nothing.
        `defaultLocale` is the full Hydrogen i18n object Studio stores (`label`,
        `language`, `country`, `pathPrefix`). Returns `200` with `object:
        "project_settings_updated"` and the new `projectRevision`.

        - `purge-cache`: the Studio "Clear cache" action. Invalidates the
        project's caches without touching content. Returns `200` with `object:
        "cache_purged"`.


        Every operation other than `create` and `copy` must target a live
        project owned by the caller's shop; otherwise `404`.


        Required scope: `project:manage` (`delete` also requires
        `content:delete`)
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ProjectLifecycleOperation'
            example:
              op: create
              name: New storefront
              config:
                themeName: blank
            examples:
              create:
                summary: Create a project seeded from a theme
                value:
                  op: create
                  name: New storefront
                  config:
                    themeName: pilot
              copy:
                summary: Copy an existing project
                value:
                  op: copy
                  sourceProjectId: clz1k8m2n0000abcd1234efgh
                  name: Holiday storefront
              set-settings:
                summary: Rename a project and set its default locale
                value:
                  op: set-settings
                  projectId: clz1k8m2n0000abcd1234efgh
                  expectedUpdatedAt: '2026-10-12T09:41:27.000Z'
                  name: My Storefront (EU)
                  defaultLocale:
                    label: France (EUR €)
                    language: fr
                    country: FR
                    pathPrefix: /fr-fr
              delete:
                summary: Delete a project
                value:
                  op: delete
                  projectId: clz1k9p4q0001abcd5678ijkl
                  confirm: clz1k9p4q0001abcd5678ijkl
      responses:
        '200':
          description: Operation result
          content:
            application/json:
              schema:
                type: object
              example:
                object: project_settings_updated
                projectRevision: '2026-10-20T10:02:13.000Z'
        '201':
          description: Created (create/copy-restore targets)
          content:
            application/json:
              schema:
                type: object
              example:
                object: project_created
                id: clz3a1b2c0004efgh7890ijkl
                name: New storefront
        '202':
          description: Copy started; poll the target project
          content:
            application/json:
              schema:
                type: object
              example:
                object: project_copy_started
                targetProjectId: clz3a2c3d0005efgh1234mnop
        '400':
          description: Invalid body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '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_PROJECT or HAS_VARIANTS
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                object: error
                code: STALE_PROJECT
                message: >-
                  This project changed after it was loaded. Reload before
                  saving.
                status: 409
      security:
        - bearerAuth: []
components:
  schemas:
    ProjectLifecycleOperation:
      type: object
      required:
        - op
      oneOf:
        - type: object
          properties:
            op:
              const: create
            name:
              type: string
            projectId:
              type: string
              description: Optional client-chosen id
            config:
              type: object
              properties:
                themeName:
                  type: string
        - type: object
          required:
            - op
            - sourceProjectId
          properties:
            op:
              const: copy
            sourceProjectId:
              type: string
            name:
              type: string
          description: >-
            Copy a project into the caller shop. Source: this shop's own project
            or a public demo-store project (same policy as the dashboard); any
            other shop's project is 404. The clone runs in the background (202 +
            targetProjectId); completion is observed by listing the target's
            pages.
        - type: object
          required:
            - op
            - projectId
            - confirm
          properties:
            op:
              const: delete
            projectId:
              type: string
            confirm:
              type: string
              description: Must equal the projectId
        - type: object
          required:
            - op
            - projectId
            - expectedUpdatedAt
          properties:
            op:
              const: set-settings
            projectId:
              type: string
            expectedUpdatedAt:
              type: string
              format: date-time
            name:
              type: string
            defaultLocale:
              type: object
              additionalProperties: false
              required:
                - label
                - language
                - country
                - pathPrefix
              properties:
                label:
                  type: string
                language:
                  type: string
                country:
                  type: string
                pathPrefix:
                  type: string
              description: Full Hydrogen i18n default locale, the shape Studio stores.
        - type: object
          required:
            - op
            - projectId
          properties:
            op:
              const: purge-cache
            projectId:
              type: string
          description: >-
            The Studio "Clear cache" action: invalidate this project's caches.
            project:manage.
    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.