Sanity App SDK
    Preparing search index...

    Interface CommentBeta

    A single comment.

    Deliberately not the stored document. Comments are moving from per-dataset addon datasets to an organization-level store, and the two disagree on the document type, on how the commented document is referenced, and on where the author is recorded. Everything here reads the same on both sides, so an app written against this survives the move.

    Threads are flat: every comment in a thread shares a threadId, the thread's first comment has no parentCommentId, and replies carry that first comment's id. Use CommentThread to work with them grouped.

    interface Comment {
        authorId?: string;
        contentSnapshot?: unknown;
        createdAt: string;
        documentId: string;
        documentType: string;
        fieldPath: string;
        id: string;
        lastEditedAt?: string;
        message: CommentMessage;
        parentCommentId?: string;
        reactions: CommentReaction[];
        selection?: CommentTextSelection;
        state?: CommentLocalState;
        status: CommentStatus;
        threadId: string;
    }
    Index

    Properties

    authorId?: string

    Who wrote it.

    Absent when the server carries the author instead of the document. The Studio's comments dataset stores it on the document, so it is present on everything written today, but an agent-authored comment records attribution elsewhere. Render a fallback rather than assuming a user id.

    contentSnapshot?: unknown

    A copy of the content the comment was written about.

    createdAt: string
    documentId: string

    The document the thread hangs on, always the published id.

    documentType: string
    fieldPath: string

    The field the thread hangs off, for example title.

    id: string
    lastEditedAt?: string

    Set once the message has been rewritten.

    parentCommentId?: string

    Absent on the comment that starts a thread.

    reactions: CommentReaction[]

    Set when the comment is anchored to a run of text in a Portable Text field.

    Local only. Present while a create is failing or being retried.

    threadId: string