@wix/agent-skills 1.5.0 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (156) hide show
  1. package/README.md +2 -2
  2. package/package.json +1 -1
  3. package/skills/wix-app/SKILL.md +49 -42
  4. package/skills/wix-app/references/BACKEND_EVENT.md +10 -65
  5. package/skills/wix-app/references/CUSTOM_ELEMENT_WIDGET.md +101 -406
  6. package/skills/wix-app/references/DASHBOARD_MENU_PLUGIN.md +14 -111
  7. package/skills/wix-app/references/DASHBOARD_MODAL.md +56 -205
  8. package/skills/wix-app/references/DASHBOARD_PAGE.md +19 -98
  9. package/skills/wix-app/references/DASHBOARD_PLUGIN.md +6 -108
  10. package/skills/wix-app/references/DATA_COLLECTION.md +113 -198
  11. package/skills/wix-app/references/EDITOR_REACT_COMPONENT.md +15 -1
  12. package/skills/wix-app/references/EMBEDDED_SCRIPT.md +41 -268
  13. package/skills/wix-app/references/EXTENSION_REGISTRATION.md +27 -76
  14. package/skills/wix-app/references/SERVICE_PLUGIN.md +35 -188
  15. package/skills/wix-app/references/SITE_PLUGIN.md +8 -92
  16. package/skills/wix-app/references/backend-event/COMMON-EVENTS.md +0 -44
  17. package/skills/wix-app/references/custom-element-widget/SETTINGS_PANEL.md +19 -330
  18. package/skills/wix-app/references/dashboard-menu-plugin/bookings-slots.md +0 -12
  19. package/skills/wix-app/references/dashboard-menu-plugin/ecommerce-slots.md +7 -0
  20. package/skills/wix-app/references/dashboard-menu-plugin/restaurants-slots.md +0 -12
  21. package/skills/wix-app/references/dashboard-plugin/SLOTS.md +3 -15
  22. package/skills/wix-app/references/data-collection/WIX_DATA.md +1 -1
  23. package/skills/wix-app/references/editor-react-component/COMPONENT-API.md +1 -1
  24. package/skills/wix-app/references/service-plugin/ADDITIONAL-FEES.md +2 -18
  25. package/skills/wix-app/references/service-plugin/BOOKINGS-STAFF-SORTING.md +2 -42
  26. package/skills/wix-app/references/service-plugin/DISCOUNT-TRIGGERS.md +1 -11
  27. package/skills/wix-app/references/service-plugin/GIFT-CARDS.md +1 -11
  28. package/skills/wix-app/references/service-plugin/PAYMENT-SETTINGS.md +2 -40
  29. package/skills/wix-app/references/service-plugin/SHIPPING-RATES.md +2 -19
  30. package/skills/wix-app/references/service-plugin/VALIDATIONS.md +2 -18
  31. package/skills/wix-app/references/site-plugin/SLOTS.md +17 -68
  32. package/skills/wix-headless/SKILL.md +112 -368
  33. package/skills/wix-headless/references/BUILD.md +307 -0
  34. package/skills/wix-headless/references/DESIGN_SYSTEM.md +115 -0
  35. package/skills/wix-headless/references/DISCOVERY.md +237 -112
  36. package/skills/wix-headless/references/PLAN.md +82 -0
  37. package/skills/wix-headless/references/SEED.md +205 -0
  38. package/skills/wix-headless/references/SETUP.md +250 -94
  39. package/skills/wix-headless/references/astro/COMPOSE.md +142 -0
  40. package/skills/wix-headless/references/{blog → astro/blog}/BLOG_PAGES.md +1 -1
  41. package/skills/wix-headless/references/{blog → astro/blog}/BLOG_SETUP.md +2 -2
  42. package/skills/wix-headless/references/astro/cms/CMS_FOUNDATIONS.md +214 -0
  43. package/skills/wix-headless/references/{cms → astro/cms}/FAQ_KNOWLEDGE_BASE.md +6 -4
  44. package/skills/wix-headless/references/{cms → astro/cms}/PORTFOLIO.md +5 -5
  45. package/skills/wix-headless/references/{cms → astro/cms}/RESOURCE_LIBRARY.md +5 -5
  46. package/skills/wix-headless/references/{cms → astro/cms}/TEAM_DIRECTORY.md +5 -5
  47. package/skills/wix-headless/references/astro/designer/INSTRUCTIONS.md +331 -0
  48. package/skills/wix-headless/references/{ecom → astro/ecom}/CART_PAGES.md +1 -1
  49. package/skills/wix-headless/references/{ecom → astro/ecom}/CART_WIRING.md +1 -1
  50. package/skills/wix-headless/references/{ecom → astro/ecom}/COMPONENTS_CSS.md +3 -3
  51. package/skills/wix-headless/references/{forms → astro/forms}/CONTACT_FORM.md +13 -13
  52. package/skills/wix-headless/references/{gift-cards → astro/gift-cards}/COMPONENTS.md +1 -1
  53. package/skills/wix-headless/references/{gift-cards → astro/gift-cards}/PAGES.md +1 -1
  54. package/skills/wix-headless/references/{stores → astro/stores}/BACK_IN_STOCK.md +1 -1
  55. package/skills/wix-headless/references/{stores → astro/stores}/CATEGORY_PAGES.md +12 -13
  56. package/skills/wix-headless/references/{stores → astro/stores}/COMPONENTS_CSS.md +4 -4
  57. package/skills/wix-headless/references/{stores → astro/stores}/HOME_AND_NAV.md +11 -9
  58. package/skills/wix-headless/references/{stores → astro/stores}/PRODUCT_PAGES.md +5 -3
  59. package/skills/wix-headless/references/{stores → astro/stores}/SHARED_WIRING.md +3 -3
  60. package/skills/wix-headless/references/astro/templates/Footer.astro +27 -0
  61. package/skills/wix-headless/references/astro/templates/Layout.astro +132 -0
  62. package/skills/wix-headless/references/astro/templates/Navigation.astro +38 -0
  63. package/skills/wix-headless/references/astro/templates/astro.config.mjs +41 -0
  64. package/skills/wix-headless/references/astro/templates/ecom/components-ecom.css +302 -0
  65. package/skills/wix-headless/references/astro/templates/global.css +286 -0
  66. package/skills/wix-headless/references/astro/templates/index.astro +56 -0
  67. package/skills/wix-headless/{templates → references/astro/templates}/stores/back-in-stock.ts +1 -1
  68. package/skills/wix-headless/{templates → references/astro/templates}/stores/components-stores.css +138 -33
  69. package/skills/wix-headless/references/blog/BLOG_CONTENT.md +10 -11
  70. package/skills/wix-headless/references/blog/INSTRUCTIONS.md +5 -5
  71. package/skills/wix-headless/references/cms/CMS_FOUNDATIONS.md +31 -230
  72. package/skills/wix-headless/references/cms/INSTRUCTIONS.md +13 -8
  73. package/skills/wix-headless/references/custom/INSTRUCTIONS.md +38 -0
  74. package/skills/wix-headless/references/ecom/INSTRUCTIONS.md +10 -10
  75. package/skills/wix-headless/references/forms/INSTRUCTIONS.md +5 -5
  76. package/skills/wix-headless/references/gift-cards/INSTRUCTIONS.md +11 -11
  77. package/skills/wix-headless/references/images/INSTRUCTIONS.md +47 -50
  78. package/skills/wix-headless/references/seed-recipes.md +49 -0
  79. package/skills/wix-headless/references/shared/AUTHENTICATION.md +110 -0
  80. package/skills/wix-headless/references/shared/BUILD_NOISE.md +2 -2
  81. package/skills/wix-headless/references/shared/DOCS_SEARCH.md +41 -0
  82. package/skills/wix-headless/references/shared/IMAGE_GENERATION.md +17 -17
  83. package/skills/wix-headless/references/shared/IMPLEMENTER.md +20 -29
  84. package/skills/wix-headless/references/shared/PRODUCTION_SHARP_EDGES.md +1 -1
  85. package/skills/wix-headless/references/shared/RETURN_CONTRACT.md +25 -16
  86. package/skills/wix-headless/references/shared/STYLING.md +47 -10
  87. package/skills/wix-headless/references/stores/INSTRUCTIONS.md +25 -25
  88. package/skills/wix-headless/references/stores/PRODUCT_CATALOG_DATA.md +17 -17
  89. package/skills/wix-headless/references/verticals/_schema.json +31 -117
  90. package/skills/wix-headless/references/verticals/_schema.md +60 -150
  91. package/skills/wix-headless/references/verticals/blog.md +5 -99
  92. package/skills/wix-headless/references/verticals/cms.md +9 -100
  93. package/skills/wix-headless/references/verticals/ecom.md +5 -76
  94. package/skills/wix-headless/references/verticals/forms.md +5 -85
  95. package/skills/wix-headless/references/verticals/gift-cards.md +6 -103
  96. package/skills/wix-headless/references/verticals/stores.md +10 -144
  97. package/skills/wix-headless/scripts/check-manifest.mjs +5 -5
  98. package/skills/wix-headless/scripts/emit-design-tokens.mjs +29 -23
  99. package/skills/wix-headless/scripts/init-site-json.mjs +59 -21
  100. package/skills/wix-headless/scripts/patch-decorative-slots.mjs +67 -43
  101. package/skills/wix-headless/scripts/plan-entity-image-waves.mjs +3 -3
  102. package/skills/wix-headless/scripts/preview.sh +3 -3
  103. package/skills/wix-headless/scripts/release.sh +4 -4
  104. package/skills/wix-headless/scripts/scaffold.sh +75 -20
  105. package/skills/wix-headless/scripts/seed-utilities.sh +50 -12
  106. package/skills/wix-manage/SKILL.md +4 -8
  107. package/skills/wix-manage/references/blog/how-to-create-blog-posts.md +70 -1
  108. package/skills/wix-manage/references/cms/cms-data-items-crud.md +4 -0
  109. package/skills/wix-manage/references/cms/cms-references-and-relationships.md +2 -0
  110. package/skills/wix-manage/references/cms/cms-schema-management.md +4 -0
  111. package/skills/wix-manage/references/ecommerce/api-shipping.md +443 -0
  112. package/skills/wix-manage/references/ecommerce/flow-add-free-shipping.md +5 -6
  113. package/skills/wix-manage/references/ecommerce/flow-fix-coverage-gaps.md +4 -5
  114. package/skills/wix-manage/references/ecommerce/flow-optimize-shipping-rates.md +4 -5
  115. package/skills/wix-manage/references/ecommerce/goal-increase-aov.md +1 -1
  116. package/skills/wix-manage/references/ecommerce/goal-reduce-cart-abandonment.md +1 -2
  117. package/skills/wix-manage/references/ecommerce/guardrail-shipping-health.md +2 -2
  118. package/skills/wix-manage/references/ecommerce/recipe-apply-shipping-recommendations.md +4 -5
  119. package/skills/wix-manage/references/ecommerce/recommend-ecommerce-strategy.md +7 -7
  120. package/skills/wix-manage/references/ecommerce/setup-discount-rules.md +209 -72
  121. package/skills/wix-manage/references/ecommerce/setup-store-pickup-location.md +9 -10
  122. package/skills/wix-manage/references/ecommerce/skill-graph.md +4 -4
  123. package/skills/wix-manage/references/forms/create-form.md +2 -0
  124. package/skills/wix-manage/references/stores/bulk-create-products-with-options.md +2 -0
  125. package/skills/wix-manage/references/stores/create-product-from-image.md +91 -38
  126. package/skills/wix-manage/references/stores/setup-online-store-catalog-v3.md +14 -7
  127. package/skills/wix-app/references/data-collection/extension-template.ts +0 -107
  128. package/skills/wix-headless/references/ORCHESTRATION.md +0 -269
  129. package/skills/wix-headless/references/commands/install-app.md +0 -42
  130. package/skills/wix-headless/references/commands/mcp-bootstrap.md +0 -28
  131. package/skills/wix-headless/references/designer/INSTRUCTIONS.md +0 -828
  132. package/skills/wix-headless/references/shared/MCP_PREFIX.md +0 -105
  133. package/skills/wix-headless/scripts/copy-utility-templates.mjs +0 -153
  134. package/skills/wix-headless/templates/ecom/components-ecom.css +0 -215
  135. package/skills/wix-manage/references/events/list-events.md +0 -203
  136. /package/skills/wix-headless/{templates → references/astro/templates}/ecom/CartBadge.tsx +0 -0
  137. /package/skills/wix-headless/{templates → references/astro/templates}/ecom/CartView.tsx +0 -0
  138. /package/skills/wix-headless/{templates → references/astro/templates}/ecom/cart.astro +0 -0
  139. /package/skills/wix-headless/{templates → references/astro/templates}/ecom/discounts.ts +0 -0
  140. /package/skills/wix-headless/{templates → references/astro/templates}/ecom/thank-you.astro +0 -0
  141. /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/GiftCardPurchase.tsx +0 -0
  142. /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/_home-teaser-snippet.astro +0 -0
  143. /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/_nav-snippet.astro +0 -0
  144. /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/components-gift-cards.css +0 -0
  145. /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/gift-cards.astro +0 -0
  146. /package/skills/wix-headless/{templates → references/astro/templates}/gift-cards/gift-cards.ts +0 -0
  147. /package/skills/wix-headless/{templates → references/astro/templates}/stores/AddToCartButton.tsx +0 -0
  148. /package/skills/wix-headless/{templates → references/astro/templates}/stores/BackInStockForm.tsx +0 -0
  149. /package/skills/wix-headless/{templates → references/astro/templates}/stores/CategoryRail.astro +0 -0
  150. /package/skills/wix-headless/{templates → references/astro/templates}/stores/ProductCard.astro +0 -0
  151. /package/skills/wix-headless/{templates → references/astro/templates}/stores/ProductPurchase.tsx +0 -0
  152. /package/skills/wix-headless/{templates → references/astro/templates}/stores/SeoTags.astro +0 -0
  153. /package/skills/wix-headless/{templates → references/astro/templates}/stores/categories.ts +0 -0
  154. /package/skills/wix-headless/{templates → references/astro/templates}/stores/category/[slug].astro +0 -0
  155. /package/skills/wix-headless/{templates → references/astro/templates}/stores/products/[slug].astro +0 -0
  156. /package/skills/wix-headless/{templates → references/astro/templates}/stores/products/index.astro +0 -0
