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

# Rename, delete, or draft and publish a global section

> Runs one operation on a global section, selected by `op`. A section has its own draft lifecycle, separate from page drafts: `save-draft` stores a draft only, and nothing reaches storefronts until `publish-draft`. `rename` and `delete` take effect immediately.

Operations:

- `save-draft` (`content:write`): saves `items` (1-500 items, the full item shape; a malformed graph returns `400`) as the section's shared draft. `expectedHeadVersionId` must name the current draft head (`null` when there is none); if another save moved the head, the call returns `409 STALE_PAGE`. Re-read with GET and retry. An exact retry of a save whose response was lost is recognized and returns the same head. Not live.
- `discard-draft` (`content:write`): drops the draft head named by `versionId`. Live content is untouched.
- `publish-draft` (`content:publish`): makes draft `versionId` live on every page that renders the section, advances those pages' revisions and clears the draft head. `pageIds` lists the pages it advanced. Retrying a publish that already committed returns the stored receipt without rewriting content. `409 STALE_PAGE` means the draft or the live section changed shape during the publish.
- `rename` (`content:write`): renames the section (`name`, 1-191 characters). Live immediately.
- `delete` (`content:delete`, plus `confirm` equal to the `sectionId`): unshares the section. Every page that rendered it keeps a page-local copy of the content, then the section is removed. Live immediately.

`publish-draft` and `delete` return `cacheDelivery: "degraded"` when the content change is committed but the storefront cache refresh is still queued for retry. Do not repeat the operation; storefronts catch up when the retry lands.

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

Required scope: `content:write` (all operations); `publish-draft` also needs `content:publish`, `delete` also needs `content:delete`



## OpenAPI

````yaml https://studio.weaverse.io/api/v1/content/openapi.json post /projects/{projectId}/global-sections/{sectionId}
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}/global-sections/{sectionId}:
    summary: 'One section: draft head, rename, delete, draft lifecycle'
    description: >-
      GET reads the draft head (null when none). POST
      op=save-draft/discard-draft are content:write; op=publish-draft needs
      content:publish; op=delete needs content:delete + confirm="<sectionId>".
      op=delete returns cacheDelivery:"degraded" when the committed delete's
      cache delivery is still queued for retry (content already changed; do not
      repeat the delete). save-draft items follow the same full item shape (400
      on malformed graphs).
    parameters:
      - name: projectId
        in: path
        required: true
        schema:
          type: string
      - name: sectionId
        in: path
        required: true
        schema:
          type: string
    post:
      tags:
        - Global sections
      summary: Rename, delete, or draft and publish a global section
      description: >-
        Runs one operation on a global section, selected by `op`. A section has
        its own draft lifecycle, separate from page drafts: `save-draft` stores
        a draft only, and nothing reaches storefronts until `publish-draft`.
        `rename` and `delete` take effect immediately.


        Operations:


        - `save-draft` (`content:write`): saves `items` (1-500 items, the full
        item shape; a malformed graph returns `400`) as the section's shared
        draft. `expectedHeadVersionId` must name the current draft head (`null`
        when there is none); if another save moved the head, the call returns
        `409 STALE_PAGE`. Re-read with GET and retry. An exact retry of a save
        whose response was lost is recognized and returns the same head. Not
        live.

        - `discard-draft` (`content:write`): drops the draft head named by
        `versionId`. Live content is untouched.

        - `publish-draft` (`content:publish`): makes draft `versionId` live on
        every page that renders the section, advances those pages' revisions and
        clears the draft head. `pageIds` lists the pages it advanced. Retrying a
        publish that already committed returns the stored receipt without
        rewriting content. `409 STALE_PAGE` means the draft or the live section
        changed shape during the publish.

        - `rename` (`content:write`): renames the section (`name`, 1-191
        characters). Live immediately.

        - `delete` (`content:delete`, plus `confirm` equal to the `sectionId`):
        unshares the section. Every page that rendered it keeps a page-local
        copy of the content, then the section is removed. Live immediately.


        `publish-draft` and `delete` return `cacheDelivery: "degraded"` when the
        content change is committed but the storefront cache refresh is still
        queued for retry. Do not repeat the operation; storefronts catch up when
        the retry lands.


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


        Required scope: `content:write` (all operations); `publish-draft` also
        needs `content:publish`, `delete` also needs `content:delete`
      operationId: globalSectionOperation
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/GlobalSectionOperation'
            example:
              op: save-draft
              items: []
              expectedHeadVersionId: null
            examples:
              save-draft:
                summary: Save a draft of the section
                value:
                  op: save-draft
                  items:
                    - id: clz9h1a2b0003gs01hdr0001
                      type: header
                      data:
                        sticky: false
                      children:
                        - id: clz9h1a2b0004gs01nav0002
                    - id: clz9h1a2b0004gs01nav0002
                      type: header-menu
                      data:
                        menu: main-menu
                      children: []
                  expectedHeadVersionId: null
              publish-draft:
                summary: Publish the saved draft
                value:
                  op: publish-draft
                  versionId: clzb3v0d10007gsv0ver0007
              rename:
                summary: Rename the section
                value:
                  op: rename
                  name: Main header
              delete:
                summary: Delete the section (pages keep a local copy)
                value:
                  op: delete
                  confirm: clz9g7x1k0001gs0secn0001
      responses:
        '200':
          description: Operation result
          content:
            application/json:
              schema:
                type: object
              example:
                publishedAt: '2026-10-15T12:02:44.000Z'
                pageRevisions:
                  clz8q1m2n0002pg01home0001: '2026-10-15T12:02:44.000Z'
                  clz8q1m2n0003pg01prod0002: '2026-10-15T12:02:44.000Z'
                sectionId: clz9g7x1k0001gs0secn0001
                projectId: clz8p2k0q0001ab12cd34ef56
                versionId: clzb3v0d10007gsv0ver0007
                rootItemId: clz9h1a2b0003gs01hdr0001
                pageIds:
                  - clz8q1m2n0002pg01home0001
                  - clz8q1m2n0003pg01prod0002
        '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 — draft head moved
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
              example:
                object: error
                code: STALE_PAGE
                message: GLOBAL_SECTION_DRAFT_STALE
                status: 409
components:
  schemas:
    GlobalSectionOperation:
      type: object
      required:
        - op
      oneOf:
        - type: object
          required:
            - op
            - name
          properties:
            op:
              const: rename
            name:
              type: string
        - type: object
          required:
            - op
            - confirm
          properties:
            op:
              const: delete
            confirm:
              type: string
        - type: object
          required:
            - op
            - items
            - expectedHeadVersionId
          properties:
            op:
              const: save-draft
            items:
              type: array
              items:
                $ref: '#/components/schemas/DraftItem'
            expectedHeadVersionId:
              type:
                - string
                - 'null'
        - type: object
          required:
            - op
            - versionId
          properties:
            op:
              const: discard-draft
            versionId:
              type: string
        - type: object
          required:
            - op
            - versionId
          properties:
            op:
              const: publish-draft
            versionId:
              type: string
    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.
    DraftItem:
      type: object
      required:
        - id
      properties:
        id:
          type: string
        type:
          type: string
        data:
          type: object
          additionalProperties: true
        children:
          type: array
          items:
            type: object
            required:
              - id
            properties:
              id:
                type: string
  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.