> To build or manage a Wix site with an AI agent, follow https://www.wix.com/headless/skill.md
> It builds a new Wix site or puts your own site online, from a prompt, and keeps changing it afterwards. The pages are code in any web technology, and Wix runs the backend.
> It works through the Wix plugin (the Wix MCP and the Wix skills), the Wix CLI or no Wix login, and puts the site live on Wix hosting or on another host.
> Business features include a store, bookings, events and tickets, a restaurant, a blog, forms, members and many more.
> Read the Wix skills online at https://www.wix.com/skills
> 
> Portal Navigation:
> 
> - Append `.md` to any URL under `https://dev.wix.com/docs/` to get its markdown version.
> - Pages are either content pages (article or reference text) or menu pages (a list of links to child pages).
> - To get a menu page, truncate any URL to a parent path and append `.md` (e.g. `https://dev.wix.com/docs/sdk.md`, `https://dev.wix.com/docs/sdk/core-modules.md`).
> - If a reference page seems to be missing its schema (parameters, return types, or type definitions), append `?schema=true` to its `.md` URL (e.g. `https://dev.wix.com/docs/contexts/contexts/stores/category-info/use-category-info-context.md?schema=true`).
> - Top-level index of all portals: https://dev.wix.com/docs/llms.txt
> - Full concatenated docs: https://dev.wix.com/docs/llms-full.txt

# Resource: Data Collections 

# Type: Data Collection Object

# Link: https://dev.wix.com/docs/api-reference/business-solutions/cms/collection-management/data-collections/data-collection-object.md

## Description: A data collection defines the fields, data types, item permissions, and plugins for a set of data items.
Use the Data Items API to store and retrieve the items themselves.

## Schema:

