POST

Insert Data Item


Adds an item to a collection.

An item can only be inserted into an existing connection. You can create a new collection using the Data Collections API.

When an item is inserted into a collection, the item's ID is automatically assigned a random value. You can optionally provide a custom ID in dataItem.id when inserting the item. If you specify an ID that already exists in the collection, the insertion will fail.

If dataItem.data is empty, a new item is created with no data fields.

Authentication

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

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

Body Params
dataCollectionIdstringRequiredmaxLength 256

ID of the collection in which to insert the item.


dataItemDataItemRequired

Item to insert.


appOptionsstruct

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.
Response Object
dataItemDataItem

Inserted data item.

Request
cURL
Response
JSON
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?