@@ -1,21 +1,30 @@
1
1
  #!/usr/bin/env bash
2
- # Copy the skill's shared utilities into the project's src/utils/ and strip the
3
- # Astro starter cruft that ships with the blank template.
2
+ # Frontend-track project prep: copy the skill's shared utilities into the
3
+ # project's src/utils/ and strip the Astro starter cruft that ships with the
4
+ # blank template. This is local-project (frontend) work, not backend seeding —
5
+ # the orchestrator only runs it in scaffold mode (integrate mode has no
6
+ # skill-written frontend to prep, so it is never invoked there).
4
7
  #
5
8
  # Usage (both modes work):
6
- # bash <SKILL_ROOT>/scripts/seed-utilities.sh # installed tgz
7
- # bash <(curl -s https://dev.wix.com/skills/wix-headless/scripts/seed-utilities.sh)
9
+ # bash <SKILL_ROOT>/scripts/seed-utilities.sh --template astro
10
+ # bash <(curl -s https://dev.wix.com/skills/wix-headless/scripts/seed-utilities.sh) --template astro
8
11
  #
9
- # Run from the project directory (CWD = <project>/). The script auto-detects
12
+ # --template (optional, default astro): astro
13
+ # Astro is the only frontend the skill scaffolds and preps, so the value is
14
+ # always "astro". Custom (non-astro) frontends route to the not-available stub
15
+ # (references/custom/INSTRUCTIONS.md) and never reach this script.
16
+ #
17
+ # Run from the project directory (CWD = <scaffold>/). The script auto-detects
10
18
  # whether shared-utilities is available on disk (tgz install) and falls back
