POST

Save Data Item


Inserts or updates an item in a collection.

Call this method when your workflow needs upsert behavior: create a new item when the ID doesn't exist yet, and update the existing item when the same ID is reused (for example, a rerunnable import or sync). For different behavior, you can call:

  • Patch Data Item to change only specific fields and keep the rest of the existing data unchanged.
  • Update Data Item when you want the request to fail if the item doesn't already exist.

This method inserts or updates the specified item, depending on whether it already exists in the collection:

  • If you don't provide an ID, a new item is created.

  • If you provide an ID that doesn't exist in the collection, a new item is created with that ID.

  • If an item with the ID you provide already exists in the collection, that item is updated. When an item is updated, its data._updatedDate field is changed to the current date and time.

Note: When you provide an item with an ID that already exists in the collection, the data you provide in dataItem.data replaces the existing item with that ID. This means that the item's previous fields and values are lost.

Authentication

You can only call this method when authenticated as a Wix app or Wix user identity.

Permissions
Write Data Items
Learn more about app permissions.
Endpoint
POST
https://www.wixapis.com/wix-data/v2/items/save

Errors

This method doesn't return any custom errors, but may return standard errors. Learn more about standard Wix errors.

Event TriggersThis method triggers the following events:
Did this help?