Skip to main content

Content API

The Weaverse Content API is a REST API that lets you read and update your page content, theme settings, and project data from any application — headless frontends, mobile apps, static site generators, AI agents, or custom integrations.
Write endpoints cover page content (update + delete), theme settings, and the project name. Content changes use the same cache-invalidation path as a Studio save. Project create/delete and store-level settings remain Studio-only.

Base URL

Endpoints

The separate public discovery API exposes GET /api/public/v1/projects/:projectId/custom-pages for custom-page route metadata. It does not require a Content API key and does not filter assignments by publication state. All write endpoints also accept POST with the same body, for clients and proxies that strip PATCH/DELETE bodies. Full request/response schemas live in /openapi.json.

Write semantics

  • Page update — PATCH .../pages/:type/:handle... with { "items": [{ "id", "data", "type?", "children?" }], "locale?" }. data is shallow-merged over the item’s existing data (send only changed top-level keys; nested objects are replaced wholesale). Unknown ids are created only when type is supplied. Max 100 items per request.
  • Page create — POST .../pages with { "type", "handle", "name?", "locale?", "basedOn?", "shopifyResourceId?" }. Creatable types are CUSTOM, PRODUCT, COLLECTION, PAGE, BLOG, ARTICLE. CUSTOM creates a bespoke page with a blank root item (or clones basedOn). A resource-backed type creates a per-resource override that clones the project’s shared default template for that type when one exists (otherwise blank), or clones basedOn. This creates one new page per call (a per-resource copy). A duplicate live assignment returns 409 and mutates nothing.
  • Assign template resources — POST .../template-assignments/:pageId with { "assignments": [{ "handle", "shopifyResourceId?", "locale?" }] }. Assigns many resources to one shared template page without creating page copies. All-or-nothing: a handle already on this page is an idempotent no-op, but if any handle belongs to a different live page the whole request returns 409 and writes nothing (never repointed).
  • Page delete — DELETE .../pages with { "pageIds": [...] } or { "handles": [...], "type", "locale?" }. Accepts up to 500 target values. When both selector arrays are present, pageIds takes precedence.
  • Theme settings — PATCH .../theme-settings with { "theme": { ... } }. Top-level keys are shallow-merged over the project’s own theme. For a real change, Weaverse attempts a deduplicated snapshot of the merged result, but snapshot failure is non-fatal and does not stop the settings write.
  • Project — PATCH /projects/:projectId with { "name": "..." }. Only name is writable; unknown fields are rejected.
The page detail endpoint captures the handle as the rest of the path. Use the exact handle returned by /projects/:projectId/pages; custom page handles may include /, such as pages/gift-shop.

Response formats

Page and theme-settings endpoints support two output formats. The default is unchanged — existing integrations are unaffected. When both the query parameter and the Accept header are present, the query parameter wins. See Get Page › Portable Text format for the full mapping rules and a rendering example.
Portable Text is well-suited for multi-channel rendering (web, native, email, PDF) and for piping content into LLMs, since the structured JSON is far easier to query and reason over than HTML strings.

Authentication

All endpoints (except /openapi.json) require a Content API key. Pass it via the Authorization header:
A ?apiKey= query parameter fallback exists for development, but tokens in query strings appear in server and CDN logs. Always use the Authorization header in production.

Obtaining an API key

Content API keys are provisioned per shop. Generate one from the Weaverse Dashboard → Settings.

Scoping

Each API key is scoped to a single Weaverse shop. Requests can only access projects that belong to that shop. Attempting to access another shop’s project returns a 403 Forbidden error.

Pagination

List endpoints (/projects and /pages) use cursor-based pagination.

Paginated response shape

  • nextCursor is null when there are no more results.
  • Pass nextCursor as the after parameter to fetch the next page.

Example: iterating through pages

Error handling

All errors follow a consistent envelope:

Error codes

Usage tracking & billing

Every authenticated API request counts toward your plan’s usage quota. API hits share the same billing pool as storefront page views:
  • 1 API request = 1 page view hit
  • Usage is tracked per project and appears in your billing dashboard
  • Tracking is non-blocking — it never slows down API responses
  • The /openapi.json endpoint is public and not tracked
Monitor your API usage in the Weaverse Studio billing dashboard to avoid unexpected overages.

Quick start

1

Get your API key

Obtain a Content API key from your Weaverse Studio dashboard.
2

List your projects

3

Fetch page content

4

Render in your app

Use the returned items array to render page sections in any frontend framework.

TypeScript example

Next steps

List Projects

Retrieve all projects in your shop

List Pages

Browse page assignments in a project

Get Page Content

Fetch full page data with component items

Get Theme Settings

Retrieve theme design tokens and configuration