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

# Update page content

> Edits component items on the page resolved for `type` / `handle` / `locale`, using the same fallback as the GET endpoint. Pass the exact handle from the pages list; it may include `/`. Singleton types accept an empty handle; `CUSTOM` and per-resource types require one.

- `data` is shallow-merged into the item's existing data: send only changed top-level keys. Nested objects are replaced wholesale.
- Up to 100 items per request; item ids must be unique within the request.
- An unknown item id is created only when `type` is supplied; otherwise it is returned in `notFoundIds`.
- `children` replaces an item's top-level child references. Each reference must point to an existing page item or a typed new item created in the same request.
- A page inherited from a parent project returns `409`; edit it on the source project.
- `exact: true` writes only the assignment whose stored type, handle and locale match exactly, returning `404` instead of falling back. Delegated writes are always exact.

Concurrency: pass the `updatedAt` from your GET as `expectedUpdatedAt`. If the page changed since, the whole request is rejected with `409 STALE_PAGE` before any item is written; re-read and reapply on top of the newer content instead of retrying the same patch. Delegated (MCP OAuth) tokens must send it (`428 PRECONDITION_REQUIRED` otherwise); it is optional for API keys.

On success the edit goes live through api.weaverse.io like a Studio save. Clients or proxies that cannot send `PATCH` bodies may send `POST`.

Required scope: `content:write`



## OpenAPI

