> ## 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, localize or remove page assignments

> Runs one structural operation on this project's page assignments, selected by `op`. All operations are live writes (routing changes immediately, no draft or publish step).

Operations:

- `update` (`content:write`): changes `handle` and `locale` of 1-100 assignments by `id`. Every id must belong to this project; one foreign id refuses the whole batch with `404` and nothing moves. Returns the updated rows. A handle that another assignment already uses in that scope, or a custom page that would hold two handles in one scope (`details.handles`), returns `409 CONFLICT` and nothing moves.
- `localize` (`content:write`): creates a locale-specific copy of page `pageId` for `locale`, with the same type and handle and a copy of its SEO. Returns the new page.
- `unassign` (`content:delete`, `confirm` equal to `pageId`): removes up to 100 resource assignments (`assignmentIds`) from template page `pageId`. Only rows that template owns in this project are removed; other ids are ignored. The template's own wiring row and the page itself are never removed. Returns the number removed.
- `reset-localized` (`content:delete`, `confirm` equal to `assignmentId`): removes the localized assignment `assignmentId` of page `pageId` so the route falls back to the default page. A version of the content is kept for recovery.
- `rename-locale` (`content:delete`, `confirm` equal to the `projectId`): moves every assignment of the project from `fromLocale` to `toLocale`. Returns the number of rows moved.

A wrong `confirm` value returns `400 INVALID_PARAMS`.

Required scope: `content:write` (all operations); `unassign`, `reset-localized` and `rename-locale` also need `content:delete`



## OpenAPI

````yaml https://studio.weaverse.io/api/v1/content/openapi.json post /projects/{projectId}/assignments
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}/assignments:
    summary: 'Assignments: update, unassign, localize, reset, rename-locale'
    description: >-
      GET lists assignment rows. POST op=update/localize are content:write;
      op=unassign/reset-localized/rename-locale are destructive (content:delete;
      unassign/reset confirm the exact id, rename-locale confirms the
      projectId).
    parameters:
      - name: projectId
        in: path
        required: true
        schema:
          type: string
    post:
      tags:
        - Assignments
      summary: Update, localize or remove page assignments
      description: >-
        Runs one structural operation on this project's page assignments,
        selected by `op`. All operations are live writes (routing changes
        immediately, no draft or publish step).


        Operations:


        - `update` (`content:write`): changes `handle` and `locale` of 1-100
        assignments by `id`. Every id must belong to this project; one foreign
        id refuses the whole batch with `404` and nothing moves. Returns the
        updated rows. A handle that another assignment already uses in that
        scope, or a custom page that would hold two handles in one scope
        (`details.handles`), returns `409 CONFLICT` and nothing moves.

        - `localize` (`content:write`): creates a locale-specific copy of page
        `pageId` for `locale`, with the same type and handle and a copy of its
        SEO. Returns the new page.

        - `unassign` (`content:delete`, `confirm` equal to `pageId`): removes up
        to 100 resource assignments (`assignmentIds`) from template page
        `pageId`. Only rows that template owns in this project are removed;
        other ids are ignored. The template's own wiring row and the page itself
        are never removed. Returns the number removed.

        - `reset-localized` (`content:delete`, `confirm` equal to
        `assignmentId`): removes the localized assignment `assignmentId` of page
        `pageId` so the route falls back to the default page. A version of the
        content is kept for recovery.

        - `rename-locale` (`content:delete`, `confirm` equal to the
        `projectId`): moves every assignment of the project from `fromLocale` to
        `toLocale`. Returns the number of rows moved.


        A wrong `confirm` value returns `400 INVALID_PARAMS`.


        Required scope: `content:write` (all operations); `unassign`,
        `reset-localized` and `rename-locale` also need `content:delete`
      operationId: assignmentOperation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AssignmentOperation'
            example:
              op: update
              updates: []
            examples:
              update:
                summary: Change an assignment's handle
                value:
                  op: update
                  updates:
                    - id: clz8r5t6u0005pa01abou0001
                      locale: ''
                      handle: our-story
              localize:
                summary: Create a French copy of a page
                value:
                  op: localize
                  pageId: clz8q1m2n0004pg01abou0003
                  locale: fr
              unassign:
                summary: Remove products from a template
                value:
                  op: unassign
                  pageId: clz8q1m2n0003pg01prod0002
                  assignmentIds:
                    - clz8r5t6u0006pa01prod0002
                  confirm: clz8q1m2n0003pg01prod0002
      responses:
        '200':
          description: Operation result
          content:
            application/json:
              schema:
                type: object
              example:
                object: assignments_updated
                data:
                  - id: clz8r5t6u0005pa01abou0001
                    projectId: clz8p2k0q0001ab12cd34ef56
                    type: CUSTOM
                    handle: our-story
                    locale: ''
                    market: null
                    pageId: clz8q1m2n0004pg01abou0003
                    cachedPageData: null
                    shopifyResourceId: null
                    createdAt: '2026-10-14T09:12:30.000Z'
                    updatedAt: '2026-10-15T11:40:02.000Z'
                    deletedAt: null
        '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: a custom page would hold two handles in one scope
            (`details.handles`), or another assignment already uses the handle;
            nothing was changed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  schemas:
    AssignmentOperation:
      type: object
      required:
        - op
      oneOf:
        - type: object
          required:
            - op
            - updates
          properties:
            op:
              const: update
            updates:
              type: array
              items:
                type: object
                required:
                  - id
                  - locale
                  - handle
                properties:
                  id:
                    type: string
                  locale:
                    type: string
                  handle:
                    type: string
          description: >-
            Rename/re-locale assignments of THIS project. Every id must belong
            to the URL project (a same-shop sibling project's id refuses the
            whole batch with 404; nothing moves).
        - type: object
          required:
            - op
            - pageId
            - assignmentIds
            - confirm
          properties:
            op:
              const: unassign
            pageId:
              type: string
              description: The template page whose resource assignments are removed
            assignmentIds:
              type: array
              maxItems: 100
              items:
                type: string
            confirm:
              type: string
              description: Must equal pageId
          description: >-
            Remove resource assignments from a template page (content:delete +
            confirm). Only rows that template owns; its template-marker wiring
            row and the page itself are never removed.
        - type: object
          required:
            - op
            - pageId
            - locale
          properties:
            op:
              const: localize
            pageId:
              type: string
            locale:
              type: string
        - type: object
          required:
            - op
            - pageId
            - assignmentId
            - confirm
          properties:
            op:
              const: reset-localized
            pageId:
              type: string
            assignmentId:
              type: string
            confirm:
              type: string
              description: Must equal assignmentId
        - type: object
          required:
            - op
            - fromLocale
            - toLocale
            - confirm
          properties:
            op:
              const: rename-locale
            fromLocale:
              type: string
            toLocale:
              type: string
            confirm:
              type: string
              description: Must equal the projectId
    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.