> ## 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/*`.
> Before using any code sample, read `@weaverse/hydrogen` in the project's `package.json`: 6.x and 5.x import from different entries and use different type names, so code for one does not build on the other.
> `@weaverse/hydrogen` 6 (Shopify Hydrogen 2026.10 and later, the version these docs show) imports from `@weaverse/hydrogen/react-router` and uses `Weaverse*` types such as `WeaverseComponentProps`, `WeaverseComponentLoaderArgs` and `WeaverseComponentSchema`; the root `@weaverse/hydrogen` entry only exports `createSchema()`, data helpers and types.
> `@weaverse/hydrogen` 5.x (Hydrogen 2026.4 and earlier) imports everything from `@weaverse/hydrogen` and uses `HydrogenComponentProps`, `ComponentLoaderArgs` and `HydrogenComponentSchema`. On a 5.x project, convert samples to these names. Upgrade to 6 only when asked (`npx @weaverse/cli@latest migrate v6`, plus the Hydrogen 2026.10 upgrade). Do not mix major versions.
> Next.js themes use `@weaverse/hydrogen` 6.2.0 or later: import client and shared code from `@weaverse/hydrogen/next` and server-only code from `@weaverse/hydrogen/next/server`. `@weaverse/next` is deprecated; never install or import it.
> For live project data (pages, theme settings, translations), use the Weaverse MCP server: https://weaverse.io/docs/developer-tools/weaverse-mcp

# Get page content

> Returns a page's full content: its component items, revision and inheritance metadata. This is the primary endpoint for rendering Weaverse pages in external applications.

Use the exact `type`, `handle` and `locale` from `GET /projects/{projectId}/pages`. Custom page handles may include `/` (for example `pages/gift-shop`, fetched at `/projects/{projectId}/pages/CUSTOM/pages/gift-shop`). Singleton types (`INDEX`, `ALL_PRODUCTS`, `COLLECTION_LIST`, `CART`, `CUSTOMER`, `NOT_FOUND`, `PASSWORD`, `SEARCH`) accept an empty handle; `CUSTOM` and the per-resource types require one. An unknown `type` returns `400`.

**Always pass `locale` on localized projects.** Content is stored per locale: a page edited while a market such as `en-us` is selected in Studio is saved on the `en-us` assignment, not the base locale (`""`). Without `locale` the base locale is requested first and may resolve to a different, unedited assignment. This is the most common reason a published change looks missing from the API.

Resolution order, evaluated at each project level:

1. The requested handle's market match, when the project uses market-first resolution
2. The requested handle with the exact locale
3. The requested handle with the empty locale (`""`)
4. The requested handle with the legacy `en-us` locale
5. For a non-`CUSTOM` request with a non-empty handle, the type's shared default template (empty handle), in the same market, exact-locale, empty-locale, then `en-us` order

If the project has no match, the same sequence runs for its parent and then grandparent project (`meta.inherited`, `meta.depth`, `meta.sourceProjectId` tell you where the content came from). Nothing found returns `404 PAGE_NOT_FOUND`.

`items` is a flat list. Rebuild the tree from each item's `children` references, starting at the root item. With `format=portable-text` (or `Accept: application/portable-text+json`), `items` is replaced by a `content` array of Portable Text blocks. `includeDefaults=true` fills settings the merchant never customized with their schema defaults.

Required scope: `content:read`



## OpenAPI

