Sanity Library Reference Docs
    Preparing search index...

    Interface CollaborationCommentDocumentAlpha

    A comment document, as stored by the Comments API.

    interface CollaborationCommentDocument {
        _createdAt: string;
        _id: string;
        _originalId?: string;
        _rev: string;
        _system?: { createdBy?: string };
        _type: "sanity.comment";
        _updatedAt: string;
        contentSnapshot?: CollaborationCommentPortableTextBlock[];
        context?: Record<string, unknown>;
        lastEditedAt?: string;
        message: CollaborationCommentMessage;
        parentCommentId?: string;
        reactions: {
            _key: string;
            addedAt: string;
            shortName: CollaborationCommentReactionShortName;
            userId: string;
        }[];
        status: CollaborationCommentStatus;
        target: {
            document: {
                _ref: `${string}:${string}:${string}`;
                _type: "globalDocumentReference";
                _weak: true;
            };
            documentRevisionId?: string;
            documentType: string;
            path?: { field: string; selection?: CollaborationCommentSelection };
            sourceDocumentId: string;
        };
        threadId?: string;
        [key: string]: any;
    }

    Indexable

    • [key: string]: any
    Index

    Properties

    _createdAt: string
    _id: string
    _originalId?: string

    Present when perspective is set to previewDrafts

    _rev: string
    _system?: { createdBy?: string }

    Type declaration

    • OptionalcreatedBy?: string

      ID of the user that created the comment

    _type: "sanity.comment"
    _updatedAt: string

    Copy of the commented content, as it looked when the comment was created. Set for inline comments only, and holds just the selected fragment of each Portable Text block the selection spans.

    context?: Record<string, unknown>

    Arbitrary metadata stored with the comment by the creating application

    lastEditedAt?: string

    Set when the message has been updated after creation

    parentCommentId?: string

    Set on replies, pointing to the comment being replied to

    reactions: {
        _key: string;
        addedAt: string;
        shortName: CollaborationCommentReactionShortName;
        userId: string;
    }[]
    target: {
        document: {
            _ref: `${string}:${string}:${string}`;
            _type: "globalDocumentReference";
            _weak: true;
        };
        documentRevisionId?: string;
        documentType: string;
        path?: { field: string; selection?: CollaborationCommentSelection };
        sourceDocumentId: string;
    }

    Type declaration

    • document: {
          _ref: `${string}:${string}:${string}`;
          _type: "globalDocumentReference";
          _weak: true;
      }

      Global document reference (resourceType:resourceId:documentId, using the published document ID)

    • OptionaldocumentRevisionId?: string
    • documentType: string
    • Optionalpath?: { field: string; selection?: CollaborationCommentSelection }

      Set for field and inline comments. field is the path the comment was created with; selection is set for inline comments only.

    • sourceDocumentId: string

      The exact document ID the comment was created against, e.g. a draft or version ID

    threadId?: string

    ID shared by a top-level comment and all of its replies