```json
 Type: Data Collection Object | type: DataCollection
 Description: A data collection defines the fields, data types, item permissions, and plugins for a set of data items.
Use the Data Items API to store and retrieve the items themselves.
       - name: id  | type: string | description: [Collection ID](https://dev.wix.com/docs/develop-websites-sdk/code-your-site/work-with-data/introduction/about-collections.md#collection-ids). For example, `my-first-collection`. For [app collections](https://dev.wix.com/docs/api-reference/business-solutions/cms/collection-management/wix-app-collections/introduction.md), use `AppName/CollectionName`.
       - name: collectionType  | type: string | description: Collection type. Indicates how the collection was created and how it is stored.
           enum: NATIVE, WIX_APP, BLOCKS_APP, EXTERNAL
       - name: ownerAppId  | type: string | description: ID of the app that defined this collection. For collections defined by Wix users, this value is null.
           - name: value  | type: string | description: 
       - name: maxPageSize  | type: number | description: Maximum number of items returned in a single query, based on the underlying storage. Native collections have a maximum page size of 1000 for offset-based queries or 100 for cursor-based queries. External collections' maximum page size defaults to 50, but an external provider can set any maximum value up to 1000.
           - name: value  | type: number | description: 
       - name: displayName  | type: string | description: Collection's display name as shown in the CMS. For example, `My First Collection`.  Default: The collection ID.
       - name: defaultDisplayOrder  | type: Sort | description: Default item sorting order when a query doesn't specify one.
           - name: fieldKey  | type: string | description: Field to sort by.
           - name: direction  | type: string | description: Sort order. Use `ASC` for ascending order or `DESC` for descending order.  Default: `ASC`
               enum: ASC, DESC
       - name: displayNamespace  | type: string | description: UI-friendly namespace of the Wix app with which the data collection is associated, such as Stores or Bookings. Empty for all data collections not owned by Wix apps.
       - name: displayField  | type: string | description: Field whose value the CMS displays to represent the collection item when referenced in a different collection.  Default: The first field in the request, or `title` if no fields are specified.
       - name: capabilities  | type: CollectionCapabilities | description: Capabilities the collection supports. Capabilities are set by default. Values depend on the collection type.
           - name: dataOperations  | type: Array<DataOperation> | description: Data operations the collection supports. The listed operations can be performed on data the collection contains.  > **Note**: The `PATCH` and `BULK_PATCH` operations aren't currently supported.
               enum: AGGREGATE, BULK_INSERT, BULK_REMOVE, BULK_SAVE, BULK_UPDATE, COUNT, DISTINCT, FIND, GET, INSERT, INSERT_REFERENCE, IS_REFERENCED, QUERY_REFERENCED, REMOVE, REMOVE_REFERENCE, REPLACE_REFERENCES, SAVE, TRUNCATE, UPDATE, PATCH, BULK_PATCH
           - name: collectionOperations  | type: Array<CollectionOperation> | description: Collection operations supported. The listed operations can be performed on the collection itself.
               enum: UPDATE, REMOVE
           - name: indexLimits  | type: IndexLimits | description: Maximum number of indexes for the collection.
               - name: regular  | type: number | description: Maximum number of regular (non-unique) indexes allowed for this collection.
               - name: unique  | type: number | description: Maximum number of unique indexes allowed for this collection.
               - name: total  | type: number | description: Maximum number of regular and unique indexes allowed for this collection.
       - name: fields  | type: Array<Field> | description: Collection's field structure.
           - name: key  | type: string | description: Unique identifier for the field. For example, `firstName`.
           - name: displayName  | type: string | description: Field's display name when displayed in the CMS. For example, `First Name`.
           - name: type  | type: string | description: Field's data type.  Learn more about [data types in Wix Data](https://dev.wix.com/docs/rest/business-solutions/cms/data-types-in-wix-data.md).
               enum: TEXT, NUMBER, DATE, DATETIME, IMAGE, BOOLEAN, DOCUMENT, URL, RICH_TEXT, VIDEO, ANY, ARRAY_STRING, ARRAY_DOCUMENT, AUDIO, TIME, LANGUAGE, RICH_CONTENT, MEDIA_GALLERY, ADDRESS, PAGE_LINK, REFERENCE, MULTI_REFERENCE, OBJECT, ARRAY, LEGACY_TIME, LEGACY_BOOK, LEGACY_EXTERNAL_URL, LEGACY_BROKEN_REFERENCE, LEGACY_IMAGE, LEGACY_COLOR, LEGACY_EXTERNAL_VIDEO, SLUG, EMAIL, SECURED_MEDIA, MEDIA_IMAGE, MEDIA_VECTOR_ART
           - name: typeMetadata  | type: TypeMetadata | description: Type-specific configuration, such as the referenced collection for a reference field or the calculation pattern for a page link.
               - ONE-OF:
                   - name: reference  | type: Reference | description: Metadata for a reference field.
                   - name: multiReference  | type: MultiReference | description: Metadata for a multi-reference field.
                   - name: object  | type: Object | description: Metadata for an object field.
                   - name: array  | type: Array | description: Metadata for an array field.
                   - name: pageLink  | type: PageLink | description: Metadata for a page link field.
                   - name: slug  | type: Slug | description: Metadata for a slug field.
                   - name: text  | type: Text | description: Metadata for TEXT.
                   - name: number  | type: Number | description: Metadata for NUMBER.
                   - name: date  | type: Date | description: Metadata for DATE.
                   - name: datetime  | type: Datetime | description: Metadata for DATETIME.
                   - name: image  | type: Image | description: Metadata for IMAGE.
                   - name: boolean  | type: Boolean | description: Metadata for BOOLEAN.
                   - name: document  | type: Document | description: Metadata for DOCUMENT.
                   - name: url  | type: Url | description: Metadata for URL.
                   - name: richText  | type: RichText | description: Metadata for RICH_TEXT.
                   - name: video  | type: Video | description: Metadata for VIDEO.
                   - name: arrayString  | type: ArrayString | description: Metadata for ARRAY_STRING.
                   - name: arrayDocument  | type: ArrayDocument | description: Metadata for ARRAY_DOCUMENT.
                   - name: audio  | type: Audio | description: Metadata for AUDIO.
                   - name: time  | type: Time | description: Metadata for TIME.
                   - name: richContent  | type: RichContent | description: Metadata for RICH_CONTENT.
                   - name: mediaGallery  | type: MediaGallery | description: Metadata for MEDIA_GALLERY.
                   - name: address  | type: Address | description: Metadata for ADDRESS.
                   - name: email  | type: Email | description: Metadata for EMAIL.
                   - name: legacyColor  | type: LegacyColor | description: Metadata for LEGACY_COLOR.
                   - name: mediaImage  | type: MediaImage | description: Metadata for MEDIA_IMAGE.
                   - name: mediaAudio  | type: MediaAudio | description: Metadata for MEDIA_AUDIO.
                   - name: mediaVideo  | type: MediaVideo | description: Metadata for MEDIA_VIDEO.
           - name: systemField  | type: boolean | description: Whether the field is a system field.
           - name: capabilities  | type: FieldCapabilities | description: Capabilities the field supports.
               - name: sortable  | type: boolean | description: Whether the collection can be sorted by this field.  Default: `false`
               - name: queryOperators  | type: Array<QueryOperator> | description: Query operators that can be used for this field.
           - name: encrypted  | type: boolean | description: Whether the field is encrypted.
           - name: description  | type: string | description: Field description.
           - name: readOnly  | type: boolean | description: Whether the field is read-only. A read-only field can't be changed.  Default: `false`
               - name: value  | type: boolean | description: 
           - name: immutable  | type: boolean | description: Whether the field is immutable. An immutable field can be set once, but then can't be updated.  Default: `false`
           - name: required  | type: boolean | description: Whether the field is required.  Default: `false`
           - name: plugins  | type: Array<FieldPlugin> | description: Additional optional plugins for the field.
               - name: type  | type: string | description: Field plugin type.
               - ONE-OF:
                   - name: cmsOptions  | type: CmsOptions | description: Options for the CMS plugin.
                   - name: categoryFieldOptions  | type: CategoryFieldOptions | description: Options for the CATEGORY_FIELD plugin.
           - name: condition  | type: FieldCondition | description: Conditions that control whether this field is included when retrieving data items.
               - name: groupName  | type: string | description: If `groupName` is set, this field will not be present in query results. To retrieve this field, pass `groupName` value to `includeFieldGroups` parameter in query operations.
               - name: permission  | type: string | description: If present, the field may be omitted from the results, if the requester lacks sufficient permissions to access data stored in the field.
           - ONE-OF:
               - name: numberRange  | type: NumberRange | description: Range of possible values for a numerical field.
                   - name: min  | type: number | description: Minimum permitted value for a numerical field.  Default: No validation
                   - name: max  | type: number | description: Maximum permitted value for a numerical field.  Default: No validation
               - name: stringLengthRange  | type: StringLengthRange | description: Length range permitted for a text field. Relevant for fields that hold strings, such as those of type `TEXT` or `RICH_TEXT`.
                   - name: minLength  | type: number | description: Minimum permitted length for a text field.  Default: No validation
                   - name: maxLength  | type: number | description: Maximum permitted length for a text field.  Default: No validation
               - name: arraySizeRange  | type: ArraySizeRange | description: Array size range permitted. Relevant for fields that hold arrays, such as those of type `ARRAY`, `ARRAY_STRING`, or `ARRAY_DOCUMENT`.
                   - name: minSize  | type: number | description: Minimum permitted number of items in an array field. Relevant for fields that hold arrays, such as those of type `ARRAY`, `ARRAY_STRING`, or `ARRAY_DOCUMENT`.  Default: No validation
                   - name: maxSize  | type: number | description: Maximum permitted number of items in an array field. Relevant for fields that hold arrays, such as those of type `ARRAY`, `ARRAY_STRING`, or `ARRAY_DOCUMENT`.  Default: No validation
       - name: permissions  | type: Permissions | description: [Permissions](https://dev.wix.com/docs/api-reference/business-solutions/cms/collection-management/data-collections/introduction.md#permissions) required to access and modify collection items, defined by the lowest role needed to perform each action.
           - name: insert  | type: string | description: Role required to insert items into the collection.  Default: `CMS_EDITOR`
               enum: ADMIN, SITE_MEMBER_AUTHOR, SITE_MEMBER, ANYONE
           - name: update  | type: string | description: Role required to update collection items.  Default: `CMS_EDITOR`
           - name: remove  | type: string | description: Role required to remove items from the collection.  Default: `CMS_EDITOR`
           - name: read  | type: string | description: Role required to read collection items.  Default: `SITE_MEMBER_AUTHOR`
       - name: revision  | type: string | description: Collection's current revision number, which increments each time the collection is updated. For an update operation to succeed, you must specify the latest revision number.
           - name: value  | type: string | description: 
       - name: plugins  | type: Array<Plugin> | description: Plugins the collection uses. Plugins apply additional capabilities to the collection or extend its functionality.
           - name: type  | type: string | description: Plugin type.
               enum: PUBLISH, SINGLE_ITEM, URLIZED, GRIDAPPLESS, MULTILINGUAL, SHARED, EDITABLE_PAGE_LINK, CMS, CATALOG, CATEGORIES, DRAFT_ITEMS
           - ONE-OF:
               - name: publishOptions  | type: PublishPluginOptions | description: Options for the Publish plugin. This plugin allows items in a [data collection](https://dev.wix.com/docs/rest/business-solutions/cms/data-collections/data-collection-object.md) to be marked as draft or published. Published items are visible to site visitors, while draft items are not.
                   - name: defaultStatus  | type: string | description: Publication status assigned to items that don't specify one.  Default: `PUBLISHED`.
               - name: singleItemOptions  | type: SingleItemPluginOptions | description: Options for the Single Item plugin.
                   - name: singleItemId  | type: string | description: ID of the single item in this collection. If you insert or update an item, its ID value is always changed to this.
               - name: urlizedOptions  | type: UrlizedPluginOptions | description: Options for the Urlized plugin.
                   - name: format  | type: string | description: Encoding method for generating a URL in ASCII characters.  Default: `ORIGINAL`.
               - name: multilingualOptions  | type: MultilingualOptions | description: Options for the Multilingual plugin.
                   - name: translatableFieldKeys  | type: Array<string> | description: IDs of fields to allow translation.
               - name: editablePageLinkOptions  | type: PageLinkPluginOptions | description: Options for the PageLink plugin.
                   - name: isPersisted  | type: boolean | description: Whether page link values are stored with the items.  Default: `false`.
                   - name: isMutable  | type: boolean | description: Whether page link values can be updated.  Default: `false`.
               - name: cmsOptions  | type: CmsOptions | description: Options for the CMS plugin.
                   - name: siteSort  | type: SiteSort | description: CMS sort, applied when a collection is displayed on a site.
               - name: catalogOptions  | type: CatalogOptions | description: Options for the Catalog plugin.
                   - name: name  | type: string | description: Key of the collection field that contains the catalog item's name. The referenced field must have type `TEXT`.  Use `nameFieldKey` instead. If both properties are specified, a non-empty `nameFieldKey` takes precedence.
                   - name: price  | type: string | description: Key of the collection field that contains the catalog item's price. The referenced field must have type `NUMBER`.  Use `priceFieldKey` instead. If both properties are specified, a non-empty `priceFieldKey` takes precedence.
                   - name: url  | type: string | description: Key of the collection field that contains the catalog item's URL. The referenced field must have type `URL`.  Use `urlFieldKey` instead. If both properties are specified, a non-empty `urlFieldKey` takes precedence.
                   - name: description  | type: string | description: Key of the collection field that contains the catalog item's description. The referenced field must have type `TEXT`.  Use `descriptionFieldKey` instead. If both properties are specified, a non-empty `descriptionFieldKey` takes precedence.
                   - name: image  | type: string | description: Key of the collection field that contains the catalog item's image. The referenced field must have type `IMAGE` or `MEDIA_IMAGE`.  Use `imageFieldKey` instead. If both properties are specified, a non-empty `imageFieldKey` takes precedence.
                   - name: quantity  | type: string | description: Key of the collection field that contains the catalog item's quantity. The referenced field must have type `NUMBER`.  Use `quantityFieldKey` instead. If both properties are specified, a non-empty `quantityFieldKey` takes precedence.
                   - name: digitalFile  | type: string | description: Key of the collection field that contains the catalog item's digital file. The referenced field must have type `SECURED_MEDIA`.  Use `digitalFileFieldKey` instead. If both properties are specified, a non-empty `digitalFileFieldKey` takes precedence.
                   - name: weight  | type: string | description: Key of the collection field that contains the catalog item's weight. The referenced field must have type `NUMBER`.  Use `weightFieldKey` instead. If both properties are specified, a non-empty `weightFieldKey` takes precedence.
                   - name: sku  | type: string | description: Key of the collection field that contains the catalog item's stock keeping unit (SKU). The referenced field must have type `TEXT`.  Use `skuFieldKey` instead. If both properties are specified, a non-empty `skuFieldKey` takes precedence.
                   - name: shippable  | type: string | description: Key of the collection field that indicates whether the catalog item requires shipping. The referenced field must have type `BOOLEAN`.  Use `shippableFieldKey` instead. If both properties are specified, a non-empty `shippableFieldKey` takes precedence.
                   - name: nameFieldKey  | type: string | description: Key of the collection field that contains the catalog item's name. The referenced field must have type `TEXT`.  Required when configuring the Catalog plugin.
                   - name: priceFieldKey  | type: string | description: Key of the collection field that contains the catalog item's price. The referenced field must have type `NUMBER`.  Required when configuring the Catalog plugin.
                   - name: urlFieldKey  | type: string | description: Key of the collection field that contains the catalog item's URL. The referenced field must have type `URL`.
                   - name: descriptionFieldKey  | type: string | description: Key of the collection field that contains the catalog item's description. The referenced field must have type `TEXT`.
                   - name: imageFieldKey  | type: string | description: Key of the collection field that contains the catalog item's image. The referenced field must have type `IMAGE` or `MEDIA_IMAGE`.
                   - name: quantityFieldKey  | type: string | description: Key of the collection field that contains the catalog item's quantity. The referenced field must have type `NUMBER`.
                   - name: digitalFileFieldKey  | type: string | description: Key of the collection field that contains the catalog item's digital file. The referenced field must have type `SECURED_MEDIA`.
                   - name: weightFieldKey  | type: string | description: Key of the collection field that contains the catalog item's weight. The referenced field must have type `NUMBER`.
                   - name: skuFieldKey  | type: string | description: Key of the collection field that contains the catalog item's stock keeping unit (SKU). The referenced field must have type `TEXT`.
                   - name: shippableFieldKey  | type: string | description: Key of the collection field that indicates whether the catalog item requires shipping. The referenced field must have type `BOOLEAN`.
               - name: draftItemsOptions  | type: DraftItemsPluginOptions | description: Options for the Draft Items plugin.
                   - name: draftsCollectionId  | type: string | description: ID of the drafts collection (e.g. "Posts__drafts"). Returned on published collections. Also returned on other views when both collection IDs are enabled.
                   - name: publishedCollectionId  | type: string | description: ID of the published items collection (e.g. "Posts"). Returned on drafts and combined views. Also returned on published collections when both collection IDs are enabled.
                   - name: draftPermissions  | type: DraftPermissions | description: Access levels required to view and manage drafts and change publication status.
                   - name: allowedPermissions  | type: AllowedDraftPermissions | description: Actual draft management operations permitted for the caller. Included only if requested by `includeAllowedDataPermissions`.
                   - name: allowWritesToPublishedCollection  | type: boolean | description: Whether writes to the published collection are allowed while the Draft Items plugin is enabled. Defaults to `false` for newly created collections and newly added plugins. Existing schemas that predate this field return `true` for backwards compatibility.
                   - name: draftsAndPublishedCollectionId  | type: string | description: ID of the combined drafts and published items collection (e.g. "Posts__drafts_and_published"), included on every collection view.
       - name: pagingModes  | type: Array<PagingMode> | description: Paging modes the collection supports. In native collections, offset-based paging is supported by default.
           enum: OFFSET, CURSOR
       - name: createdDate  | type: string | description: Date the collection was created.
           - name: seconds  | type: string | description: 
           - name: nanos  | type: number | description: 
       - name: updatedDate  | type: string | description: Date the collection was last updated.
       - name: allowedDataPermissions  | type: AllowedDataPermissions | description: Actual data operations permitted for the caller. Included only if requested by `includeAllowedDataPermissions`
           - name: itemRead  | type: boolean | description: If data items read permitted
           - name: itemInsert  | type: boolean | description: If for data items insert permitted
           - name: itemUpdate  | type: boolean | description: If data items update permitted
           - name: itemRemove  | type: boolean | description: If data items removal permitted
       - name: deprecation  | type: Deprecation | description: Deprecation metadata for this collection. App collections set this metadata to direct users to a replacement collection.
           - name: deprecated  | type: boolean | description: Whether this collection is deprecated.
           - name: deprecationMessage  | type: string | description: Message shown to users of a deprecated collection. Use this to identify the replacement collection.

```