Type Alias DeleteAction

DeleteAction: {
    actionType: "sanity.action.document.delete";
    includeDrafts: string[];
    publishedId: string;
    purge?: boolean;
}

Deletes the published version and optionally drafts. Fails if any unspecified drafts exist. Can optionally purge document history.

Type declaration

  • actionType: "sanity.action.document.delete"
  • includeDrafts: string[]

    Draft document IDs to delete

  • publishedId: string

    Published document ID to delete

  • Optionalpurge?: boolean

    Whether to delete document history

await client.action({
actionType: 'sanity.action.document.delete',
publishedId: 'bike-123',
includeDrafts: ['drafts.bike-123'],
purge: true
})