Sanity Library Reference Docs
    Preparing search index...

    Type Alias CreateAction

    Creates a new draft document. The published version of the document must not already exist. If the draft version of the document already exists the action will fail by default, but this can be adjusted to instead leave the existing document in place.

    type CreateAction = {
        actionType: "sanity.action.document.create";
        attributes: IdentifiedSanityDocumentStub;
        ifExists: "fail" | "ignore";
        publishedId: string;
    }
    Index

    Properties

    actionType: "sanity.action.document.create"

    Document to create. Requires a _type property.

    ifExists: "fail" | "ignore"

    ifExists controls what to do if the draft already exists

    publishedId: string

    ID of the published document to create a draft for.