Generated banner for Wix Headless
Generated logo for Wix Headless

Wix Headless

WixOfficialPublished by Wix

  • Skill
  • Tool integration
  • Software development
  • MIT
  • Low risk
  • Has scripts

From the author

Connect Wix business services (Stores, Bookings, Donations, CMS, Blog, Events, Forms, and more) to a Wix Headless frontend — infer the needed capabilities, install the apps, seed backend content, and produce an SDK-integration guide. For managed (Wix-hosted) projects it can also build the frontend: scaffold a new site (create) or wire an existing/brought-in design (connect), then build and release. Works across managed, self-managed, and stripe project types. Triggers: set up a Wix Headless backend, add Wix business features to my app, accept donations, build or host a Wix site, connect/implement this design with Wix.
— the description by Wix

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

The wix-headless skill acts as an orchestrator for integrating Wix business services (such as Stores, Bookings, and CMS) into a headless frontend architecture. It handles the end-to-end configuration of the Wix backend, including app installation, content seeding, and the generation of a tailored SDK integration guide. Depending on the project type (managed, self-managed, or stripe), the skill can either provide a comprehensive integration guide for the user to implement or, in managed scenarios, actively scaffold, wire, and deploy the frontend project.

What it does

  • Infers required Wix capabilities based on user intent and project context.
  • Installs necessary Wix apps and seeds backend content automatically.
  • Generates a custom SDK integration guide for calling Wix services from the frontend.
  • Scaffolds or connects existing frontend projects to Wix for managed hosting.
  • Handles project-type-specific authentication and deployment workflows.
  • Provides a mechanism to relay feedback to Wix regarding the headless experience.

When to use it

  • When you need to integrate Wix business services into a custom-built headless frontend.
  • When you want to automate the setup and content seeding of a Wix backend.
  • When you are building a new site on Wix infrastructure and need a scaffolded frontend.
  • When you have an existing frontend design and need to wire it to Wix business capabilities.
  • When working with Stripe Projects and requiring a Wix backend configuration.

Advantages

  • Reduces manual configuration by automating app installation and content seeding.
  • Provides a clear, actionable SDK integration guide tailored to your specific capabilities.
  • Supports multiple project architectures including managed, self-managed, and Stripe-based setups.
  • Ensures consistent backend setup by following verified inline recipes.
  • Simplifies the transition from design to a functional, Wix-powered headless site.

Usage examples

“Set up a Wix Headless backend for a store with products and a blog.”
The skill will install the Stores and Blog apps, seed sample products and posts, and provide an SDK guide for fetching this data in your frontend.
“I have an existing design; connect it to Wix and host it on their managed infrastructure.”
The skill will initialize the project, wire the existing UI to the necessary Wix business services, and prepare it for release on Wix.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/wix/wix-headless/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip wix-headless.zip -d .agents/skills

Documentation by Wix

Wix Headless

This skill connects Wix business services to a Wix Headless frontend. Its core job is to configure the Wix backend: infer the needed capabilities, install the Wix apps, seed the backend content, and produce an SDK-integration guide describing how to call Wix from the frontend.

What happens with the frontend depends on the project type and operation:

  • Backend-only (self-managed, stripe, or a managed "just set up the backend" run) — the skill emits the SDK guide as its final output; the host owns the frontend, build, and hosting.

  • Managed create / connect — the skill also owns the frontend: it scaffolds a new project (create) or attaches Wix to an existing one (connect), wires it to the backend using that same guide, builds, and releases to Wix. (There is no Designer or template library — the frontend is built ad-hoc to intent.)

On a backend-only run the skill does not own the project scaffolding. When the work needs a frontend, scaffold it according to user intent — framework and structure follow the prompt; the skill's job is the Wix backend plus the emitted SDK guide describing how to call Wix from whatever frontend exists, not choosing or generating the app. This is the norm for a stripe run: the project is provisioned via Stripe Projects (credentials land in .env — see stripe/AUTHENTICATION.md), the skill configures the backend and emits the guide, and the live site is finalized per stripe/DEPLOYMENT.md — while the frontend is scaffolded and wired to intent, by the host.

Project types

The skill behaves identically across project types except for authentication and deployment, which are isolated in a per-type folder under references/:

Project typeHostingAuthentication & deployment live in
managedWix infrastructure (maintained by Wix)references/managed/
self-managedthe user's own host (TBD)references/self-managed/
stripethe user's own host, provisioned via Stripe Projectsreferences/stripe/

