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 token --site "$SITE_ID".
This recipe covers managing the structure (schema) of Wix CMS collections using the REST API.
Lightweight listing (recommended for existence checks):
Full listing (includes all field schemas):
Collection Types: NATIVE (user-created), WIX_APP (Wix app collections), BLOCKS_APP, EXTERNAL
Endpoint: GET /wix-data/v2/collections/{collectionId}
Endpoint: POST /wix-data/v2/collections
Endpoint: POST /wix-data/v2/collections/create-field
Warning: This permanently deletes all data stored in this field across all items.
Endpoint: POST /wix-data/v2/collections/delete-field
Endpoint: PATCH /wix-data/v2/collections/{collectionId}
| Type | Description | Example Value |
|---|---|---|
TEXT | String | "Hello World" |
NUMBER | Numeric | 99.99 |
BOOLEAN | True/false | true |
DATE | Date only | "2024-01-15" |
DATETIME | Date and time | { "$date": "2024-01-15T10:00:00.000Z" } |
IMAGE | Image reference | "wix:image://v1/..." |
MEDIA_IMAGE | Wix Media Image | { "url": "http://...", "height": 640, "width": 480, "alt": "Picture" } |
MEDIA_VECTOR_ART | Wix Media Vector Art | { "uri": "wix:vector://v1/...", "viewBox": "0 0 100 100", "contentType": "shape", "svgContent": "<svg>...</svg>" } |
URL | Web URL | "https://example.com" |
RICH_TEXT | HTML content | "<p>Rich text</p>" |
ARRAY_STRING | Array of strings | ["tag1", "tag2"] |
OBJECT | JSON object | {"key": "value"} |
REFERENCE | Single reference | Item ID string |
MULTI_REFERENCE | Multiple references | Array of IDs |
| Role | Description |
|---|---|
ANYONE | All visitors (including anonymous) |
SITE_MEMBER | Logged-in site members |
SITE_MEMBER_AUTHOR | Members who created the item |
ADMIN | Site admins only |