Data Types in Wix Data

The Wix Data APIs support a wide range of data types, including numbers, plain and rich text, arrays, URLs, media files, and more. The APIs accept and return data in JSON format, so it’s important to understand the structure and formatting specific to each data type. To ensure data consistency and minimize potential errors, follow these formats when querying, inserting, and updating items in a collection.

Wix Data works with a schemaless database behind the scenes. In theory, you can store any type of data in any database collection field. In practice, however, it's best to conform to each collection’s schema as defined either in the Content Management System (CMS) or when using the Data Collections API. The schema is used to determine which page elements can connect to which fields and to provide a better experience for site admins when using the CMS. For example, if a field's type is set to Date and Time, its values will appear as dates in the CMS. Site admins can then connect that field to site elements that work with dates.

Field types and data types

The following table lists supported field types along with their corresponding data type and format.

Field TypeData TypeFormat
AddressObjectAn Address object. See the Address Object's structure structure.
ArrayArray
AudioStringA web URL or a Media Manager URL.

Learn more about working with media files.
BooleanBooleantrue or false
DateStringA date string in ISO 8601 date format: YYYY-MM-DD.
Date and TimeObjectAn object in the following format: "someFieldKey": { "$date": "YYYY-MM-DDTHH:mm:ss.sssZ"}

Note: Milliseconds can be omitted: "$date": "YYYY-MM-DDTHH:mm:ss"
DocumentStringA web URL or a Media Manager URL.

Learn more about working with media files.
ImageStringA web URL or a Media Manager URL.

Learn more about working with media files.
Media GalleryArray of image and video URLsArray items are either web URLs or Media Manager URLs.

Learn more about working with media files.
NumberNumber
ObjectObject
Rich ContentObjectA rich content object. Learn more about working with rich content.
Rich TextStringA string that may contain a subset of HTML tags.
Single Reference/ Multi- ReferenceSingle Reference: String/ object

Multi-reference: Array of strings/ array of objects
An item ID or multiple item IDs from the referenced collection. See Query Referenced Data Items to learn about item references.
TagsArray of strings
TextString
TimeStringA string in hh:mm:ss.SSS format.
URLStringA valid URL.
VideoStringA web URL or a Media Manager URL.

Learn more about working with media files.

Working with media files

With the Wix Data APIs, you can manage media items of any supported type. Items can be stored on an external service, or directly on Wix using the Wix Media Manager. Learn more about which data types are supported in the Media Manager.

To learn about uploading files to the Media Manager, see the Upload API and the Resumable Upload API. To learn how media items are stored in the Media Manager, see the List Files and Get File Descriptors endpoints.

Address object

Address objects have the following structure:

NameTypeDescription
formattedStringAddress in human-readable format.
locationObjectAddress coordinates
location.latitudeNumberAddress latitude
location.longitudeNumberAddress longitude
streetAddressObjectAddress street name and number
streetAddress.nameStringStreet name
streetAddress.numberNumberStreet number
cityStringAddress city
subdivisionStringAddress subdivision of a country, such as a state or province
countryStringAddress country
postalCodeStringAddress postal code
Did this help?