Everything else — Discovery, Setup, Seed, the SDK handoff — is project-type-agnostic and refers to "the provided authentication mechanism" rather than any specific method.

Resolving the project type

Resolve the type before Discovery, in this order — stop at the first that decides:

  1. Caller-provided. If the host/caller passed a project type (managed | self-managed | stripe), use it. An explicit value always wins.

  2. Detect from project signals (on disk). Check the working directory (read-only):

    • stripe — .env carries WIX_WIX_CLIENT_ID / WIX_WIX_CLIENT_SECRET / WIX_WIX_METASITE_ID (or the plain WIX_* fallback). This is the Stripe-Projects fingerprint.

    • managed — a Wix CLI project: wix.config.json present, or a .wix/ directory, or @wix/cli / @wix/astro in package.json.

    • self-managed — a frontend project on disk (e.g. package.json with a bundler/framework) with neither the Stripe .env fingerprint nor the Wix-CLI markers above.

  3. Detect from user intent. If disk is inconclusive, read the prompt:

    • managed — "managed", "host on Wix", "Wix-hosted", "deploy to Wix", "wix release".

    • stripe — "stripe projects", "I added Wix via Stripe", a Stripe-Projects context.

    • self-managed — "self-hosted", "my own host", names a non-Wix host, "I'll deploy it myself".

  4. Ask. If signals are absent or conflict, ask the user which type applies — don't guess.

Hold the resolved type in scratch; it selects <TYPE_DIR> (see Path resolution). Note self-managed is TBD — once resolved to it, the auth step will stop with a clear "not wired yet" error.

Resolving the operation (managed only)

