Sanity Library Reference Docs
    Preparing search index...

    Interface PublishVariantActionBeta

    Publishes a variant version of a document, replacing the published variant and removing the source variant document.

    interface PublishVariantAction {
        actionType: "sanity.action.document.variant.publish";
        bundleId: "drafts" | string & {};
        ifPublishedVariantRevisionId?: string;
        ifVersionRevisionId?: string;
        publishedId: string;
        variantId: string;
    }
    Index

    Properties

    actionType: "sanity.action.document.variant.publish"
    bundleId: "drafts" | string & {}

    Bundle to publish from: 'drafts', or a release id.

    ifPublishedVariantRevisionId?: string

    When set, publishing fails unless the current revision of the published variant document matches this value.

    ifVersionRevisionId?: string

    When set, publishing fails unless the current revision of the source variant document matches this value.

    publishedId: string

    ID of the document group the variant belongs to. Must be a published document ID, without a drafts. or versions. prefix.

    variantId: string

    Name of the variant definition this document belongs to, as in _.variants.{variantName}. Must be a bare name, not a full document ID.