````yaml https://studio.weaverse.io/api/v1/content/openapi.json patch /projects/{projectId}/pages/{type}/{handle}
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}/pages/{type}/{handle}:
    patch:
      tags:
        - Pages
      summary: Update page content
      description: >-
        Edits component items on the page resolved for `type` / `handle` /
        `locale`, using the same fallback as the GET endpoint. Pass the exact
        handle from the pages list; it may include `/`. Singleton types accept
        an empty handle; `CUSTOM` and per-resource types require one.


        - `data` is shallow-merged into the item's existing data: send only
        changed top-level keys. Nested objects are replaced wholesale.

        - Up to 100 items per request; item ids must be unique within the
        request.

        - An unknown item id is created only when `type` is supplied; otherwise
        it is returned in `notFoundIds`.

        - `children` replaces an item's top-level child references. Each
        reference must point to an existing page item or a typed new item
        created in the same request.

        - A page inherited from a parent project returns `409`; edit it on the
        source project.

        - `exact: true` writes only the assignment whose stored type, handle and
        locale match exactly, returning `404` instead of falling back. Delegated
        writes are always exact.


        Concurrency: pass the `updatedAt` from your GET as `expectedUpdatedAt`.
        If the page changed since, the whole request is rejected with `409
        STALE_PAGE` before any item is written; re-read and reapply on top of
        the newer content instead of retrying the same patch. Delegated (MCP
        OAuth) tokens must send it (`428 PRECONDITION_REQUIRED` otherwise); it
        is optional for API keys.


        On success the edit goes live through api.weaverse.io like a Studio
        save. Clients or proxies that cannot send `PATCH` bodies may send
        `POST`.


        Required scope: `content:write`
      operationId: updatePage
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
        - name: type
          in: path
          required: true
          schema:
            type: string
          description: Page type (e.g. PRODUCT, INDEX, CUSTOM)
        - name: handle
          in: path
          required: true
          schema:
            type: string
          description: >-
            Page handle. Final greedy path component; may include `/`. Leave
            empty to target a singleton type's default page (e.g. the home page
            for `INDEX`, or the `/collections` index `COLLECTION_LIST`). A
            handle is required for `CUSTOM` pages and for per-resource templated
            types (`PRODUCT`, `COLLECTION`, `PAGE`, `BLOG`, `ARTICLE`).
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - items
              properties:
                locale:
                  type: string
                  description: >-
                    Optional. Same resolution as GET; defaults to the stored
                    default locale.
                expectedUpdatedAt:
                  type:
                    - string
                    - 'null'
                  format: date-time
                  description: >-
                    Optimistic-concurrency token: the `updatedAt` value from the
                    GET read this patch was based on. Required for delegated
                    (MCP OAuth) tokens — omitted → 428 PRECONDITION_REQUIRED;
                    optional for API keys. When the page changed since (e.g. a
                    concurrent studio save), the whole request is rejected with
                    409 STALE_PAGE before any item is written; once an earlier
                    item was written or may have been (its outcome unconfirmed),
                    a move reports that item and the remaining ones as `failed`
                    (not confirmed applied) with 200 instead. `null` matches a
                    page whose revision was never set. Re-read and reapply on
                    top of the newer content instead of retrying the same patch.
                items:
                  type: array
                  maxItems: 100
                  items:
                    type: object
                    required:
                      - id
                      - data
                    properties:
                      id:
                        type: string
                        description: >-
                          Item id. Existing ids are updated; unknown ids are
                          created only when `type` is supplied.
                      data:
                        type: object
                        additionalProperties: true
                        description: Top-level keys to merge into the item's existing data.
                      type:
                        type: string
                        description: >-
                          Component type. Required only when creating a new item
                          id. Ignored for existing item updates.
                      children:
                        type:
                          - array
                          - 'null'
                        description: >-
                          Optional top-level child references. Each entry must
                          include an `id` that already belongs to the page or is
                          created in the same request.
                        items:
                          type: object
                          required:
                            - id
                          properties:
                            id:
                              type: string
                          additionalProperties: true
                exact:
                  type: boolean
                  description: Refuse locale/handle fallback; 404 instead
            example:
              locale: en-us
              expectedUpdatedAt: '2026-10-18T14:22:05.000Z'
              items:
                - id: 019a3c2e-5b7d-7f10-8a2b-3c4d5e6f7a82
                  data:
                    title: Summer Sale
                - id: 019a3c2f-1a2b-7c3d-9e4f-5a6b7c8d9e01
                  type: rich-text
                  data:
                    content: <p>Free shipping on orders over $50.</p>
                - id: 019a3c2e-5b7d-7f10-8a2b-3c4d5e6f7a81
                  data: {}
                  children:
                    - id: 019a3c2e-5b7d-7f10-8a2b-3c4d5e6f7a82
                    - id: 019a3c2f-1a2b-7c3d-9e4f-5a6b7c8d9e01
                    - id: 019a3c2e-5b7d-7f10-8a2b-3c4d5e6f7a83
      responses:
        '200':
          description: Update result with per-item accounting
          content:
            application/json:
              schema:
                type: object
                properties:
                  object:
                    type: string
                    enum:
                      - page_update
                  pageId:
                    type: string
                  locale:
                    type: string
                  requested:
                    type: integer
                  updated:
                    type: integer
                  created:
                    type: integer
                  notFound:
                    type: integer
                  failed:
                    type: integer
                  updatedIds:
                    type: array
                    items:
                      type: string
                  createdIds:
                    type: array
                    items:
                      type: string
                  notFoundIds:
                    type: array
                    items:
                      type: string
                  failedIds:
                    type: array
                    items:
                      type: string
              example:
                object: page_update
                pageId: clz2r7t5w0002mnop9012qrst
                locale: en-us
                requested: 3
                updated: 2
                created: 1
                notFound: 0
                failed: 0
                updatedIds:
                  - 019a3c2e-5b7d-7f10-8a2b-3c4d5e6f7a82
                  - 019a3c2e-5b7d-7f10-8a2b-3c4d5e6f7a81
                createdIds:
                  - 019a3c2f-1a2b-7c3d-9e4f-5a6b7c8d9e01
                notFoundIds: []
                failedIds: []
        '400':
          description: Invalid params or body
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Missing or invalid token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: >-
            Token's shop does not own the project (FORBIDDEN), or
            INSUFFICIENT_SCOPE: a delegated token without `content:write`
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Page not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '409':
          description: >-
            Page is inherited from a parent project, or STALE_PAGE: the page
            changed since the caller's read (expectedUpdatedAt mismatch —
            re-read and reapply)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                object: error
                code: STALE_PAGE
                message: >-
                  Page "PRODUCT/blue-shirt" changed since your last read
                  (expectedUpdatedAt mismatch). Re-read the page and reapply
                  your patch on top of the newer content.
                status: 409
        '428':
          description: >-
            PRECONDITION_REQUIRED: a delegated (MCP OAuth) token omitted
            `expectedUpdatedAt`. API keys never receive this.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    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.