# Answer comments

> Read comment threads, reply and moderate, safely against changes on the network.

Comments arrive in threads: a top comment with its replies, on one account's video or post.

## Read threads

```bash
curl "https://api.nowscale.com/v1/comments/threads?status=needs_reply&limit=50" \
  -H "Authorization: Bearer $NOWSCALE_API_KEY"
curl "https://api.nowscale.com/v1/comments/threads/THREAD_ID" \
  -H "Authorization: Bearer $NOWSCALE_API_KEY"
```

A thread carries `conversation_version`, which changes whenever its conversation changes on the network.

## Reply

```bash
curl https://api.nowscale.com/v1/comments/threads/THREAD_ID/replies \
  -H "Authorization: Bearer $NOWSCALE_API_KEY" \
  -H "Content-Type: application/json" \
  -H "Idempotency-Key: reply-THREAD_ID-1" \
  -d '{ "text": "Thank you! The full tutorial is on our channel.", "expected_conversation_version": 7 }'
```

`expected_conversation_version` is the version you read. If the conversation changed in the meantime, the reply is not sent and the API answers `409 conversation_changed`: read the thread again and decide. `reply_to_comment_id` answers a specific comment instead of the top one.

## Moderate

`POST /v1/comments/threads/{thread_id}/comments/{comment_id}/moderate` with an `action`: `approve`, `hide`, `unhide`, `reject`, `ban_author` or `delete`, where the network supports it.

## Who can reply

Replies and moderation go out through the connected account, and today only the person who connected that account can act on its comments, from the app or with their own personal key. Other keys can read the thread but get `403 comment_custodian_required` when they reply.

Networks cap comment actions per day; past that, the API answers `429 comment_limit_reached` until the next day.
