CMS Schema Management

Download skill
Copy

This recipe covers managing the structure (schema) of Wix CMS collections using the REST API.

Prerequisites

  1. Wix CMS enabled on the site
  2. API access with CMS permissions (Manage Data Collections scope)

Required APIs

  • Collections API: REST

List All Collections

Lightweight listing (recommended for existence checks):

Copy

Full listing (includes all field schemas):

Copy

Collection Types: NATIVE (user-created), WIX_APP (Wix app collections), BLOCKS_APP, EXTERNAL

Get Collection Schema

Endpoint: GET /wix-data/v2/collections/{collectionId}

Copy

Create a New Collection

Endpoint: POST /wix-data/v2/collections

Copy

Add a Field to Existing Collection

Endpoint: POST /wix-data/v2/collections/create-field

Copy

Delete a Field from Collection

Warning: This permanently deletes all data stored in this field across all items.

Endpoint: POST /wix-data/v2/collections/delete-field

Copy

Update Collection Settings

Endpoint: PATCH /wix-data/v2/collections/{collectionId}

Copy

Field Types Reference

TypeDescriptionExample Value
TEXTString"Hello World"
NUMBERNumeric99.99
BOOLEANTrue/falsetrue
DATEDate only"2024-01-15"
DATETIMEDate and time{ "$date": "2024-01-15T10:00:00.000Z" }
IMAGEImage reference"wix:image://v1/..."
URLWeb URL"https://example.com"
RICH_TEXTHTML content"<p>Rich text</p>"
ARRAY_STRINGArray of strings["tag1", "tag2"]
OBJECTJSON object{"key": "value"}
REFERENCESingle referenceItem ID string
MULTI_REFERENCEMultiple referencesArray of IDs

Permission Levels

RoleDescription
ANYONEAll visitors (including anonymous)
SITE_MEMBERLogged-in site members
SITE_MEMBER_AUTHORMembers who created the item
ADMINSite admins only
Did this help?