This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.
Retracts a published data item back to draft state.
By default, this method removes the published copy of the item and creates a draft seeded with the previously-published data. Set copyToDraft to false to remove the published item without creating a draft.
Pass the published collection ID as dataCollectionId (for example, articles).
After unpublishing, edit the resulting draft via Update Data Item or Patch Data Item with dataCollectionId set to your collection's drafts shadow (for example, articles__drafts). To put the item back live, call Publish Data Item Draft.
Notes:
dataItemId, it is silently overwritten with the previously-published data.copyToDraft is false, dataItem is not returned.NOT_FOUND if no published item exists with the supplied dataItemId.copyToDraft is true (the default), it also triggers a Data Item Created or Data Item Updated event on the drafts shadow collection. When copyToDraft is false, no draft is created and no events fire on the drafts shadow collection.You can only call this method when authenticated as a Wix app or Wix user identity.
This method doesn't return any custom errors, but may return standard errors. Learn more about standard Wix errors.