# Comments and Auto-Hide

> Read the Facebook and Instagram comments on your Mojeeb agent's pages, see which ones the AI hid and why, hide or show a comment, and switch comment auto-hide on or off through the Public API.

Mojeeb's AI answers comments on your Facebook pages and Instagram accounts and, with comment auto-hide on, hides abusive, spam and similar ones. With the Public API you can read those comments with the reply under each and its moderation, hide or show a comment from your own moderation tools, and switch auto-hide on or off. The comments live under `/v1/agents/{agentId}/comments`.

## How do I list an agent's comments?

`GET` them, newest first. Filter with `moderation_status`, `platform` or `post_id`; this lists everything hidden now:

```bash
curl "https://api.mojeeb.app/v1/agents/YOUR_AGENT_ID/comments?moderation_status=hidden" \
  -H "Authorization: Bearer mk_live_YOUR_KEY_HERE"
```

Each comment carries what was written, who wrote it, the reply under it (`reply`) and its moderation (`moderation`). The list holds the comments Mojeeb recorded on the agent's connected Facebook and Instagram accounts; those of an account you disconnected or moved to another agent are left out. Unlike the Comments page, it keeps an account's earlier comments while the account's comment replies and the agent's auto-hide are both off. See the [List comments reference](../api-reference/list-comments).

## How do I read a comment's moderation?

Read `moderation`, not `reply.status`, which tracks only the reply: a hidden comment's reply can read `skipped`, `failed` or `replied`. A null `moderation.status` means the comment was never checked, for example because auto-hide was off when it arrived. A comment shown again reads `unhidden` and is never auto-hidden again. `hidden_by: platform` means it was hidden on Facebook or Instagram itself, by Facebook's own filter or by someone in Meta Business Suite. Every value is described in the [Get a comment reference](../api-reference/get-comment).

## How do I hide or show a comment?

`POST` to the comment's `hide` or `unhide`:

```bash
curl -X POST https://api.mojeeb.app/v1/agents/YOUR_AGENT_ID/comments/COMMENT_ID/hide \
  -H "Authorization: Bearer mk_live_YOUR_KEY_HERE"
```

It works like **Hide comment** and **Unhide comment** on the Comments page, and returns the comment. A hidden comment leaves public view but isn't deleted, and it gets no reply. A comment you unhide is never auto-hidden again. Hiding one that's already hidden returns `422 comment_already_hidden`, showing one that isn't hidden returns `422 comment_not_hidden`, and `422 platform_hide_failed` means Facebook or Instagram refused or couldn't be reached, for example because the comment was deleted. That one can be temporary, so try again later. If a hide or unhide fails with a `500` and you retry, `comment_already_hidden` or `comment_not_hidden` means the first one went through. See the [Hide a comment reference](../api-reference/hide-comment).

## How do I switch comment auto-hide on or off?

It's an agent setting, so `PATCH` the agent with `comment_auto_hide_enabled`:

```bash
curl -X PATCH https://api.mojeeb.app/v1/agents/YOUR_AGENT_ID \
  -H "Authorization: Bearer mk_live_YOUR_KEY_HERE" \
  -H "Content-Type: application/json" \
  -d '{ "comment_auto_hide_enabled": false }'
```

It's on by default. While it's on, the AI checks every new comment on the agent's Facebook and Instagram accounts, even where a connection's `respond_to_comments` is off, and hides what Mojeeb's rules and your Main Instructions say to hide. See [Social Comments](/docs/features/social-comments#how-does-comment-auto-hide-work) for what gets hidden and how to tailor it.

## Common questions

### Can the API delete a comment?

No. Neither the AI nor the API deletes comments. They only hide them, which you can undo.

### Does hiding count toward my message limit?

No. Only the AI's replies count. Once the limit is reached the AI stops replying but keeps hiding; without an active subscription it does neither.

### Do changes made on Facebook or Instagram show here?

Facebook's do, within seconds: a comment hidden or shown there updates `moderation`, with `hidden_by: platform` for a hide. Instagram doesn't tell Mojeeb, so a change made in the Instagram app shows only after someone opens that post on the Comments page; listing comments through the API doesn't check Instagram.

### Which scopes do these calls need?

`comments:read` to list and read comments, and `comments:write` to hide and show them. Changing `comment_auto_hide_enabled` needs `agents:write`. Every key holds them today; see [Authentication](../authentication).
