Type Alias UnpublishAction

UnpublishAction: {
    actionType: "sanity.action.document.unpublish";
    draftId: string;
    publishedId: string;
}

Retracts (unpublishes) a published document. Creates draft from published if none exists. Deletes the published version.

Type declaration

  • actionType: "sanity.action.document.unpublish"
  • draftId: string

    Draft document ID to keep/create

  • publishedId: string

    Published document ID to delete

await client.action({
actionType: 'sanity.action.document.unpublish',
draftId: 'drafts.bike-123',
publishedId: 'bike-123'
})