POST

Create Data Item Draft


Developer Preview

This API is subject to change. Bug fixes and new features will be released based on developer feedback throughout the preview period.

Creates a draft copy of a published data item in the corresponding {dataCollectionId}__drafts shadow collection.

The published item remains live and unchanged. To retract a published item and convert it to a draft in one step, use Unpublish Data Item instead.

Returns ALREADY_EXISTS if a draft already exists for this item. To check first, query the {dataCollectionId}__drafts collection before calling this method.

After creating the draft, edit it via Update Data Item or Patch Data Item against the {dataCollectionId}__drafts collection. To put the edits live, call Publish Data Item Draft.

Notes:

  • The response carries the newly-created draft, not the published item.
  • Returns NOT_FOUND if no published item exists with the supplied dataItemId.
  • Calling this method triggers a Data Item Created event on the drafts shadow collection.
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/create-draft

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?