Skip to content

CommentsManager

add(sheetName, comment): ThreadedComment;

Add a new threaded comment to the given sheet. The comment’s person (and any mentioned persons in runs) are auto-registered into the workbook’s people list if not already present.

string

AddCommentInput

ThreadedComment

the created ThreadedComment

if the sheet does not exist

if text is empty

if ref is not a valid cell reference

if datetime is provided but not a valid ISO date string

if parentId is set but no matching comment exists

if parentId refers to a reply (nested replies are not allowed)

if the reply’s ref does not match the parent comment’s ref


delete(sheetName, id): void;

Delete a comment and all its replies from the given sheet.

string

string

void

if the sheet does not exist

if the comment is not found


get(sheetName, options): ThreadedComment[];

Get all comments on the given sheet.

Copies are returned to prevent external mutation of the sheet’s comments.

string

name of the sheet

FilterOptions = {}

filtering options

ThreadedComment[]

if the sheet does not exist


getByCell(
sheetName,
ref,
options?): ThreadedComment[];

Get comments attached to a specific cell on the given sheet.

string

name of the sheet

string

cell reference in A1 notation

FilterOptions

same filtering as get()

ThreadedComment[]

array of comments for that cell (defensive copies)

if the sheet does not exist


update(
sheetName,
id,
updates): void;

Update an existing threaded comment on the given sheet. Note: ref is not updatable through this API; cell moves are handled by updateAnnotationRefs.

string

string

Partial<Pick<ThreadedComment, "text" | "resolved" | "runs">>

void

if the sheet does not exist

if the comment is not found

if text is empty

if resolved is set on a reply comment