11
19
  # to fetching from the well-known URL when streamed via process substitution
12
20
  # (BASH_SOURCE is /dev/fd/N, so the on-disk lookup naturally falls through).
13
21
  #
14
22
  # Behavior:
15
- # - Copies the three shared utility files into src/utils/ — never overwrites
16
- # an existing file (users can drop in their own version to override).
17
- # - Removes Astro starter cruft (Welcome.astro + marketing SVGs) that ships
18
- # with the blank template but is never imported by the build skill.
23
+ # - Copies the three shared utility files into src/utils/ for both templates —
24
+ # never overwrites an existing file (users can drop in their own version).
25
+ # - On --template=astro, removes Astro starter cruft (Welcome.astro + marketing
26
+ # SVGs) that ships with the blank template but is never imported by the build
27
+ # skill.
19
28
  #
20
29
  # Shared utilities copied:
21
30
  # - wix-image.ts — media URL resolver (used by stores, blog, cms)
@@ -27,6 +36,33 @@ set -euo pipefail
27
36
  SKILL_URL="https://dev.wix.com/skills/wix-headless"
28
37
  UTILS=(analytics.ts ricos.ts wix-image.ts)
29
38
 
39
+ TEMPLATE="astro"
40
+ while [[ $# -gt 0 ]]; do
41
+ case "$1" in
42
+ --template)
43
+ TEMPLATE="$2"
44
+ shift 2
45
+ ;;
46
+ --template=*)
47
+ TEMPLATE="${1#--template=}"
48
+ shift
49
+ ;;
50
+ *)
51
+ echo "seed-utilities.sh: unexpected arg: $1" >&2
52
+ exit 2
53
+ ;;
54
+ esac
55
+ done
56
+
57
+ case "$TEMPLATE" in
58
+ astro) ;;
59
+ *)
60
+ echo "seed-utilities.sh: --template must be 'astro' (the only supported frontend); got $TEMPLATE" >&2
61
+ echo "(Custom non-astro frontends route to the stub and never reach this script.)" >&2
62
+ exit 2
63
+ ;;
64
+ esac
65
+
30
66
  # Mode detection: prefer on-disk skill root if the sibling dir exists, else
