POST

Publish 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.

Publishes a pending draft of a data item.

This method replaces the published item's data with the draft's content. On success, the draft is deleted.

Pass the published collection ID as dataCollectionId (for example, articles).

To author a brand-new draft, call Insert Data Item with dataCollectionId set to your collection's drafts shadow (for example, articles__drafts when the published collection ID is articles). Edit the draft via Update Data Item or Patch Data Item against the same drafts shadow collection ID.

To retract a published item back to draft state, call Unpublish Data Item.

Notes:

  • Returns NOT_FOUND if no pending draft exists for the supplied dataItemId.
  • Calling this method triggers domain events on both collections: a Data Item Created or Data Item Updated event on the published collection, and a Data Item Deleted 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/publish-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?