# AnnotationsApi.comments()

```ts
comments(pageIndex?: number): Promise<CommentThread[]>
```

The page's comments as `CommentThread[]` (every page's, in page order, without `pageIndex`): each markup annotation with its replies, its reviewers' latest statuses and the latest status. Links, form fields, pop-ups and hidden comments are left out. Contents and authors are blank as `list()` blanks them without `extract`. Needs no feature.

- Kind: method
- Since: 1.0.0

| Parameter | Type | Description |
| --- | --- | --- |
| `pageIndex?` | `number` | Zero-based page index. Omit for every page's, in page order. |

Returns `Promise<CommentThread[]>`: Each `{ comment, replies, statuses, status }`: the annotation commented on, its replies (replies to replies included, oldest first), each reviewer's latest status entry (oldest first) and the latest status any reviewer set, or `null`.

Throws:

- `INVALID_ARGUMENT` — a page index out of range.
- `DOCUMENT_CLOSED` — the document has been closed.

```ts
for (const thread of await doc.annotations.comments()) {
  console.log(thread.comment.author, thread.replies.length, 'replies', thread.status);
}
```

Part of [AnnotationsApi](https://kernstra.com/docs/web-sdk/api/doc-annotations) in the Kernstra Web SDK 1.0.0 API reference.

Web page: https://kernstra.com/docs/web-sdk/api/doc-annotations/comments