31
67
  # fetch over HTTP. Covers both tgz install and `bash <(curl ...)` streaming.
32
68
  SHARED_UTILS_DIR=""
@@ -50,6 +86,8 @@ for f in "${UTILS[@]}"; do
50
86
  fi
51
87
  done
52
88
 
53
- # Astro starter cruft cleanup.
54
- rm -f src/components/Welcome.astro
55
- rm -f src/assets/astro.svg src/assets/wix.svg src/assets/background.svg
89
+ # Astro starter cruft cleanup — astro template only.
90
+ if [[ "$TEMPLATE" == "astro" ]]; then
91
+ rm -f src/components/Welcome.astro
92
+ rm -f src/assets/astro.svg src/assets/wix.svg src/assets/background.svg
93
+ fi
@@ -1,11 +1,13 @@
1
1
  ---
2
2
  name: wix-manage
3
- description: "Wix business solution management recipes — REST API operations for configuring and managing Wix business solutions. Routes to: stores, bookings, get-paid, CMS, contacts, events, forms, media, app-installation, pricing-plans, restaurants, rich-content, sites, blog, calendar, domains, site-properties, ecommerce."
3
+ description: "Wix business solution management recipes — REST API operations for configuring and managing Wix business solutions. Routes to: stores, bookings, get-paid, CMS, contacts, forms, media, app-installation, pricing-plans, restaurants, rich-content, sites, blog, calendar, domains, site-properties, ecommerce."
4
4
  compatibility: Requires Wix REST API access (API key or OAuth).
