@wix/agent-skills 1.31.0 → 1.31.2
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.
- package/package.json +1 -1
- package/skills/wix-app/SKILL.md +7 -8
- package/skills/wix-app/references/DASHBOARD_PAGE.md +1 -1
- package/skills/wix-app/references/STORES_VERSIONING.md +1 -1
- package/skills/wix-app/references/WIX_PATTERNS_DOCS.md +11 -50
- package/skills/wix-app/references/dashboard-page/DATA_SOURCES.md +14 -10
- package/skills/wix-app/references/dashboard-page/DRAFT_TEMPLATE.md +5 -8
- package/skills/wix-app/references/dashboard-page/TABLE_STATE.md +5 -4
- package/skills/wix-headless-kit/SKILL.md +31 -14
- package/skills/wix-headless-kit/guides/api-run.md +116 -31
- package/skills/wix-headless-kit/guides/existing-site.md +9 -2
- package/skills/wix-headless-kit/guides/reference-mode.md +9 -1
- package/skills/wix-headless-kit/install/AGENTS.md +10 -7
- package/skills/wix-headless-kit/install/attach.mjs +35 -30
- package/skills/wix-headless-kit/install/background.mjs +32 -0
- package/skills/wix-headless-kit/install/bootstrap.mjs +28 -11
- package/skills/wix-headless-kit/install/check.mjs +2 -2
- package/skills/wix-headless-kit/install/context.mjs +62 -8
- package/skills/wix-headless-kit/install/deploy.mjs +36 -11
- package/skills/wix-headless-kit/install/env-ignore.mjs +16 -0
- package/skills/wix-headless-kit/install/install.mjs +95 -0
- package/skills/wix-headless-kit/install/pins.json +1 -1
- package/skills/wix-headless-kit/install/proc.mjs +46 -0
- package/skills/wix-headless-kit/install/setup.mjs +18 -27
- package/skills/wix-headless-kit/install/templates.mjs +4 -3
- package/skills/wix-headless-templates/blog/app/components/blog/RichContent.tsx +3 -2
- package/skills/wix-headless-templates/blog/project/package-lock.json +1287 -1299
- package/skills/wix-headless-templates/blog/project/package.json +1 -1
- package/skills/wix-headless-templates/blog/project/src/components/blog/RichContent.tsx +3 -2
- package/skills/wix-headless-templates/blog/rest/authors.ts +5 -5
- package/skills/wix-headless-templates/blog/rest/comments.ts +4 -4
- package/skills/wix-headless-templates/blog/rest/post-likes.ts +3 -3
- package/skills/wix-headless-templates/blog/rest/posts.ts +4 -4
- package/skills/wix-headless-templates/blog/rest/taxonomy.ts +5 -5
- package/skills/wix-headless-templates/blog/seed/SEED.md +1 -1
- package/skills/wix-headless-templates/blog/seed/seed-blog.mjs +4 -3
- package/skills/wix-headless-templates/bookings/rest/booking.ts +4 -4
- package/skills/wix-headless-templates/bookings/rest/services.ts +4 -4
- package/skills/wix-headless-templates/bookings/seed/SEED.md +1 -1
- package/skills/wix-headless-templates/bookings/seed/seed-bookings.mjs +4 -2
- package/skills/wix-headless-templates/cms/rest/collections.ts +3 -3
- package/skills/wix-headless-templates/cms/rest/items.ts +4 -4
- package/skills/wix-headless-templates/cms/seed/seed-cms.mjs +2 -1
- package/skills/wix-headless-templates/donations/rest/campaigns.ts +4 -4
- package/skills/wix-headless-templates/donations/rest/donate.ts +3 -3
- package/skills/wix-headless-templates/donations/seed/SEED.md +1 -1
- package/skills/wix-headless-templates/donations/seed/seed-donations.mjs +5 -3
- package/skills/wix-headless-templates/events/rest/events.ts +4 -4
- package/skills/wix-headless-templates/events/rest/orders.ts +4 -4
- package/skills/wix-headless-templates/events/rest/registration.ts +4 -4
- package/skills/wix-headless-templates/events/seed/SEED.md +1 -1
- package/skills/wix-headless-templates/events/seed/seed-events.mjs +5 -3
- package/skills/wix-headless-templates/faq/rest/faq.ts +4 -4
- package/skills/wix-headless-templates/faq/seed/seed-faq.mjs +2 -1
- package/skills/wix-headless-templates/forms/rest/forms.ts +4 -4
- package/skills/wix-headless-templates/forms/rest/submissions.ts +4 -4
- package/skills/wix-headless-templates/forms/seed/seed-forms.mjs +2 -1
- package/skills/wix-headless-templates/members/rest/auth.ts +3 -3
- package/skills/wix-headless-templates/members/rest/members.ts +4 -4
- package/skills/wix-headless-templates/members/seed/seed-members.mjs +2 -1
- package/skills/wix-headless-templates/portfolio/rest/portfolio.ts +4 -4
- package/skills/wix-headless-templates/portfolio/seed/SEED.md +4 -2
- package/skills/wix-headless-templates/portfolio/seed/seed-portfolio.mjs +8 -7
- package/skills/wix-headless-templates/pricing-plans/rest/plan-access.ts +3 -3
- package/skills/wix-headless-templates/pricing-plans/rest/plans.ts +4 -4
- package/skills/wix-headless-templates/pricing-plans/rest/purchase.ts +3 -3
- package/skills/wix-headless-templates/pricing-plans/seed/seed-pricing-plans.mjs +2 -1
- package/skills/wix-headless-templates/rentals/rest/rentals.ts +4 -4
- package/skills/wix-headless-templates/rentals/seed/SEED.md +1 -1
- package/skills/wix-headless-templates/rentals/seed/seed-rentals.mjs +4 -2
- package/skills/wix-headless-templates/restaurants/rest/menu.ts +4 -4
- package/skills/wix-headless-templates/restaurants/rest/ordering.ts +5 -5
- package/skills/wix-headless-templates/restaurants/rest/reservations.ts +4 -4
- package/skills/wix-headless-templates/restaurants/seed/SEED.md +1 -1
- package/skills/wix-headless-templates/restaurants/seed/seed-restaurants.mjs +6 -4
- package/skills/wix-headless-templates/shared/capabilities/site-search/rest/search.ts +4 -4
- package/skills/wix-headless-templates/shared/capabilities/site-search/seed/install.mjs +6 -4
- package/skills/wix-headless-templates/shared/seed/images.mjs +41 -5
- package/skills/wix-headless-templates/shared/seed/main.mjs +15 -0
- package/skills/wix-headless-templates/shared/seed/wix-cli.mjs +43 -11
- package/skills/wix-headless-templates/storefront/INSTRUCTIONS.md +1 -1
- package/skills/wix-headless-templates/storefront/rest/cart.ts +5 -5
- package/skills/wix-headless-templates/storefront/rest/catalog.ts +5 -5
- package/skills/wix-headless-templates/storefront/seed/SEED.md +44 -14
- package/skills/wix-headless-templates/storefront/seed/seed-store.mjs +23 -15
- package/skills/wix-manage/SKILL.md +28 -18
- package/skills/wix-manage/references/app-installation/install-wix-apps.md +5 -1
- package/skills/wix-manage/references/app-installation/list-installed-apps.md +19 -9
- package/skills/wix-manage/references/automations/activation-status.md +52 -0
- package/skills/wix-manage/references/automations/api-catalog.md +81 -0
- package/skills/wix-manage/references/automations/build-and-manage-automations.md +34 -0
- package/skills/wix-manage/references/bookings/booking-service-policy-setup.md +3 -0
- package/skills/wix-manage/references/bookings/create-and-update-booking-services.md +277 -363
- package/skills/wix-manage/references/bookings/external-calendar-integration.md +3 -0
- package/skills/wix-manage/references/bookings/multi-resource-service-creation.md +3 -0
- package/skills/wix-manage/references/cms/cms-data-items-crud.md +11 -2
- package/skills/wix-manage/references/cms/cms-publishing-flow.md +63 -16
- package/skills/wix-manage/references/custom-apps/use-app-skills-and-app-tools.md +3 -1
- package/skills/wix-manage/references/forms/update-form.md +3 -0
- package/skills/wix-manage/references/pricing-plans/create-and-update-pricing-plans.md +3 -0
- package/skills/wix-manage/references/restaurants/wix-restaurants-setup.md +3 -0
- package/skills/wix-manage/references/sites/create-headless-site.md +7 -50
- package/skills/wix-manage/references/sites/manage-oauth-apps.md +4 -4
- package/skills/wix-manage/references/sites/read-site-context.md +4 -0
- package/skills/wix-manage/references/sites/send-feedback-to-wix.md +92 -0
- package/skills/wix-manage/references/sites/upload-static-site.md +298 -283
- package/skills/wix-manage/references/stores/add-store-pages-to-site.md +3 -0
- package/skills/wix-manage/references/stores/change-store-currency.md +3 -0
- package/skills/wix-manage/references/stores/create-product-catalog-v3.md +3 -0
- package/skills/wix-manage/references/stores/find-products-query-and-search-catalog-v3.md +3 -0
- package/skills/wix-manage/references/stores/update-product-with-options.md +192 -22
- package/skills/wix-manage/references/bookings/create-appointment-service.md +0 -243
- package/skills/wix-manage/references/bookings/create-booking-service-from-prompt.md +0 -31
- package/skills/wix-manage/references/bookings/create-class-service.md +0 -222
- package/skills/wix-manage/references/bookings/create-course-service.md +0 -251
|
@@ -4,6 +4,9 @@ description: OAuth-based integration with Google Calendar, Microsoft Outlook, an
|
|
|
4
4
|
---
|
|
5
5
|
# Technical Step-by-Step Instructions: Connecting External Calendars (Google, Microsoft, Apple) to Wix Bookings (Real-World, API-First)
|
|
6
6
|
|
|
7
|
+
> These calls need the Wix Bookings app on the site (`appDefId` `13d21c63-b5ec-5912-8397-c3a5ddb27a97`); a `428`, a `400` naming the app, or an empty result on a site that should have content means it is not there. [List Installed Apps](../app-installation/list-installed-apps.md) shows what the site has; [Install Wix Apps](../app-installation/install-wix-apps.md) adds it by that id.
|
|
8
|
+
|
|
9
|
+
|
|
7
10
|
## Description
|
|
8
11
|
|
|
9
12
|
Below are the recommended steps to successfully connect and sync external calendars (Google Calendar, Microsoft Outlook, Apple Calendar) with Wix Bookings, with real-world troubleshooting and fixes for common API issues. This recipe covers the complete OAuth flow, sync configuration, and verification procedures.
|
|
@@ -4,6 +4,9 @@ description: Creates resource types and individual resources using Resources API
|
|
|
4
4
|
---
|
|
5
5
|
# Technical Step-by-Step Instructions: Creating Multi-Resource Bookings Services (Rooms, Equipment, Staff) - Real-World, API-First
|
|
6
6
|
|
|
7
|
+
> These calls need the Wix Bookings app on the site (`appDefId` `13d21c63-b5ec-5912-8397-c3a5ddb27a97`); a `428`, a `400` naming the app, or an empty result on a site that should have content means it is not there. [List Installed Apps](../app-installation/list-installed-apps.md) shows what the site has; [Install Wix Apps](../app-installation/install-wix-apps.md) adds it by that id.
|
|
8
|
+
|
|
9
|
+
|
|
7
10
|
## Description
|
|
8
11
|
|
|
9
12
|
Below are the recommended steps to successfully create Wix Bookings services that require multiple resource types (e.g., Room + Equipment + Instructor). This recipe covers the **gaps** in individual API documentation: resource architecture planning, entity relationship patterns, availability dependencies, and real-world coordination challenges that aren't clear from reading individual API references.
|
|
@@ -4,6 +4,9 @@ description: "Add, query, update, and delete items in CMS collections, one at a
|
|
|
4
4
|
---
|
|
5
5
|
# CMS Data Items CRUD
|
|
6
6
|
|
|
7
|
+
> These calls need the Wix CMS app on the site (`appDefId` `e593b0bd-b783-45b8-97c2-873d42aacaf4`); a `428`, a `400` naming the app, or an empty result on a site that should have content means it is not there. [List Installed Apps](../app-installation/list-installed-apps.md) shows what the site has; [Install Wix Apps](../app-installation/install-wix-apps.md) adds it by that id.
|
|
8
|
+
|
|
9
|
+
|
|
7
10
|
> **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`.
|
|
8
11
|
|
|
9
12
|
This recipe covers Create, Read, Update, Delete (CRUD) operations for Wix CMS data items, plus count, upsert, truncate, aggregate, and reference-field links.
|
|
@@ -175,6 +178,8 @@ curl -X GET \
|
|
|
175
178
|
|
|
176
179
|
**Endpoint**: `PUT https://www.wixapis.com/wix-data/v2/items/{itemId}`
|
|
177
180
|
|
|
181
|
+
> **Warning**: This replaces the entire item — fields not in `dataItem.data` are deleted. To change only some fields, use [Patch Data Item](#patch-data-item-partial-update---single-item).
|
|
182
|
+
|
|
178
183
|
**Request Body**:
|
|
179
184
|
```json
|
|
180
185
|
{
|
|
@@ -233,6 +238,8 @@ Unlike Update, this only modifies the specified fields — all other fields rema
|
|
|
233
238
|
|
|
234
239
|
> There is no update-by-filter endpoint. To update the items matching a filter, query them first (see [Query Data Items](#query-data-items)), then send their ids to bulk update or bulk patch.
|
|
235
240
|
|
|
241
|
+
> **Note**: This replaces the entire item. Include all fields you want to keep, not just the ones you're changing.
|
|
242
|
+
|
|
236
243
|
> **Important**: Use `id` (not `_id`) at the element level. The `data` object should NOT contain `_id`.
|
|
237
244
|
|
|
238
245
|
```json
|
|
@@ -242,14 +249,18 @@ Unlike Update, this only modifies the specified fields — all other fields rema
|
|
|
242
249
|
{
|
|
243
250
|
"id": "item-guid-1",
|
|
244
251
|
"data": {
|
|
252
|
+
"title": "Wireless Headphones Pro",
|
|
245
253
|
"price": 159.99,
|
|
254
|
+
"description": "Premium wireless headphones",
|
|
246
255
|
"inStock": true
|
|
247
256
|
}
|
|
248
257
|
},
|
|
249
258
|
{
|
|
250
259
|
"id": "item-guid-2",
|
|
251
260
|
"data": {
|
|
261
|
+
"title": "Wired Earbuds",
|
|
252
262
|
"price": 89.99,
|
|
263
|
+
"description": "Compact wired earbuds",
|
|
253
264
|
"inStock": false
|
|
254
265
|
}
|
|
255
266
|
}
|
|
@@ -257,8 +268,6 @@ Unlike Update, this only modifies the specified fields — all other fields rema
|
|
|
257
268
|
}
|
|
258
269
|
```
|
|
259
270
|
|
|
260
|
-
> **Note**: This replaces the entire item. Include all fields you want to keep, not just the ones you're changing.
|
|
261
|
-
|
|
262
271
|
## Bulk Patch Items (Partial Update)
|
|
263
272
|
|
|
264
273
|
**Endpoint**: `POST https://www.wixapis.com/wix-data/v2/bulk/items/patch`
|
|
@@ -4,6 +4,9 @@ description: "Interact with CMS collections that gate their items behind a draft
|
|
|
4
4
|
---
|
|
5
5
|
# CMS Draft & Publish Workflow
|
|
6
6
|
|
|
7
|
+
> These calls need the Wix CMS app on the site (`appDefId` `e593b0bd-b783-45b8-97c2-873d42aacaf4`); a `428`, a `400` naming the app, or an empty result on a site that should have content means it is not there. [List Installed Apps](../app-installation/list-installed-apps.md) shows what the site has; [Install Wix Apps](../app-installation/install-wix-apps.md) adds it by that id.
|
|
8
|
+
|
|
9
|
+
|
|
7
10
|
> **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`.
|
|
8
11
|
|
|
9
12
|
Some CMS collections gate their items behind a **draft/publish workflow** instead of writing straight to the live site. Such a collection has the **Draft Items plugin** installed. Each item is in one of three states — **DRAFT**, **PUBLISHED**, or **CHANGED** (a published item with a pending draft edit) — and edits are staged as drafts until explicitly published.
|
|
@@ -59,6 +62,8 @@ curl -X GET \
|
|
|
59
62
|
- **Draft Items plugin present** → the collection gates items behind draft/publish. Its `draftItemsPluginOptions.draftsCollectionId` gives the paired drafts collection to author and edit drafts against.
|
|
60
63
|
- **Draft Items plugin absent** → plain collection; every insert/update goes straight live. No draft surface exists.
|
|
61
64
|
|
|
65
|
+
Once the Draft Items plugin is installed, do not insert, update, patch, remove, or save items directly in the published collection. Read `draftItemsPluginOptions.draftsCollectionId` from the plugin and write new items and pending edits to that drafts collection. Then call **Publish Data Item Draft** (`POST /wix-data/v2/items/publish-draft`) to publish an item to the published collection. This lifecycle operation takes the published collection ID; it is the supported way to move a draft into the live collection.
|
|
66
|
+
|
|
62
67
|
---
|
|
63
68
|
|
|
64
69
|
## 2. Read items
|
|
@@ -90,7 +95,7 @@ Reads target a specific surface — there is no merged view:
|
|
|
90
95
|
|
|
91
96
|
### Author a brand-new draft
|
|
92
97
|
|
|
93
|
-
Insert into the **drafts** collection. The item starts as **DRAFT**.
|
|
98
|
+
Insert into the **drafts** collection. Do not insert into the published collection while the Draft Items plugin is installed. The item starts as **DRAFT** and becomes live only after you call **Publish Data Item Draft**.
|
|
94
99
|
|
|
95
100
|
**Endpoint**: `POST https://www.wixapis.com/wix-data/v2/items`
|
|
96
101
|
|
|
@@ -109,13 +114,30 @@ Update or patch against the **drafts** collection (`articles__drafts`). See [CMS
|
|
|
109
114
|
|
|
110
115
|
### Edit a PUBLISHED item → produces CHANGED
|
|
111
116
|
|
|
112
|
-
|
|
117
|
+
**PUT and PATCH against the published collection fail while the Draft Items plugin is installed.** Create a draft of the published item, then edit that draft in the paired drafts collection. The published version remains live and unchanged until the draft is published.
|
|
113
118
|
|
|
114
|
-
|
|
119
|
+
1. Call [Create Data Item Draft](https://dev.wix.com/docs/api-reference/business-solutions/cms/data-items/create-data-item-draft) with the published collection ID and item ID. It returns `dataItem`, a full draft copy with the same item ID; `dataItem.dataCollectionId` identifies the paired drafts collection. The item is now CHANGED.
|
|
120
|
+
2. Update or patch the returned draft using the drafts collection ID. Use Patch Data Item to preserve fields you did not change; Update Data Item replaces the draft's entire payload.
|
|
121
|
+
3. Call Publish Data Item Draft with the published collection ID to make the edits live.
|
|
122
|
+
|
|
123
|
+
```bash
|
|
124
|
+
# Create a draft of a PUBLISHED item; the lifecycle call takes the published collection ID.
|
|
125
|
+
curl -X POST 'https://www.wixapis.com/wix-data/v2/items/create-draft' \
|
|
126
|
+
-H 'Content-Type: application/json' \
|
|
127
|
+
-H 'Authorization: <AUTH>' \
|
|
128
|
+
-d '{"dataCollectionId":"articles","dataItemId":"<id>"}'
|
|
129
|
+
# Patch the resulting draft; use its returned dataCollectionId, not the published collection ID.
|
|
130
|
+
curl -X PATCH 'https://www.wixapis.com/wix-data/v2/items/<id>' \
|
|
131
|
+
-H 'Content-Type: application/json' \
|
|
132
|
+
-H 'Authorization: <AUTH>' \
|
|
133
|
+
-d '{"dataCollectionId":"<draftsCollectionId>","patch":{"dataItemId":"<id>","fieldModifications":[{"fieldPath":"body","action":"SET_FIELD","setFieldOptions":{"value":"Revised article body"}}]}}'
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
For a CHANGED item, edit its existing draft directly. Create Data Item Draft returns `ALREADY_EXISTS` if a draft already exists; query the paired drafts collection when the item's state is unknown.
|
|
115
137
|
|
|
116
138
|
### Publish a pending draft (DRAFT/CHANGED → PUBLISHED)
|
|
117
139
|
|
|
118
|
-
|
|
140
|
+
Call **Publish Data Item Draft** to publish the pending draft. It replaces the published item's data with the draft's content; the draft is then deleted. Pass the **published** collection ID. This lifecycle operation is the allowed way to write the draft's content to the published collection.
|
|
119
141
|
|
|
120
142
|
**Endpoint**: `POST https://www.wixapis.com/wix-data/v2/items/publish-draft`
|
|
121
143
|
|
|
@@ -161,12 +183,12 @@ curl -X POST \
|
|
|
161
183
|
}'
|
|
162
184
|
```
|
|
163
185
|
|
|
164
|
-
`copyToDraft` controls the
|
|
186
|
+
`copyToDraft` controls whether the published data is copied into the drafts collection:
|
|
165
187
|
|
|
166
188
|
| `copyToDraft` | Behavior | Use for |
|
|
167
189
|
|---------------|----------|---------|
|
|
168
|
-
| `true` (default) | Removes the live copy
|
|
169
|
-
| `false` | Removes the live copy **without** creating a draft. No `dataItem` returned. |
|
|
190
|
+
| `true` (default) | Removes the live copy and copies its data into a draft. Any existing pending draft for that ID is **overwritten**, discarding its unpublished edits. | Take the item offline and retain the previously-published content as a draft. |
|
|
191
|
+
| `false` | Removes the live copy **without** creating a draft. Any existing pending draft is **preserved unchanged**. No `dataItem` is returned. | Remove the live version while leaving any pending draft intact. |
|
|
170
192
|
|
|
171
193
|
- Response (`copyToDraft: true`) carries the **new draft**, not the removed live item.
|
|
172
194
|
- Returns `NOT_FOUND` if no published item exists with that id.
|
|
@@ -181,17 +203,38 @@ curl -X DELETE \
|
|
|
181
203
|
-H 'Authorization: <AUTH>'
|
|
182
204
|
```
|
|
183
205
|
|
|
184
|
-
### Delete
|
|
206
|
+
### Delete a published item permanently
|
|
185
207
|
|
|
186
|
-
|
|
208
|
+
> Permanent deletion is irreversible. Confirm with the user before calling Unpublish Data Item with `copyToDraft: false` or deleting a draft, unless the request already names the items to remove.
|
|
209
|
+
|
|
210
|
+
To permanently delete a published item, call **Unpublish Data Item** with `copyToDraft: false` to remove it from the published collection. This preserves any existing pending draft, so query the paired drafts collection for that item ID next. Delete the draft only if the query returns it; when no draft exists, skip the DELETE call. For a CHANGED item, this deletes its preserved pending draft. For a PUBLISHED item with no pending draft, unpublishing completes the deletion.
|
|
187
211
|
|
|
188
212
|
```bash
|
|
189
|
-
#
|
|
190
|
-
|
|
191
|
-
#
|
|
192
|
-
curl -X
|
|
213
|
+
# Stop on HTTP failures, malformed query responses, or failed deletes.
|
|
214
|
+
set -euo pipefail
|
|
215
|
+
# remove the published version without creating a draft
|
|
216
|
+
curl --fail --silent --show-error -X POST 'https://www.wixapis.com/wix-data/v2/items/unpublish' \
|
|
217
|
+
-H 'Content-Type: application/json' \
|
|
218
|
+
-H 'Authorization: <AUTH>' \
|
|
219
|
+
-d '{"dataCollectionId":"articles","dataItemId":"<id>","copyToDraft":false}'
|
|
220
|
+
# Query the paired drafts collection for this ID. Use the draftsCollectionId read from the plugin.
|
|
221
|
+
ITEM_ID='<id>'
|
|
222
|
+
DRAFTS_COLLECTION_ID='<draftsCollectionId>'
|
|
223
|
+
drafts=$(curl --fail --silent --show-error -X POST 'https://www.wixapis.com/wix-data/v2/items/query' \
|
|
224
|
+
-H 'Content-Type: application/json' \
|
|
225
|
+
-H 'Authorization: <AUTH>' \
|
|
226
|
+
-d "{\"dataCollectionId\":\"$DRAFTS_COLLECTION_ID\",\"consistentRead\":true,\"query\":{\"filter\":{\"_id\":\"$ITEM_ID\"},\"paging\":{\"limit\":1}}}")
|
|
227
|
+
# Require a valid dataItems array; a failed query must not be treated as an empty result.
|
|
228
|
+
draft_count=$(printf '%s' "$drafts" | jq -er '.dataItems | if type == "array" then length else error("Expected dataItems array") end')
|
|
229
|
+
# Delete only when the query found the draft; an empty dataItems array means there is nothing to delete.
|
|
230
|
+
if [ "$draft_count" -gt 0 ]; then
|
|
231
|
+
curl --fail --silent --show-error -X DELETE "https://www.wixapis.com/wix-data/v2/items/$ITEM_ID?dataCollectionId=$DRAFTS_COLLECTION_ID" \
|
|
232
|
+
-H 'Authorization: <AUTH>'
|
|
233
|
+
fi
|
|
193
234
|
```
|
|
194
235
|
|
|
236
|
+
If an item was never published and exists only in the drafts collection (DRAFT), delete it directly from the paired drafts collection. Do not call Unpublish Data Item; it returns `NOT_FOUND` when no published item exists.
|
|
237
|
+
|
|
195
238
|
---
|
|
196
239
|
|
|
197
240
|
## 4. Enable / disable the workflow on a collection
|
|
@@ -206,6 +249,7 @@ curl -X POST 'https://www.wixapis.com/wix-data/v2/collections/add-draft-items-pl
|
|
|
206
249
|
-H 'Authorization: <AUTH>' \
|
|
207
250
|
-d '{
|
|
208
251
|
"dataCollectionId": "articles",
|
|
252
|
+
"draftItemsOptions": {},
|
|
209
253
|
"publishPluginConflictAction": "FAIL_WHEN_PUBLISH_INSTALLED"
|
|
210
254
|
}'
|
|
211
255
|
```
|
|
@@ -258,16 +302,19 @@ At the REST level, every read/author/publish/unpublish call here goes through th
|
|
|
258
302
|
| PUBLISHED | Edit into a pending draft (→ CHANGED) | Create the draft (`createDataItemDraft`), then edit it on the drafts collection | Write Data Items |
|
|
259
303
|
| — | Create new draft (→ DRAFT) | `POST https://www.wixapis.com/wix-data/v2/items` on the drafts collection | Write Data Items |
|
|
260
304
|
| DRAFT / CHANGED | Publish (→ PUBLISHED) | `POST https://www.wixapis.com/wix-data/v2/items/publish-draft` (published id) | Write Data Items |
|
|
261
|
-
| PUBLISHED / CHANGED |
|
|
262
|
-
| PUBLISHED / CHANGED |
|
|
305
|
+
| PUBLISHED / CHANGED | Remove from live collection, keep as draft (→ DRAFT) | **Unpublish Data Item** — `POST https://www.wixapis.com/wix-data/v2/items/unpublish`, `copyToDraft:true` | Write Data Items |
|
|
306
|
+
| PUBLISHED / CHANGED | Remove live copy without creating a draft; preserve any existing draft | **Unpublish Data Item** — `POST https://www.wixapis.com/wix-data/v2/items/unpublish`, `copyToDraft:false` | Write Data Items |
|
|
263
307
|
| CHANGED | Revert to live version (discard edit) | `DELETE https://www.wixapis.com/wix-data/v2/items/{id}?dataCollectionId=<drafts id>` | Write Data Items |
|
|
264
|
-
|
|
|
308
|
+
| PUBLISHED / CHANGED | Permanently delete (confirm first unless the request names the item) | `POST https://www.wixapis.com/wix-data/v2/items/unpublish` with `copyToDraft:false` (published id), then query and delete any remaining draft | Write Data Items |
|
|
309
|
+
| DRAFT (never published) | Permanently delete (confirm first unless the request names the item) | `DELETE https://www.wixapis.com/wix-data/v2/items/{id}?dataCollectionId=<drafts id>` | Write Data Items |
|
|
265
310
|
| plain, no plugin | Enable workflow | `POST https://www.wixapis.com/wix-data/v2/collections/add-draft-items-plugin` | Manage Data Collections |
|
|
266
311
|
|
|
267
312
|
---
|
|
268
313
|
|
|
269
314
|
## Agent gotchas
|
|
270
315
|
|
|
316
|
+
- **Never write item data directly to the published collection while Draft Items is installed.** Create and edit items in the paired drafts collection, then call **Publish Data Item Draft** to publish. Lifecycle calls such as publish still take the published collection ID.
|
|
317
|
+
- **Choose the permanent-delete path from the item's state, and confirm first.** Permanent deletion is irreversible: confirm with the user before Unpublish Data Item with `copyToDraft: false` or a draft DELETE unless the request already names the items to remove. For PUBLISHED or CHANGED items, call Unpublish Data Item with the published collection ID and `copyToDraft: false`, then query and delete any remaining draft from the paired drafts collection. For a DRAFT that was never published, delete it directly from the paired drafts collection; Unpublish Data Item would return `NOT_FOUND`.
|
|
271
318
|
- **Resolve the drafts collection from the plugin.** Read `draftItemsPluginOptions.draftsCollectionId` off the published collection's Draft Items plugin rather than assuming a `__drafts` suffix.
|
|
272
319
|
- **Status is server-authoritative.** Derive DRAFT/PUBLISHED/CHANGED from the published + drafts surfaces (or the value the API returns). Never compute it locally, and never render an optimistic status before the write confirms (**confirm-then-render**).
|
|
273
320
|
- **Pass the *published* collection id** to `publish-draft` and `unpublish` — not the drafts collection id. Author and edit drafts against the drafts collection id.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "Use App Skills and App Tools"
|
|
3
|
-
description: "Discovers and runs what the apps installed on a Wix site add for AI agents: app skills, which are an app's instructions for a task (for example pricing a product for customers in another country, or checking a property listing before it is published), and app tools, which are actions and lookups an app exposes. Use when the user asks for something an installed app provides rather than a built-in Wix feature, asks what their apps can do, or names an app, skill or tool. Covers reading a chosen skill's instructions and running the app tools it allows, or running a single app tool directly."
|
|
3
|
+
description: "Discovers and runs what the apps installed on a Wix site add for AI agents: app skills, which are an app's instructions for a task (for example pricing a product for customers in another country, or checking a property listing before it is published), and app tools, which are actions and lookups an app exposes. Use every time a site has custom apps installed, before acting on the user's request: knowing which apps are installed doesn't tell what they can do, so only this skill's discovery calls show whether one of them handles the request. Also use when the user asks for something an installed app provides rather than a built-in Wix feature, asks what their apps can do, or names an app, skill or tool. Covers reading a chosen skill's instructions and running the app tools it allows, or running a single app tool directly."
|
|
4
4
|
---
|
|
5
5
|
# Use App Skills and App Tools
|
|
6
6
|
|
|
@@ -28,6 +28,8 @@ The `www.wixapis.com/_api/...` URLs below are these APIs' public endpoints; the
|
|
|
28
28
|
|
|
29
29
|
Make both calls. They are independent, so run them in parallel.
|
|
30
30
|
|
|
31
|
+
Whenever the site has custom apps installed, make both calls before deciding how to handle the user's request, even if the request doesn't seem to involve an app: you can tell whether an app handles it only from what these calls return. Make them once per site in a conversation.
|
|
32
|
+
|
|
31
33
|
**List App Skills**: `GET https://www.wixapis.com/_api/app-skills/v1/app-skills`
|
|
32
34
|
|
|
33
35
|
```bash
|
|
@@ -4,6 +4,9 @@ description: "Changes a Wix form that already exists, with Form Schemas v4 `PATC
|
|
|
4
4
|
---
|
|
5
5
|
# RECIPE: Update a Wix Form
|
|
6
6
|
|
|
7
|
+
> These calls need the Wix Forms app on the site (`appDefId` `225dd912-7dea-4738-8688-4b8c6955ffc2`); a `428`, a `400` naming the app, or an empty result on a site that should have content means it is not there. [List Installed Apps](../app-installation/list-installed-apps.md) shows what the site has; [Install Wix Apps](../app-installation/install-wix-apps.md) adds it by that id.
|
|
8
|
+
|
|
9
|
+
|
|
7
10
|
> **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`. Send `wix-site-id: <SITE_ID>` when the token is account-scoped.
|
|
8
11
|
|
|
9
12
|
Change what a form collects — **add a field, relabel one, tighten a rule, reorder, retire one** — on a form that already exists. **Composing the field itself is not here**: [About Form Fields](https://dev.wix.com/docs/api-reference/crm/forms/form-schemas/about-form-fields) owns the `identifier` / `inputType` / `componentType` table and the options/enum shapes, and [Create Form](./create-form.md) § Silent breakers apply to an added field exactly as to a created one.
|
|
@@ -4,6 +4,9 @@ description: Creates subscription and one-time payment plans using Plans API. Co
|
|
|
4
4
|
---
|
|
5
5
|
# Technical Step-by-Step Instructions: Creating or Updating a Wix Pricing Plans (Real-World, API-First)
|
|
6
6
|
|
|
7
|
+
> These calls need the Wix Pricing Plans app on the site (`appDefId` `1522827f-c56c-a5c9-2ac9-00f9e6ae12d3`); a `428`, a `400` naming the app, or an empty result on a site that should have content means it is not there. [List Installed Apps](../app-installation/list-installed-apps.md) shows what the site has; [Install Wix Apps](../app-installation/install-wix-apps.md) adds it by that id.
|
|
8
|
+
|
|
9
|
+
|
|
7
10
|
## Description
|
|
8
11
|
Below are the recommended steps to successfully create or update a Wix Pricing Plans (or several at once) on Wix and attach a booking session to a pricing plan, with real-world troubleshooting and fixes for common API issues.
|
|
9
12
|
|
|
@@ -4,6 +4,9 @@ description: Configures restaurant menus, sections, and items using Menus API. C
|
|
|
4
4
|
---
|
|
5
5
|
# Wix Restaurants Setup API Reference
|
|
6
6
|
|
|
7
|
+
> These calls need the Wix Restaurants Menus app on the site (`appDefId` `b278a256-2757-4f19-9313-c05c783bec92`; online ordering is Wix Restaurants Orders `9a5d83fd-8570-482e-81ab-cfa88942ee60`, reservations Wix Table Reservations `f9c07de2-5341-40c6-b096-8eb39de391fb`); a `428`, a `400` naming the app, or an empty result on a site that should have content means it is not there. [List Installed Apps](../app-installation/list-installed-apps.md) shows what the site has; [Install Wix Apps](../app-installation/install-wix-apps.md) adds one by that id.
|
|
8
|
+
|
|
9
|
+
|
|
7
10
|
This recipe covers setting up and configuring Wix Restaurants using the REST API, including menus, items, and ordering configuration.
|
|
8
11
|
|
|
9
12
|
## Prerequisites
|
|
@@ -1,55 +1,12 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: "Create Headless Site"
|
|
3
|
-
description: Creates a Wix Headless site
|
|
3
|
+
description: Creates a Wix Headless website: a site in the user's Wix account whose frontend is files uploaded to Wix hosting, with the Wix business backend behind it through APIs. Creating, uploading, updating and connecting a backend are one flow, in Upload a Website or HTML Files.
|
|
4
4
|
---
|
|
5
5
|
# Create Headless Site
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
- Wix account with site creation permissions
|
|
14
|
-
- Account-level API access
|
|
15
|
-
|
|
16
|
-
## Provision a Headless Business
|
|
17
|
-
|
|
18
|
-
**Endpoint**: `POST https://www.wixapis.com/headless-business-setup/v1/headless-business/provision`
|
|
19
|
-
|
|
20
|
-
**Request Body**:
|
|
21
|
-
```json
|
|
22
|
-
{
|
|
23
|
-
"origin": "agent-<your-agent-id>",
|
|
24
|
-
"newMetasite": {
|
|
25
|
-
"namingStrategy": { "metaSiteName": "My Headless Business" },
|
|
26
|
-
"seedOptions": [
|
|
27
|
-
{ "businessSolution": "STORES", "clearTemplateContent": true, "seedDemoContent": false }
|
|
28
|
-
]
|
|
29
|
-
},
|
|
30
|
-
"synchronousSteps": ["SET_METASITE_NAME", "CONFIGURE_HEADLESS_APP"]
|
|
31
|
-
}
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
- `origin` — `agent-` followed by your own identifier: a short, stable, lowercase-hyphenated slug for the coding agent or tool you are (e.g. `claude-code`, `cursor`, `codex-cli`, `windsurf`, `github-copilot`, or your product's name; `unknown-agent` if you can't name yourself). It records which agent created the site
|
|
35
|
-
- `namingStrategy` — exactly one of: `metaSiteName` (exact display name), `llmPromptBasedName: {}` (name derived from the top-level `prompt` field), or `defaultName: {}`
|
|
36
|
-
- `seedOptions` — Wix Business Solution apps to install at creation: `STORES`, `BLOG`, `BOOKINGS`, `EVENTS`, `PORTFOLIO`, `PRICING_PLANS`. Each entry takes `clearTemplateContent` (remove sample content) and `seedDemoContent` (seed demo content). Empty installs none
|
|
37
|
-
- `synchronousSteps` — steps to complete before the call returns: `SET_METASITE_NAME`, `CONFIGURE_HEADLESS_APP`, `SEED_CONTENT`. Omitted steps run asynchronously. Include `CONFIGURE_HEADLESS_APP` when the OAuth client must be usable immediately
|
|
38
|
-
|
|
39
|
-
**Response**:
|
|
40
|
-
```json
|
|
41
|
-
{ "metaSiteId": "<SITE_ID>", "appId": "<OAUTH_CLIENT_ID>" }
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
`appId` is the site's OAuth client ID — do NOT create a separate OAuth app.
|
|
45
|
-
|
|
46
|
-
## Existing Sites
|
|
47
|
-
|
|
48
|
-
To provision headless onto an existing site, pass `"existingMetasite": {}` instead of `newMetasite`. This is a site-level call in the context of that site.
|
|
49
|
-
|
|
50
|
-
## Next Steps
|
|
51
|
-
|
|
52
|
-
After creating the site:
|
|
53
|
-
- Install additional apps using [Install Wix Apps](../app-installation/install-wix-apps.md)
|
|
54
|
-
- Add content (products, services, blog posts, etc.)
|
|
55
|
-
- Use the `appId` as the `client_id` to mint visitor tokens and make buyer-facing API calls — see [Manage OAuth Apps](manage-oauth-apps.md)
|
|
7
|
+
A Wix Headless site is a site in the user's Wix account whose frontend is files
|
|
8
|
+
uploaded to Wix hosting and served at a `*.wix-site-host.com` URL, with the Wix
|
|
9
|
+
business backend (stores, bookings, forms, a CMS) behind it through APIs.
|
|
10
|
+
Creating it, uploading its files, changing it later and connecting a backend are
|
|
11
|
+
one flow: [Upload a Website or HTML Files](upload-static-site.md), online at
|
|
12
|
+
https://dev.wix.com/docs/api-reference/account-level/sites/skills/upload-a-website-or-html-files.md
|
|
@@ -147,8 +147,8 @@ Use the `access_token` as the `Authorization` header on subsequent API calls.
|
|
|
147
147
|
|
|
148
148
|
## API Reference
|
|
149
149
|
|
|
150
|
-
- [OAuth Apps — Create](https://dev.wix.com/docs/api-reference/business-management/headless/oauth-apps/create-
|
|
151
|
-
- [OAuth Apps — Get](https://dev.wix.com/docs/api-reference/business-management/headless/oauth-apps/get-
|
|
152
|
-
- [OAuth Apps — Query](https://dev.wix.com/docs/api-reference/business-management/headless/oauth-apps/query-
|
|
153
|
-
- [OAuth Apps — Update](https://dev.wix.com/docs/api-reference/business-management/headless/oauth-apps/update-
|
|
150
|
+
- [OAuth Apps — Create](https://dev.wix.com/docs/api-reference/business-management/headless/oauth-apps/create-oauth-app)
|
|
151
|
+
- [OAuth Apps — Get](https://dev.wix.com/docs/api-reference/business-management/headless/oauth-apps/get-oauth-app)
|
|
152
|
+
- [OAuth Apps — Query](https://dev.wix.com/docs/api-reference/business-management/headless/oauth-apps/query-oauth-apps)
|
|
153
|
+
- [OAuth Apps — Update](https://dev.wix.com/docs/api-reference/business-management/headless/oauth-apps/update-oauth-app)
|
|
154
154
|
- [Retrieve Tokens — `/oauth2/token` contract, all grant types](https://dev.wix.com/docs/api-reference/business-management/headless/authentication/retrieve-tokens)
|
|
@@ -51,6 +51,10 @@ Response:
|
|
|
51
51
|
- **Wix Blog** (ID: `14bcded7-0066-7c35-14d7-466cb3f09103`)
|
|
52
52
|
```
|
|
53
53
|
|
|
54
|
+
The app list reflects installs after a delay: an app installed a few minutes ago can be missing here
|
|
55
|
+
while its own API already answers. To check an install you just made, read the site's instances with
|
|
56
|
+
[List Installed Apps](../app-installation/list-installed-apps.md), which is immediate.
|
|
57
|
+
|
|
54
58
|
### Without siteId
|
|
55
59
|
|
|
56
60
|
```bash
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: "Send Feedback to Wix"
|
|
3
|
+
description: Relay the user's feedback about building with Wix — the APIs, docs, recipes, Wix MCP and tooling — to Wix, attributed to the authenticated user. Covers when to offer it, how to compose a message Wix can act on, and the call that sends it. Use when the user asks to report something to Wix, is frustrated with a Wix API or flow, or a recipe's flow fell short. Not a support channel, and not for the user's own site content.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Send Feedback to Wix
|
|
7
|
+
|
|
8
|
+
Feedback reaches the Wix teams that own the APIs, docs, recipes and tooling.
|
|
9
|
+
It is about the experience of building with Wix, not the user's site content,
|
|
10
|
+
and it is not support.
|
|
11
|
+
|
|
12
|
+
## When to offer it
|
|
13
|
+
|
|
14
|
+
Sending is the user's call; offering is yours. Offer once per issue, in plain
|
|
15
|
+
prose, and send only after the user says yes.
|
|
16
|
+
|
|
17
|
+
- **The user asks** to tell Wix something. Confirm the wording, then send.
|
|
18
|
+
- **The user is frustrated** with Wix, or reports a Wix bug. Acknowledge it,
|
|
19
|
+
then offer.
|
|
20
|
+
- **The run hit friction**: a call that failed or needed retries, an error that
|
|
21
|
+
didn't explain itself, a doc or recipe that was wrong, missing or ambiguous, a
|
|
22
|
+
workaround you had to invent, a flow that fell back to a worse route.
|
|
23
|
+
- **At the end of a run** that hit any of these, even ones you recovered from.
|
|
24
|
+
|
|
25
|
+
When you offer, invite the user to add their own words. Never send without a
|
|
26
|
+
yes, never twice for the same issue, and never for a single transient error.
|
|
27
|
+
|
|
28
|
+
## Compose the message
|
|
29
|
+
|
|
30
|
+
Wix receives free text. A bare sentence can't be triaged, so send a summary of
|
|
31
|
+
the whole run in four parts.
|
|
32
|
+
|
|
33
|
+
**Provenance**, as labeled lines; drop the ones that don't apply:
|
|
34
|
+
|
|
35
|
+
```
|
|
36
|
+
Agent / model: <the agent and model you are>
|
|
37
|
+
Wix tooling: <Wix MCP, Wix CLI, REST from a shell, ...>
|
|
38
|
+
Recipes: <the recipes this run followed>
|
|
39
|
+
Wix products and APIs: <Stores, headless drop, the upload tool, ...>
|
|
40
|
+
Site: <metaSiteId> · dashboard: <url> · live: <url>
|
|
41
|
+
Other ids: <request ids, upload ids, execution ids>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Narrative**:
|
|
45
|
+
|
|
46
|
+
- In the user's words: what they added, verbatim. Skip when empty.
|
|
47
|
+
- What the user set out to do, and how the run went: what worked and what
|
|
48
|
+
fought back.
|
|
49
|
+
- A condensed play-by-play: the key calls, what came back, and the decisions
|
|
50
|
+
you made. Distilled, not a transcript.
|
|
51
|
+
|
|
52
|
+
**Friction points**, the heart of it. For each: the step or endpoint, the HTTP
|
|
53
|
+
status and error text, the request id, what you expected, and what you did
|
|
54
|
+
instead. Add your best guess at where the fault lives, from API behavior, API
|
|
55
|
+
schema, API docs, docs articles or examples, a recipe, the Wix MCP, Wix
|
|
56
|
+
tooling, or unsure, and say whether you confirmed it. "Unsure" beats a wrong
|
|
57
|
+
guess.
|
|
58
|
+
|
|
59
|
+
**Bottom line**: one or two sentences naming the most important problem and
|
|
60
|
+
its impact.
|
|
61
|
+
|
|
62
|
+
Show the user the final wording before sending. Leave out tokens, API keys and
|
|
63
|
+
credentials, and any personal data the feedback doesn't need.
|
|
64
|
+
|
|
65
|
+
## Send it
|
|
66
|
+
|
|
67
|
+
The call identifies the user, so it takes a user identity: a token from
|
|
68
|
+
`npx @wix/cli@latest token`, or account scope in a script. A site-scoped token
|
|
69
|
+
is refused as anonymous.
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
curl -sS -X POST "https://www.wixapis.com/mcp-serverless/v1/headless-feedback" \
|
|
73
|
+
-H "Authorization: Bearer $ACCESS_TOKEN" -H 'Content-Type: application/json' \
|
|
74
|
+
-d '{"message":"<the composed message>"}'
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
In an `ExecuteWixAPI` script, with the message as one text file in the `files`
|
|
78
|
+
param:
|
|
79
|
+
|
|
80
|
+
```javascript
|
|
81
|
+
async function run() {
|
|
82
|
+
return await wix.request({ scope: 'account', method: 'POST',
|
|
83
|
+
url: 'https://www.wixapis.com/mcp-serverless/v1/headless-feedback',
|
|
84
|
+
body: { message: files[0].content } });
|
|
85
|
+
}
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
| Response | Meaning |
|
|
89
|
+
| --- | --- |
|
|
90
|
+
| `200` with `{}` | Sent. Tell the user. |
|
|
91
|
+
| `500` "Unable to determine target user id, anonymous messages are not allowed" | The token was site-scoped. Get a user token and send once more. |
|
|
92
|
+
| `401` or `403` | The CLI login expired. Run `npx @wix/cli@latest login`, get a new token, and send once more. If it fails again, show the user the response. |
|