# count_open_comments

Source: https://modulify.ai/docs/api/comments/count-open-comments

Counts the open comment threads on a site, the number the product shows on the comments badge.

- Title: Count the open comments
- Scope: `comments:read`
- Access: Read only
- Endpoint: `POST /v1/count_open_comments`

Only open root threads count. Resolved and deleted threads are not counted, and neither are replies, so the number can be smaller than the number of threads `list_comments` returns. Threads opened by people outside the workspace through the shared link are counted too.

Use it to find out whether anything is left to address without reading every thread. Resolving a thread with `resolve_comment` takes it off the count, and `reopen_comment` puts it back. See [Comments](https://modulify.ai/docs/editor/comments).

## Request

Call it with a `POST` to `https://api.modulify.ai/v1/count_open_comments`, sending the inputs below as a JSON object. The token needs the `comments:read` scope.

It only reads and changes nothing, so retrying it is safe.

```bash
curl -X POST https://api.modulify.ai/v1/count_open_comments \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"projectId":"PROJECT_ID"}'
```

Over MCP, the same method is the [count_open_comments tool](https://modulify.ai/docs/mcp/comments/count-open-comments).

## Inputs

| Input | Type | Required | Description |
| --- | --- | --- | --- |
| `projectId` | string | Yes | The site id. |

## Response

Every call answers with the [JSON envelope](https://modulify.ai/docs/api/requests-and-responses#the-response) of `success`, `message`, `data`, `code` and `version`. `data` holds the result described above, and on a method that returns a total, `count` carries it. The [response headers](https://modulify.ai/docs/api/requests-and-responses#headers-on-every-method-call) carry the call's `X-Request-Id` and what is left of your per-minute budget in `X-RateLimit-Limit`, `X-RateLimit-Remaining` and `X-RateLimit-Reset`. [Errors](https://modulify.ai/docs/api/errors) explains every status code a call can answer with.