5
5
  ---
6
6
 
7
7
  # Management Recipes Index
8
8
 
9
+ > **Standard call shape for every curl example across these recipes.** The `<AUTH>` placeholder in example curls is shorthand for the `Authorization` header only; every actual call ALSO needs `wix-site-id: <SITE_ID>` and `Content-Type: application/json`. **POST/PATCH against `wix-data/*`, `form-schema-service/*`, `stores/v3/*`, `blog/v3/*`, and other site-scoped REST families return 403 without `wix-site-id`** — observed seeder regression cost ~100 s rediscovering this on a 2026-05-24 run. Mint the token via `npx @wix/cli@latest token --site "$SITE_ID"`.
10
+
9
11
  ## What Are Management Recipes?
10
12
 
11
13
  **Management recipes are for REST API operations** that configure, set up, and manage Wix business entities on your site. These recipes use REST API calls and are designed for:
@@ -155,6 +157,7 @@ These recipes do NOT cover frontend development or SDK usage for displaying data
155
157
 
156
158
  #### Config & API References
157
159
  - [API: Recommendation Tracking](references/ecommerce/api-recommendation-tracking.md)
160
+ - [API: Shipping Delivery](references/ecommerce/api-shipping.md)
158
161
  - [Setup: Discount Rules](references/ecommerce/setup-discount-rules.md)
