Updates multiple items in a collection.
This method replaces each specified data item's existing data with the payload provided in the request.
Each item in the request must include an ID. If an item is found in the specified collection with the same ID, that item is updated. If the collection doesn't contain an item with that ID, the update fails.
When an item is updated, its data._updatedDate
field is changed to the current date and time.
Note: After each item is updated, it only contains the fields included in the request. If the existing item has fields with values and those fields aren't included in the updated item, their values are lost.
You can only call this method when authenticated as a Wix app or Wix user identity.
ID of the collection in which to update items.
Data items to update.
Whether to return the updated data items.
When true
, the results
objects contain a dataItem
field.
Default: false
Additional parameters specific to the Wix app collection you are querying.
When querying the Wix Stores Products collection, pass the following optional parameters:
includeHiddenProducts
: Whether to include hidden products in the response. Default: false
.includeVariants
: Whether to include product variants in the query. Default: false
.Options for the Publish plugin. This plugin allows items in a data collection to be marked as draft or published. Published items are visible to site visitors, while draft items are not.
Information about the updated items.
Bulk action metadata.
curl -X POST \
'https://www.wixapis.com/wix-data/v2/bulk/items/update' \
-H 'Content-Type: application/json' \
-H 'Authorization: <AUTH>' \
-d '{
"dataCollectionId": "cities",
"dataItems": [
{
"id": "40877d18-c5fe-4ed5-b495-d84bb4c027bd",
"data": {
"state": "California",
"year": 2022,
"city": "Los Angeles",
"population": 3800000
}
},
{
"id": "6c38b4f7-7b8d-4702-9283-66a5889f8e17",
"data": {
"state": "California",
"year": 2022,
"city": "San Francisco",
"population": 840000
}
}
]
}'
{
"results": [
{
"action": "UPDATE",
"itemMetadata": {
"id": "40877d18-c5fe-4ed5-b495-d84bb4c027bd",
"originalIndex": 0,
"success": true
}
},
{
"action": "UPDATE",
"itemMetadata": {
"id": "6c38b4f7-7b8d-4702-9283-66a5889f8e17",
"originalIndex": 1,
"success": true
}
}
],
"bulkActionMetadata": {
"totalSuccesses": 2,
"totalFailures": 0
}
}
This method doesn’t return any custom errors, but may return standard errors. Learn more about standard Wix errors.