Warning: Wix Data APIs currently require the site's code editor to be enabled manually. For this reason, we recommend against using these APIs for developing Wix CLI apps and self-hosted apps.
The Wix Data API provides a complete solution for accessing, organizing, configuring, and managing data stored in a Wix site's database.
With the Wix Data API, you can:
It's important to note the following points before starting to code:
[a-zA-Z_][a-zA-Z0-9_-]{0,63}
.When calling a Wix Data endpoint, it may take some time to receive a response. Wix Data places limits on how long a response can take before your request times out. If the response time exceeds this limit, Wix Data returns an error instead of the intended result.
Request timeouts vary depending on the site owner's Wix plan and the type of collection accessed:
Collection Type | Wix plan | Timeout |
---|---|---|
CMS collections | Free sites, premium sites (excl. Elite and Business Elites) | 5 seconds |
CMS collections | Business Elite & Elite Premium | 10 seconds |
External Database Collections | All plans | 15 seconds |
Access to a data collection is controlled by its permissions. These permissions are defined in the collection object and they specify which types of user can perform actions on the data contained in the collection.
Wix Data recognizes 4 roles:
ADMIN
: The site owner.SITE_MEMBER_AUTHOR
: A signed-in user who has added content to the collection.SITE MEMBER
: Any signed-in user.ANYONE
: Any site visitor.For each of the 4 basic actions (inserting, updating, removing, and reading content) the minimal role required must be set. For example, if you want to allow only site members to view data, and only the site owner to insert, update, and remove data, declare your permissions as follows:
insert
: ADMIN
update
: ADMIN
remove
: ADMIN
read
: SITE_MEMBER