159
162
  - [Setup: Coupons](references/ecommerce/setup-coupons.md)
160
163
  - [Setup: Shipping Regions](references/ecommerce/setup-shipping-regions.md)
@@ -171,13 +174,6 @@ These recipes do NOT cover frontend development or SDK usage for displaying data
171
174
 
172
175
  ---
173
176
 
174
- ## Events
175
-
176
- ### [List Events](references/events/list-events.md)
177
- **Technical:** Queries events from Wix Events using Events API. Covers field sets (DETAILS, URLS, REGISTRATION), filtering by status/date, and pagination.
178
-
179
- ---
180
-
181
177
  ## Forms
182
178
 
183
179
  ### [Create Form](references/forms/create-form.md)
@@ -5,6 +5,8 @@ description: Creates and publishes blog posts using Blog Posts API. Covers Ricos
5
5
 
6
6
  **Article: Create and Publish Blog Posts with Rich Content and Images**
7
7
 
8
+ > **Standard call shape (every curl below).** The `<AUTH>` placeholder is shorthand for `Authorization: Bearer <TOKEN>` only. Every actual call ALSO needs `wix-site-id: <SITE_ID>` and (for body-bearing requests) `Content-Type: application/json`. **POST against `blog/v3/*` returns 403 without `wix-site-id`** — recipe examples below show `<AUTH>` only for brevity, but the header is required on every call you make. Token: `npx @wix/cli@latest token --site "$SITE_ID"`.
9
+
8
10
  ---
9
11
 
10
12
  ## Description
@@ -49,7 +51,13 @@ This article demonstrates how to create and immediately publish blog posts using
49
51
 
50
52
  ### Part 2: Create Blog Post with Rich Content
51
53
 