create/connect/iterate are managed-only. For managed, resolve the operation by intent first, directory second — never let an empty directory override what the user is asking for. Check iterate first (it's decided by an unambiguous on-disk signal):

  • iterate → references/managed/CONNECT.md. The project is already connected to Wix — a wix.config.json (or .wix/) is already present — and the owner wants to add or change capabilities. Same flow as connect, but §1 skips init and reuses the existing wix.config.json; never re-init an already-connected project.

  • connect → references/managed/CONNECT.md. The user brings a design not yet connected to Wix and wants it wired: a frontend project on disk without a wix.config.json, or a brought-in/fetched design (a .zip/folder/file you unzip or read, a design-file URL, a Claude-Design/v0/Lovable export), or language like "connect this / implement this design (… connecting to Wix) / host this on Wix / deploy this to Wix / add Wix Headless to this project". A brought-in or fetched design is connect even when the current directory is empty — the design arrives from elsewhere (zip/fetch/URL), so emptiness at trigger time is not a create signal. (CONNECT.md step 1 places the brought design into CWD, then inits it.)

  • create → references/managed/CREATE.md. The user wants a new site built from a prompt with nothing brought in — "build me a site / store / blog…", no design file, no project on disk.

  • backend-only — the user only wants the backend configured (no frontend work). → the shared spine + emit the SDK handoff.

For self-managed and stripe, the operation is always backend-only (the host owns the frontend). Only when there is genuinely no brought-in design and no connect language does directory emptiness decide: empty → create; an existing frontend on disk → connect.

Preconditions (the host provides these — we read, never create)

  1. The project type — managed | self-managed | stripe — provided by the caller, else detected from project signals / user intent (see Project types § "Resolving the project type"), else asked. It selects <TYPE_DIR> (see Path resolution).

  2. A Wix metasite + a headless OAuth app exist, and credentials are available — obtained via the project type's AUTHENTICATION.md. The skill needs a bearer token authorized for the metasite and the metasite id.

  3. The user intent — free text describing what Wix should power ("add a store", "blog + contact form", "persist my app's data").

  4. (Optional) the project on disk — read-only, to sharpen brand/capability inference.

If the credentials are absent, the Wix backend isn't reachable — stop with a clear error.

What this skill does

Always open DISCOVERY.md first (it's agnostic — capability/brand/intent inference + the imagery gate, no auth). Then route by project type + operation:

Backend-only (self-managed, stripe, or managed backend-only) — the lean spine:

  1. Discovery (references/DISCOVERY.md) — infer capabilities + brand + intent + imagery.

  2. Setup (references/SETUP.md) — install the Wix apps those capabilities need.

  3. Seed (references/SEED.md) — create the backend content (+ entity images if imagery is on).

  4. Handoff (references/SDK_HANDOFF.md) — after Setup and Seed, emit the integration guide: SDK bootstrap, per-capability call shapes, the seeded IDs, and the @wix/* package list.

  5. Finalize deployment (<TYPE_DIR>/DEPLOYMENT.md) — run the project-type's finalize steps.

Throughout any run — if the user asks to send feedback to Wix, complains/gets frustrated, or the run hits any real friction (a confusing error, a doc gap, a tooling dead end, a workaround you had to invent — it doesn't need to repeat), offer to relay it to Wix per references/FEEDBACK.md. Default to offering rather than waiting to be asked. Every flow's finalize step (<TYPE_DIR>/DEPLOYMENT.md / managed/CREATE.md / managed/CONNECT.md) ends with the same checkpoint — treat it as a required self-check, not optional. Send only after an explicit yes — never automatically.

Managed create / connect / iterate — after Discovery, hand the whole run to the managed flow:

  • create → references/managed/CREATE.md (scaffold → Setup → Seed → build the frontend → release).

  • connect → references/managed/CONNECT.md (init → Setup → Seed → wire the existing UI → release).

  • iterate → references/managed/CONNECT.md — the project is already connected, so it reuses the existing wix.config.json (no init). Setup / Seed / wiring are incremental: it may already be set up and seeded from a prior run, so the agent checks current state first (installed apps, already-seeded content, existing wiring) and applies only the delta the new intent needs — never blindly re-installing or re-seeding. Re-release only if the frontend build output changed. These reuse the same SETUP.md/SEED.md/SDK_HANDOFF.md, but apply the SDK guide to build/wire the frontend themselves rather than emitting it, and release via managed/DEPLOYMENT.md.

Each Wix call uses the universal call shape (SETUP.md §1) with $TOKEN/$SITE_ID obtained per <TYPE_DIR>/AUTHENTICATION.md. The skill runs non-interactively except for the one imagery question (and asking the project type if it can't be resolved).

Don't smoke-test the frontend locally unless the user asks to verify. The deliverable is the built-and-released site (managed) or the SDK guide (backend-only) — not a local test report. By default do not start a dev server (wix dev / astro dev / npm run dev) to curl pages, drive the cart / booking / login flow, or launch a headless browser: correctness comes from following the recipes, real errors surface at wix build / wix release, and a headless run can't complete an interactive login or a real payment anyway — so these loops routinely burn minutes of wall for little signal (this is distinct from, and in addition to, the "release once at the very end" rule — that one only bans extra build+release cycles, not dev-server testing). Only spin up a dev server and smoke-test when the user's prompt explicitly asks to verify / test / confirm it works — and then keep it to a single lightweight pass (pages compile and render), not a full purchase/booking/login drive. The one post-release check in <TYPE_DIR>/DEPLOYMENT.md is the sanctioned verification.

Donations exception to the smoke-test policy above: for a build that accepts donations, follow the bounded anonymous API handoff check in references/inline-recipes/how-to-code-donations.md before claiming it works. It does not authorize a payment or campaign mutation, and does not require a dev-server testing loop. That recipe also defines the separate hosted-checkout and payment checks.

Path resolution

Compute <SKILL_ROOT> from this file (<SKILL_ROOT>/SKILL.md — strip /SKILL.md); hold the absolute path in scratch. Then resolve the project type to its folder and hold it too:

<TYPE_DIR> = <SKILL_ROOT>/references/<projectType>/ — one of managed/, self-managed/, stripe/.

WhatPath
Vertical index (intent matching + per-vertical site spec)<SKILL_ROOT>/references/CAPABILITIES.md
Discovery (infer capabilities + brand + intent; existing site → the Dynamic Context call in §1)<SKILL_ROOT>/references/DISCOVERY.md
Setup (install apps)<SKILL_ROOT>/references/SETUP.md
Seed (create backend content)<SKILL_ROOT>/references/SEED.md
SDK-integration handoff (emitted, or applied by create/connect)<SKILL_ROOT>/references/SDK_HANDOFF.md
Image generation (opt-in; agnostic)<SKILL_ROOT>/references/IMAGE_GENERATION.md
Design — fallback visual quality bar for the built frontend, when the user gave no design direction of their own (managed create only)<SKILL_ROOT>/references/DESIGN.md
Content — fallback copy quality bar for the built frontend, when the user gave no copy/voice direction of their own (managed create only)<SKILL_ROOT>/references/CONTENT.md
Experience overlays — a vertical's own design + copy bar on top of DESIGN/CONTENT (optional per vertical; read when that vertical is loaded)<SKILL_ROOT>/references/inline-recipes/experience-<vertical>.md (today: experience-store.md, experience-donations.md)
AI features — text/chat + embeddings (opt-in; agnostic)<SKILL_ROOT>/references/AI_FEATURES.md
Feedback — relay the user's headless-experience feedback to Wix (opt-in; user-approved)<SKILL_ROOT>/references/FEEDBACK.md
Authentication — obtain $TOKEN/$SITE_ID/clientId (project-type-specific)<TYPE_DIR>/AUTHENTICATION.md
Deployment — finalize the live site (project-type-specific)<TYPE_DIR>/DEPLOYMENT.md
Managed create flow (scaffold a new project)<SKILL_ROOT>/references/managed/CREATE.md
Managed connect flow (wire an existing project)<SKILL_ROOT>/references/managed/CONNECT.md
Frontend-axis references (how a frontend wires to Wix)<SKILL_ROOT>/references/astro.md, non-astro.md

Start a run by opening DISCOVERY.md. The flow files (CAPABILITIES, DISCOVERY, SETUP, SEED, SDK_HANDOFF, IMAGE_GENERATION, AI_FEATURES) are project-type-agnostic; the per-type specifics live under <TYPE_DIR>/ (AUTHENTICATION.md, DEPLOYMENT.md, and — managed only — CREATE.md/CONNECT.md).

Where the how comes from

This skill has no skill upstream — the how is read from the live Wix docs at dev.wix.com/docs. Read-priority: a page this skill links is read by curl-ing its .md twin directly (first priority — don't re-discover a curated link with search); the Wix MCP doc/search tools are second priority, for finding pages the skill doesn't link or as a fallback if a fetch fails. (Append .md to any docs URL for raw markdown; menu pages list child links, content pages carry the schema.)

Doc discovery is the shared fallback for both tracks — never the first move. Each track's primary source is its pinned material (below); when that doesn't cover what you need, fall back to references/DOC_DISCOVERY.md — a semantic doc-search + schema lookup that works with or without the Wix MCP.

  • Seed reads each capability's create flow from its inline recipe — a self-contained local inline-recipes/setup-*.md (mapped per capability in SEED.md § "What to seed per capability") that inlines the calls and supersedes the REST doc pages, so read it and seed from it alone. Only a capability with no inline recipe (e.g. coupons) falls back to doc discovery (DOC_DISCOVERY.md).

  • Handoff links the SDK docs for each capability's API shape, and supplies the runtime package set from the inlined map in SDK_HANDOFF.md (the SDK .md pages don't expose @wix/* import strings to navigation, so packages are mapped, not navigated).

Setup carries its app-install call (and the appDefId constants) inline in SETUP.md; CAPABILITIES.md is the vertical index that lets Discovery match intent and declares, per built vertical, the Required site features + Implementation checklist that Seed enables (backend-backed features) and the Handoff carries into the guide (so the host builds a complete site, not a bare data dump). This skill carries the what (which capabilities, how much content, what a finished site includes) and reads the how off the docs.

Files

references/inline-recipes/setup-cms.md


name: "Setup CMS" description: Initializes a Wix CMS (Wix Data) backend — creates each collection with a public-read permissions block and the field schema, then bulk-inserts items (real field values) and verifies they persisted; wires multi-reference links when collections relate. Specifies the how (calls + format); which collections, fields, and counts come from the request.

RECIPE: Business Recipe – Initial Setup for Wix CMS (Wix Data v2)

Standard call shape (every curl below). The <AUTH> placeholder is shorthand for Authorization: Bearer <TOKEN> only. Body-bearing requests also need Content-Type: application/json.

A concise checklist for preparing any new Wix site that uses the Wix CMS (Wix Data) to hold content collections (team directory, FAQ, portfolio items, resources, recipes — any repeated structured content). Notice this recipe is for initial backend setup ONLY, not for coding the frontend.

This recipe is the how, not the what. Which collections to create, their fields, and how many items each holds is determined by the request you're fulfilling. This recipe only specifies the calls and the request format; it does not decide the schema or quantities.

API surfaces: Wix CMS uses the Wix Data v2 API on https://www.wixapis.com/wix-data/v2/... — collections under /collections, items under /items and /bulk/items/*. The CMS (Wix Data) app's appDefId is e593b0bd-b783-45b8-97c2-873d42aacaf4 (an unmet WDE0110 error means the app isn't installed). There is no V1/V3 split here — everything is /wix-data/v2/.


Article: Steps for Setting Up Wix CMS

YOU MUST complete the steps in order, without requiring additional user input: create each collection (STEP 1) before inserting its items (STEP 2), and verify (STEP 3) before wiring any references (STEP 4). Items can only be inserted into a collection that already exists. The Attach images step runs only when imagery is on — skip it entirely otherwise.

STEP 1: Create each collection (public-read)

Create one collection per entry the request names. How many collections, their id/displayName, and their field schema come from the request you're fulfilling — this step only gives the call and the required format.

Use the Create Data Collection endpoint: POST https://www.wixapis.com/wix-data/v2/collections.

{
  "collection": {
    "id": "team-members",
    "displayName": "Team Members",
    "fields": [
      { "key": "name",  "displayName": "Name",  "type": "TEXT" },
      { "key": "role",  "displayName": "Role",  "type": "TEXT" },
      { "key": "bio",   "displayName": "Bio",   "type": "RICH_TEXT" },
      { "key": "order", "displayName": "Order", "type": "NUMBER" }
    ],
    "permissions": {
      "insert": "ADMIN",
      "update": "ADMIN",
      "remove": "ADMIN",
      "read":   "ANYONE"
    }
  }
}

The response returns the created collection — its id is the value you sent (Wix does not rename it). Keep that id and the exact field keys; the items step and the frontend both bind by them.

⚠️ CRITICAL: the permissions block is mandatory, and for a PUBLIC collection read MUST be "ANYONE". A headless frontend reads with an anonymous visitor token and cannot elevate (a pure SPA/static site has no server; even on Astro the read path is visitor-scoped). If a public collection's read is anything but ANYONE, the visitor query returns zero items with no error — the page looks empty and it reads like a query bug when it's really a permissions bug. So default to read: "ANYONE". The one exception is a deliberately member-scoped collection (opt-in, members login in the run) — see "Member-scoped collections" below, where read is SITE_MEMBER/SITE_MEMBER_AUTHOR on purpose and an anonymous empty read is the gate, not a bug. Omitting the whole permissions object fails the create either way.

⚠️ Write permissions: ADMIN by default; open them ONLY for a collection the site lets visitors write. Most collections hold admin-owned content (the catalog, the team, the articles) — visitors only read them, so keep insert/update/remove at "ADMIN" (only this seed token writes; a visitor write to an ADMIN collection 403s). But when the request models visitor-written, shared data — a guestbook, a community board, a collaborative list anyone can add to and edit — that collection must be visitor-writable, so set the verbs the site uses to "ANYONE":

"permissions": { "read": "ANYONE", "insert": "ANYONE", "update": "ANYONE", "remove": "ANYONE" }

Which collection (if any) is visitor-writable comes from the request; this step only gives the permission shape.

⚠️ With an ANONYMOUS visitor token there is NO per-user identity — an ANYONE-writable collection is SHARED and unscoped. Every anonymous visitor authenticates as the same kind of identity, so on the anonymous path the only open-write level that works is ANYONE, which means any visitor can edit or delete any row (the data is global/shared, not per-user, not per-device). That's correct for a collaborative board. For per-user-private data, use the member-scoped variant below — it needs a logged-in member. Don't open insert/update/remove to ANYONE on a collection that shouldn't be globally editable.

Member-scoped collections (opt-in — only when the run includes members login)

Only create these when the request calls for per-user or member-only data AND members login is part of the run (an account area, "my saved items", "members-only content"). Otherwise stay with the public-read / collaborative shapes above — this is not a default. A member-scoped collection needs a logged-in member; it runs on the member token (the identity layer — login, no Members Area app install, no auth.elevate), and the platform enforces the scoping server-side from the caller's member identity. The role vocabulary the permissions block accepts, highest-to-lowest: ADMIN › SITE_MEMBER_AUTHOR › SITE_MEMBER › ANYONE. Two member shapes:

// Per-user-private ("my …" data — each member sees/edits only their OWN rows, scoped by the item's _owner)
"permissions": { "read": "SITE_MEMBER_AUTHOR", "insert": "SITE_MEMBER", "update": "SITE_MEMBER_AUTHOR", "remove": "SITE_MEMBER_AUTHOR" }

// Shared member-only (any logged-in member reads; only the seed/admin writes — gated content)
"permissions": { "read": "SITE_MEMBER", "insert": "ADMIN", "update": "ADMIN", "remove": "ADMIN" }
  • SITE_MEMBER_AUTHOR = a signed-in member, restricted to items they created (the platform matches the item's _owner to the caller). insert is SITE_MEMBER (a member can create — the insert stamps them as owner; don't set _owner yourself), while read/update/remove are SITE_MEMBER_AUTHOR so each member touches only their own rows. This is the clean solution to per-user-private data — no server code, no elevation, works on a pure SPA, because the member token carries the identity the visitor token lacked.

  • SITE_MEMBER = any signed-in member (not owner-scoped) — use for content every member may read but only the site writes.

  • An anonymous visitor reading a member-scoped collection gets ZERO items — that is the gate working, not the empty-page bug above. Only treat an empty read as a seed defect on an ANYONE-read collection; on a SITE_MEMBER* collection an empty anonymous read is expected (the frontend must gate it behind login — see how-to-code-cms.md). Seeding items into a SITE_MEMBER_AUTHOR collection with the admin/seed token makes their _owner the admin, so no member will see them — seed such a collection empty (members populate it themselves) unless the brief wants admin-owned member-readable rows (then use the shared SITE_MEMBER shape).

⚠️ CRITICAL: collection id has NO namespace. A user-created (NATIVE) collection's id is just the name you choose ("team-members", "faq", "Projects") — the <namespace>/<name> form (Members/PublicData) is only for Wix App collections. Use the exact id you set here everywhere downstream; the dashboard display name may differ from the id, so never guess it — keep the one you sent.

Field types (set type per field): TEXT, NUMBER, BOOLEAN, DATE, DATETIME, URL, EMAIL, IMAGE, RICH_TEXT / RICH_CONTENT (Ricos), ARRAY_STRING, OBJECT, REFERENCE (single), MULTI_REFERENCE. Use RICH_TEXT/RICH_CONTENT for formatted body copy and TEXT for plain strings. A RICH_TEXT field accepts an HTML string ("<p>…</p>") at insert — it is stored verbatim, not coerced.

⚠️ CRITICAL: a MULTI_REFERENCE (or single REFERENCE) field needs a typeMetadata binding, and the key is referencedCollectionId — NOT referencedCollection. A reference field declared with only { "type": "MULTI_REFERENCE" } (no metadata) creates a field whose target is empty, and every later reference wiring (STEP 4) reports success but never resolves — the links are silently dead. The binding lives under typeMetadata.multiReference:

{
  "key": "categories",
  "displayName": "Categories",
  "type": "MULTI_REFERENCE",
  "typeMetadata": {
    "multiReference": {
      "referencedCollectionId": "recipe-categories",
      "referencingFieldKey": "recipes",
      "referencingDisplayName": "Recipes"
    }
  }
}

referencedCollectionId is the target collection's id (so that collection must be created first — order your STEP 1 creates accordingly); referencingFieldKey/referencingDisplayName name the auto-created back-reference on the target. Beware: the official Create-Data-Collection docs example uses referencedCollection — the API accepts that payload with 200 but silently stores an empty referencedCollectionId, leaving a broken field. Use referencedCollectionId. (A single REFERENCE field uses typeMetadata.reference.referencedCollectionId likewise.)

⚠️ A fresh site's Wix Data backend can fail the FIRST few calls transiently while it propagates — retry the failed call ONCE, then proceed. On a brand-new site the data backend may not be fully provisioned for the opening calls, surfacing as either of two same-root-cause errors that self-heal within a few seconds:

  • 403 on collection-create (STEP 1), or

  • 400 WDE0117: "MetaSite not found" on a bulk item-insert (STEP 2).

Both are provisioning races, not payload bugs (the identical body succeeds on retry). On a 403 / 400 WDE0117 / 5xx for any create or insert, wait briefly and retry the failed call once with the same body. Do not loop — a spiralling retry is a wasted headless run. If the single retry still fails, surface the response verbatim and fail loud.

STEP 2: Bulk-insert each collection's items (with field data)

Populate each collection in a single bulk call per collection. How many items and their content come from the request you're fulfilling — this step only gives the call and the required format.

Use Bulk Insert Data Items: POST https://www.wixapis.com/wix-data/v2/bulk/items/insert (one call per collection; dataCollectionId is single-valued, so fire one bulk call per collection — these can run in parallel across collections). For a collection with a single item, the single-insert endpoint POST /wix-data/v2/items (body { "dataCollectionId": "...", "dataItem": { "data": {...} } }) is equivalent.

{
  "dataCollectionId": "team-members",
  "dataItems": [
    { "data": { "name": "Ada Lovelace", "role": "Founder", "bio": "<p>Builds the things.</p>", "order": 1 } },
    { "data": { "name": "Alan Turing",  "role": "Engineer", "bio": "<p>Breaks the things.</p>", "order": 2 } }
  ],
  "returnEntity": true
}

⚠️ CRITICAL: every field goes inside data, with real values — an empty data: {} creates an empty record. The collection schema existing is not the same as the item having content. Populate every field the page will render (name, role, bio, …) in the data object. An item inserted with missing fields ships a "content coming soon"–looking blank on the live page, and the API accepts it without error — the failure is invisible until STEP 3.

⚠️ CRITICAL: the data keys MUST match the collection's field keys exactly. A key the schema doesn't have is silently dropped (or rejected as a validation error); a mismatched case/spelling reads back as a missing field. Use the exact keys from STEP 1.

⚠️ CRITICAL: do NOT set a MULTI_REFERENCE value at insert — it is SILENTLY DROPPED (no error). Putting a categories: ["<id>"] array in data does not raise an error (it does not throw WDE0303 on the bulk endpoint) — the insert returns 200 success, but the multi-reference value is silently discarded (absent from the stored item). So a multi-reference left in data looks like it worked and isn't there. Insert the items first with plain fields only, then wire multi-references in STEP 4. A single REFERENCE field can be set at insert by passing the referenced item's _id string as the field value ("venue": "<referenced-item-id>").

⚠️ Reading the response — created items are under results[].dataItem, NOT results[].item. A successful bulk insert returns the standard Wix bulk shape (note the per-item wrapper is dataItem, not item):

{ "results": [
    { "action": "INSERT",
      "itemMetadata": { "id": "<itemId>", "originalIndex": 0, "success": true },
      "dataItem": { "id": "<itemId>", "dataCollectionId": "team-members",
                    "data": { "_id": "<itemId>", "name": "Ada Lovelace", "role": "Founder", "_createdDate": { "$date": "..." } } } }
  ],
  "bulkActionMetadata": { "totalSuccesses": 2, "totalFailures": 0 }
}

(The single-insert endpoint returns the same wrapper for one item: { "dataItem": { "id": "<itemId>", "data": { "_id": "<itemId>", ... } } }.) The item id is the wrapper's top-level id (mirrored as data._id) — read it from results[].dataItem.id (bulk) or dataItem.id (single). There is no results[].item key — reading it finds nothing and makes a successful insert look empty. If part of the bulk request fails (bulkActionMetadata.totalFailures > 0), retry the failed items once with the same format; do not loop.

STEP 3: Verify the inserts (mandatory)

A POST without an error does not prove the content persisted. After inserting, query each collection once and confirm every field you sent is present in the stored items.

Use Query Data Items: POST https://www.wixapis.com/wix-data/v2/items/query with body { "dataCollectionId": "<collection>" }. For every returned item, confirm its data carries every field you POSTed. If a field is missing, re-insert that item once (DELETE then insert is safest — a PUT replaces the whole record) and re-verify; if it still fails, surface the missing-field error verbatim rather than reporting success.

STEP 4: Wire multi-references (only if collections relate)

Skip this step unless the request models a relationship (e.g. a project → its team members, an article → its tags) as a MULTI_REFERENCE field. Single REFERENCE fields were already set in STEP 2.

Use Bulk Insert Reference Data Items: POST https://www.wixapis.com/wix-data/v2/bulk/items/insert-references — link a referring item's multi-reference field to one or more referenced item ids. (/items/replace-references replaces the whole set; /bulk/items/remove-references unlinks.) Both ids come from the STEP 2 responses.

⚠️ CRITICAL: the body key is dataItemReferences, and each entry uses referringItemFieldName / referringItemId / referencedItemId. The natural-looking shape (references: [{ referencingItemId, referencedItemId }] + a top-level referenceProperty) is rejected with 400 WDE0080 "dataItemReferences must not be empty". Use exactly:

{
  "dataCollectionId": "recipes",
  "dataItemReferences": [
    { "referringItemFieldName": "categories", "referringItemId": "<recipeId>", "referencedItemId": "<categoryId>" }
  ]
}

referringItemFieldName is the multi-reference field's key on the referring collection (recipes.categories); referringItemId is that item's id; referencedItemId is the target item's id.

⚠️ References only resolve if the field was created with a non-empty referencedCollectionId (STEP 1). This call can return 200 / totalSuccesses even when the field's target binding is empty — but then a read with .include("categories") (or query-referenced) returns nothing (and query-referenced errors WDE0020 "Provided property [] is not a multi-reference field"). If references insert "successfully" but never appear on reads, the field's referencedCollectionId was empty at create time — fix the STEP 1 field definition, not this call.

Attach images (imagery ON only — skip otherwise)

Only when imagery is on (SEED.md § "Entity images"). This is the CMS entry in the required pass-2 "attach the generated image to the entity" flow — items were inserted text-only earlier (any IMAGE field left blank); now write the image onto each. It presumes the collection has an IMAGE-type field (from the field schema at create time). Generate + import per references/IMAGE_GENERATION.md and keep file.url (the permanent wixstatic.com URL — an IMAGE field stores the URL string).

⚠️ Use read-merge-PUT, not PATCH. A partial JsonPatch is fragile here; instead query the item, merge the image URL into its data, and PUT the whole record back:

  1. Read the item — POST https://www.wixapis.com/wix-data/v2/items/query with { "dataCollectionId": "<collection>" } (or filter to the one item). Keep its full data (including _id).

  2. Merge the image URL into the item's image field key (e.g. data.photo = "<file.url>"), leaving every other field intact.

  3. PUT the whole record — PUT https://www.wixapis.com/wix-data/v2/items/<itemId>:

{ "dataCollectionId": "<collection>", "dataItem": { "data": { "_id": "<itemId>", "name": "…", "role": "…", "photo": "<file.url>" } } }
  • PUT replaces the entire record — you must send back all existing fields (from step 1), not just the image, or the omitted fields are wiped. This is why you read-merge-PUT rather than sending the image alone.

  • Never block on image failure (SEED.md § "Entity images" / IMAGE_GENERATION "Credits, cost & the not-generating fallback") — on failure, skip and leave the item text-only.


Conclusion

Following these steps in order sets up a Wix CMS backend:

  • Every collection is created with a permissions block whose read is ANYONE, so the headless visitor frontend can read it (the single most common "empty page" cause).

  • Write verbs are ADMIN by default (visitor reads only); a collection the site lets visitors write is created with insert/update/remove at ANYONE (the only open-write level the anonymous visitor token supports — the data is then global/shared, with no per-user scoping).

  • (Opt-in, members only) a per-user-private or member-only collection is created with a member-scoped permissions block — SITE_MEMBER_AUTHOR (own rows only, _owner-matched) or SITE_MEMBER (any logged-in member) — which runs on the member token (login/identity layer, no Members Area install, no elevate). This is the per-user scoping the anonymous path can't do; add it only when the brief asks and members login is in the run, and expect anonymous reads to return empty (the gate).

  • Native collection ids carry no namespace and are kept verbatim for the frontend to bind to.

  • Every item is bulk-inserted with real field values in data (keys matching the schema) and verified to have persisted.

  • Reference fields are created with a non-empty typeMetadata…referencedCollectionId (the working key, not the docs' stale referencedCollection); multi-references are then wired with the reference endpoint's dataItemReferences[] shape (never set at insert — they're silently dropped there), and single references by item-id at insert.

  • When imagery is on, each item's IMAGE field is filled by the Attach images step (pass-2) via read-merge-PUT (PUT …/items/{id} with the full merged record — a partial PUT wipes omitted fields), storing file.url; on failure the item stays text-only.

  • Keep per collection: the collectionId, the field keys, and the itemIds[] — these are the producer for the coding handoff.

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

Needs: Needs Node.js

Security

What our scanner noticed· Low risk

  • Scripts that your agent may run

This skill includes scripts that your agent may run. Read them before you use it.

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Published by
Wix
Publisher
Wix (Official)
Source
wix/skills · skills/wix-headless · commit d168bc2
Licence
MIT License (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by Wix or Wix.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download wix-headless.zip