````yaml https://studio.weaverse.io/api/v1/content/openapi.json get /projects/{projectId}/pages/{type}/{handle}
openapi: 3.1.0
info:
  title: Weaverse Content API
  version: 1.0.0
  description: >-
    Authenticated REST API for reading and editing Weaverse-managed content
    (projects, pages, drafts, global sections, theme settings, languages) and
    for reading and writing per-locale translations.


    ## Authentication


    Send a bearer token in the `Authorization` header: a shop API key
    (`WEAVERSE_API_KEY`), a scoped API key or a delegated MCP OAuth token.
    Translation-unit routes also accept a project-bound translation agent token.
    Each operation's description ends with the scope it requires.


    ## Scopes


    | Scope | Grants |

    |---|---|

    | `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 or cancel
    publications, restore versions, publish global sections |

    | `content:delete` | Delete pages, global sections, languages and static
    keys, and revert overrides. Project deletion also needs `project:manage` |

    | `project:manage` | Create, copy and delete projects; settings, variants,
    hierarchy, backups, restore as new, previews and hostname policy |

    | `translations:read` | Read translation units only, with no general content
    access |

    | `translations:write` | Apply translation units only; never changes page
    content |


    A legacy API key without scopes keeps read, write and translation access and
    every endpoint that existed before scopes, but never gains publish, delete
    or project management.
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}:
    get:
      tags:
        - Pages
      summary: Get page content
      description: >-
        Returns a page's full content: its component items, revision and
        inheritance metadata. This is the primary endpoint for rendering
        Weaverse pages in external applications.


        Use the exact `type`, `handle` and `locale` from `GET
        /projects/{projectId}/pages`. Custom page handles may include `/` (for
        example `pages/gift-shop`, fetched at
        `/projects/{projectId}/pages/CUSTOM/pages/gift-shop`). Singleton types
        (`INDEX`, `ALL_PRODUCTS`, `COLLECTION_LIST`, `CART`, `CUSTOMER`,
        `NOT_FOUND`, `PASSWORD`, `SEARCH`) accept an empty handle; `CUSTOM` and
        the per-resource types require one. An unknown `type` returns `400`.


        **Always pass `locale` on localized projects.** Content is stored per
        locale: a page edited while a market such as `en-us` is selected in
        Studio is saved on the `en-us` assignment, not the base locale (`""`).
        Without `locale` the base locale is requested first and may resolve to a
        different, unedited assignment. This is the most common reason a
        published change looks missing from the API.


        Resolution order, evaluated at each project level:


        1. The requested handle's market match, when the project uses
        market-first resolution

        2. The requested handle with the exact locale

        3. The requested handle with the empty locale (`""`)

        4. The requested handle with the legacy `en-us` locale

        5. For a non-`CUSTOM` request with a non-empty handle, the type's shared
        default template (empty handle), in the same market, exact-locale,
        empty-locale, then `en-us` order


        If the project has no match, the same sequence runs for its parent and
        then grandparent project (`meta.inherited`, `meta.depth`,
        `meta.sourceProjectId` tell you where the content came from). Nothing
        found returns `404 PAGE_NOT_FOUND`.


        `items` is a flat list. Rebuild the tree from each item's `children`
        references, starting at the root item. With `format=portable-text` (or
        `Accept: application/portable-text+json`), `items` is replaced by a
        `content` array of Portable Text blocks. `includeDefaults=true` fills
        settings the merchant never customized with their schema defaults.


        Required scope: `content:read`
      operationId: getPage
      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)
        - name: handle
          in: path
          required: true
          schema:
            type: string
          description: >-
            Page handle. This is the final greedy path component and may include
            `/`; pass the exact handle from the list endpoint, e.g.
            `blue-shirt`, `track-order`, or `pages/gift-shop`. Leave empty to
            target a singleton type's single default page — the home page
            (`INDEX`), the `/products` and `/collections` index pages
            (`ALL_PRODUCTS`, `COLLECTION_LIST`), `CART`, `CUSTOMER`,
            `NOT_FOUND`, `PASSWORD`, `SEARCH`. A handle is required for `CUSTOM`
            pages and for per-resource templated types (`PRODUCT`, `COLLECTION`,
            `PAGE`, `BLOG`, `ARTICLE`), whose empty handle is the shared default
            template.
        - name: locale
          in: query
          schema:
            type: string
          description: Requested locale. Falls back through locale chain if not found.
        - $ref: '#/components/parameters/Format'
        - $ref: '#/components/parameters/Meta'
        - $ref: '#/components/parameters/IncludeDefaults'
      responses:
        '200':
          description: Page with item tree
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Page'
              example:
                object: page
                id: clz2r7t5w0002mnop9012qrst
                type: PRODUCT
                handle: blue-shirt
                locale: en-us
                items:
                  - id: 019a3c2e-5b7d-7f10-8a2b-3c4d5e6f7a81
                    type: main
                    data: {}
                    children:
                      - id: 019a3c2e-5b7d-7f10-8a2b-3c4d5e6f7a82
                      - id: 019a3c2e-5b7d-7f10-8a2b-3c4d5e6f7a83
                  - id: 019a3c2e-5b7d-7f10-8a2b-3c4d5e6f7a82
                    type: hero-banner
                    data:
                      title: Summer Collection
                      subtitle: New arrivals for the season
                      buttonText: Shop Now
                      buttonLink: /collections/summer
                    children: null
                  - id: 019a3c2e-5b7d-7f10-8a2b-3c4d5e6f7a83
                    type: product-details
                    data:
                      showPrice: true
                      showVariants: true
                      layout: two-column
                    children: null
                updatedAt: '2026-10-18T14:22:05.000Z'
                meta:
                  inherited: false
                  sourceProjectId: clz1k8m2n0000abcd1234efgh
                  depth: 0
                seo: null
        '400':
          description: Invalid `format` value (must be `weaverse` or `portable-text`)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          description: Unauthorized
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '403':
          description: Forbidden
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '404':
          description: Page not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
components:
  parameters:
    Format:
      name: format
      in: query
      description: >-
        Output format for rich-text fields.

        - `weaverse` (default): rich text returned as HTML strings — original
        behavior, no migration needed.

        - `portable-text`: rich text returned as structured Portable Text blocks
        for multi-channel rendering and AI consumption.


        Equivalent to setting `Accept: application/portable-text+json` on the
        request. The query parameter takes precedence over the header when both
        are provided. An invalid value returns `400 INVALID_PARAMS`.
      schema:
        type: string
        enum:
          - weaverse
          - portable-text
        default: weaverse
    Meta:
      name: meta
      in: query
      description: >-
        Opt-in inclusion of `_weaverse: { id, schemaVersion }` on each Portable
        Text custom block so consumers can round-trip back to the original
        Weaverse item id. Only meaningful when `format=portable-text`; silently
        ignored otherwise. Not applicable on `/theme-settings` (free-form leaves
        have no item id to round-trip).


        Only the literal string `true` enables this; any other value (e.g. `1`,
        `yes`, `false`) is silently treated as `false` rather than returning 400
        — this asymmetry vs `format` exists because `meta` was added later and
        is purely additive.
      schema:
        type: boolean
        default: false
    IncludeDefaults:
      name: includeDefaults
      in: query
      description: >-
        Opt-in server-side default resolution. When `true`, each item's `data`
        is completed with the component schema `defaultValue` for every setting
        the merchant never customized (the studio strips values equal to their
        default on save). Stored values always win; only missing keys are
        filled. Items whose component type has no stored schema are returned
        unchanged. `resolved=true` is an accepted alias. Only the literal string
        `true` enables this; any other value is treated as `false`.


        Note: component schemas are keyed by type only (not per theme version) —
        if two themes register the same section type, the most recently synced
        schema's defaults apply.
      schema:
        type: boolean
        default: false
  schemas:
    Page:
      type: object
      properties:
        object:
          type: string
          enum:
            - page
        id:
          type:
            - string
            - 'null'
        type:
          type: string
        handle:
          type: string
        locale:
          type:
            - string
            - 'null'
        items:
          type: array
          items:
            $ref: '#/components/schemas/Item'
        updatedAt:
          type:
            - string
            - 'null'
          format: date-time
        meta:
          type: object
          properties:
            inherited:
              type: boolean
            sourceProjectId:
              type: string
            depth:
              type: integer
        seo:
          type:
            - object
            - 'null'
          description: >-
            The page's SEO metadata (`title`, `description`, `keywords`,
            `canonicalUrl`, `openGraph`, `twitter`, ...), or null when the page
            has none.
    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.
    Item:
      type: object
      description: >-
        A component instance. The `children` field is a JSON value encoding
        child items.
      properties:
        id:
          type: string
        type:
          type: string
        data:
          type: object
          description: Component props/settings
        children:
          description: Child items (JSON structure)
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: WEAVERSE_API_KEY
      description: >-
        Bearer token: a shop API key (`WEAVERSE_API_KEY`), a scoped API key or a
        delegated MCP OAuth token; translation-unit routes also accept a
        project-bound translation agent token. Each operation lists the scope it
        requires; the scope table is in the API description.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.