52
- 1. Create blog post using [Create Draft Post](https://dev.wix.com/docs/api-reference/business-solutions/blog/draft-posts/create-draft-post) for single posts, or [Bulk Create Draft Posts](https://dev.wix.com/docs/api-reference/business-solutions/blog/draft-posts/bulk-create-draft-posts) for multiple posts.
54
+ You have two endpoints:
55
+ - **Single post:** [Create Draft Post](https://dev.wix.com/docs/api-reference/business-solutions/blog/draft-posts/create-draft-post) — `POST https://www.wixapis.com/blog/v3/draft-posts`
56
+ - **Multiple posts (preferred for any N ≥ 2):** [Bulk Create Draft Posts](https://dev.wix.com/docs/api-reference/business-solutions/blog/draft-posts/bulk-create-draft-posts) — `POST https://www.wixapis.com/blog/v3/bulk/draft-posts/create`
57
+
58
+ **Use the bulk endpoint when seeding multiple posts** — one call replaces N single-post calls and avoids the per-call latency of ~25–30 s each.
59
+
60
+ #### Single-post endpoint
53
61
 
54
62
  ```bash
55
63
  curl -X POST "https://www.wixapis.com/blog/v3/draft-posts" \
@@ -86,6 +94,67 @@ This article demonstrates how to create and immediately publish blog posts using
86
94
  }'
87
95
  ```
88
96
 
97
+ #### Bulk-create endpoint (preferred for multiple posts)
98
+
99
+ > **⚠️ Body shape — read this carefully. Each item in `draftPosts` is a FLAT post object: `{title, memberId, richContent, media?, ...}`. Do NOT wrap each item in a `draftPost` field.** Unlike the single-post endpoint (which uses `{draftPost: {...}}` because the request is one post), the bulk endpoint puts each post DIRECTLY inside the `draftPosts` array.
100
+
101
+ ✅ **CORRECT body shape (verified against the live API — returns 200 with `results[].itemMetadata.success: true`):**
102
+
103
+ ```json
104
+ {
105
+ "draftPosts": [
106
+ { "title": "First Post", "memberId": "...", "richContent": { /* … */ } },
107
+ { "title": "Second Post", "memberId": "...", "richContent": { /* … */ } }
108
+ ],
109
+ "publish": true
110
+ }
111
+ ```
112
+
113
+ ❌ **WRONG body shape (returns `400 Bad Request` with `draftPosts[i].title must not be empty` because the API is looking for `draftPosts[i].title` directly and finds it nested under a `draftPost` field):**
114
+
115
+ ```json
116
+ {
117
+ "draftPosts": [
118
+ { "draftPost": { "title": "First Post", "memberId": "...", "richContent": { /* … */ } } },
119
+ { "draftPost": { "title": "Second Post", "memberId": "...", "richContent": { /* … */ } } }
120
+ ],
121
+ "publish": true
122
+ }
123
+ ```
124
+
125
+ The natural intuition is "the bulk endpoint reuses the single-post `{draftPost: {...}}` envelope, just inside an array" — that's wrong. The bulk endpoint flattens the envelope away because the array IS the envelope. **Use the FLAT shape: `draftPosts[i]` IS the post.**
126
+
127
+ #### Full bulk-create curl example
128
+
129
+ ```bash
130
+ curl -X POST "https://www.wixapis.com/blog/v3/bulk/draft-posts/create" \
131
+ -H "Authorization: <AUTH>" \
132
+ -H "Content-Type: application/json" \
133
+ -d '{
134
+ "draftPosts": [
135
+ {
136
+ "title": "First Post",
137
+ "memberId": "author-member-id",
138
+ "richContent": { /* Ricos JSON — see below */ },
139
+ "media": { "wixMedia": { "image": { "id": "mediaId" } }, "displayed": true, "custom": true }
140
+ },
141
+ {
142
+ "title": "Second Post",
143
+ "memberId": "author-member-id",
144
+ "richContent": { /* Ricos JSON */ }
145
+ }
146
+ ],
147
+ "publish": true
148
+ }'
149
+ ```
150
+
151
+ The response body is `{results: [{itemMetadata: {id, originalIndex, success}}, ...]}`. Each result's `itemMetadata` carries the created post id and a `success: boolean` flag — the bulk call returns 200 even if some posts fail; check each `results[i].itemMetadata.success` individually.
152
+
153
+ **Common URL-shape mistakes (do not use these — both return 404):**
154
+ - `/blog/v3/draft-posts/bulk` ✗
155
+ - `/blog/v3/draft-posts/bulk-create` ✗
156
+ - The correct path is `/blog/v3/bulk/draft-posts/create` (note: `bulk` is a path segment between `v3` and `draft-posts`, not a suffix on `draft-posts`).
157
+
89
158
  2. Structure rich content using Ricos JSON format. Reference [Ricos documentation](https://dev.wix.com/docs/api-reference/assets/rich-content/ricos-documents/introduction) for complete node structure. Common node types:
90
159
  - `PARAGRAPH` for text content
91
160
  - `HEADING` for section headers
@@ -4,6 +4,8 @@ description: "Add, query, update, and delete items in CMS collections. Use this
4
4
  ---
5
5
  # CMS Data Items CRUD
6
6
 
7
+ > **Standard call shape (every curl below).** The `<AUTH>` placeholder is shorthand for `Authorization: Bearer <TOKEN>` only. Every actual call ALSO needs `wix-site-id: <SITE_ID>` and (for body-bearing requests) `Content-Type: application/json`. **POST/PATCH against `wix-data/*` returns 403 without `wix-site-id`** — recipe examples below show `<AUTH>` only for brevity, but the header is required on every call you make. Token: `npx @wix/cli@latest token --site "$SITE_ID"`.
8
+
7
9
  This recipe covers basic Create, Read, Update, Delete (CRUD) operations for Wix CMS data items.
8
10
 
9
11
  ## Prerequisites
@@ -365,6 +367,8 @@ curl -X DELETE \
365
367
  | `IMAGE` | Image reference (HTTP url or wix:image://v1/{mediaId}/{friendlyName}) | `"wix:image://v1/3f72369f2219e2ee853e9e3df0217ce1.jpg/Colorful%20Business%20Cards.jpg"` |
366
368
  | `VIDEO` | Video reference (HTTP url or wix:video://v1/{mediaId}/{friendlyName}) | `"wix:video://v1/11062b_484182533ede4b9a81329daf20238867/Sketching%20Design%20Concepts#posterUri=11062b_484182533ede4b9a81329daf20238867f000.jpg&posterWidth=1920&posterHeight=1080"` |
367
369
  | `DOCUMENT` | Document reference (HTTP url or wix:document://v1/{mediaId}) | `"wix:document://v1/..."` |
370
+ | `MEDIA_IMAGE` | Wix Media Image | `{ "url": "http://...", "height": 640, "width": 480, "alt": "Picture" }` |
371
+ | `MEDIA_VECTOR_ART` | Wix Media Vector Art | `{ "uri": "wix:vector://v1/...", "viewBox": "0 0 100 100", "contentType": "shape", "svgContent": "<svg>...</svg>" }` |
368
372
  | `URL` | Web URL | `"https://example.com"` |
369
373
  | `RICH_TEXT` | HTML content | `"<p>Rich text</p>"` |
370
374
  | `EMAIL` | Email | `"example@wix.com"` |
@@ -4,6 +4,8 @@ description: "Add, replace, or remove items from MULTI_REFERENCE fields. Use ins
4
4
  ---
5
5
  # CMS References & Relationships
6
6
 
7
+ > **Standard call shape (every curl below).** The `<AUTH>` placeholder is shorthand for `Authorization: Bearer <TOKEN>` only. Every actual call ALSO needs `wix-site-id: <SITE_ID>` and (for body-bearing requests) `Content-Type: application/json`. **POST/PATCH against `wix-data/*` returns 403 without `wix-site-id`** — recipe examples below show `<AUTH>` only for brevity, but the header is required on every call you make. Token: `npx @wix/cli@latest token --site "$SITE_ID"`.
8
+
7
9
  This recipe covers linking CMS collections together using reference fields.
8
10
 
9
11
  ## Prerequisites
@@ -4,6 +4,8 @@ description: Create and modify CMS collection structures. Covers listing collect
4
4
  ---
5
5
  # CMS Schema Management
6
6
 
7
+ > **Standard call shape (every curl below).** The `<AUTH>` placeholder is shorthand for `Authorization: Bearer <TOKEN>` only. Every actual call ALSO needs `wix-site-id: <SITE_ID>` and (for body-bearing requests) `Content-Type: application/json`. **POST/PATCH against `wix-data/*` returns 403 without `wix-site-id`** — recipe examples below show `<AUTH>` only for brevity, but the header is required on every call you make. Token: `npx @wix/cli@latest token --site "$SITE_ID"`.
8
+
7
9
  This recipe covers managing the structure (schema) of Wix CMS collections using the REST API.
8
10
 
9
11
  ## Prerequisites
@@ -120,6 +122,8 @@ curl -X GET \
120
122
  | `DATE` | Date only | `"2024-01-15"` |
121
123
  | `DATETIME` | Date and time | `{ "$date": "2024-01-15T10:00:00.000Z" }` |
122
124
  | `IMAGE` | Image reference | `"wix:image://v1/..."` |
125
+ | `MEDIA_IMAGE` | Wix Media Image | `{ "url": "http://...", "height": 640, "width": 480, "alt": "Picture" }` |
126
+ | `MEDIA_VECTOR_ART` | Wix Media Vector Art | `{ "uri": "wix:vector://v1/...", "viewBox": "0 0 100 100", "contentType": "shape", "svgContent": "<svg>...</svg>" }` |
123
127
  | `URL` | Web URL | `"https://example.com"` |
124
128
  | `RICH_TEXT` | HTML content | `"<p>Rich text</p>"` |
125
129
  | `ARRAY_STRING` | Array of strings | `["tag1", "tag2"]` |