> ## Documentation Index
> Fetch the complete documentation index at: https://docs.replyke.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Moderation

> Moderate content and handle reports within a space

Space moderators and admins can review and act on content in their space. Moderation includes directly approving or removing entities and comments, as well as handling reports submitted by members.

## Direct Moderation

Moderators can act on specific entities or comments without a report being filed:

```tsx theme={null}
import { useModerateSpaceEntity, useModerateSpaceComment } from "@replyke/react-js";

const moderateEntity = useModerateSpaceEntity();
const moderateComment = useModerateSpaceComment();

// Approve or remove an entity
await moderateEntity({ spaceId, entityId, action: "approve" });
await moderateEntity({ spaceId, entityId, action: "remove" });

// Approve or remove a comment
await moderateComment({ spaceId, commentId, action: "approve" });
await moderateComment({ spaceId, commentId, action: "remove" });
```

<Note>Both hooks require the caller to be a moderator or admin of the space.</Note>

## Handling Reports

When members report content, moderators receive those reports and can resolve them:

```tsx theme={null}
import {
  useHandleSpaceEntityReport,
  useHandleSpaceCommentReport,
} from "@replyke/react-js";

const handleEntityReport = useHandleSpaceEntityReport();
const handleCommentReport = useHandleSpaceCommentReport();

// Dismiss a report or take action
await handleEntityReport({ spaceId, reportId, action: "dismiss" });
await handleEntityReport({ spaceId, reportId, action: "remove_content" });

await handleCommentReport({ spaceId, reportId, action: "dismiss" });
await handleCommentReport({ spaceId, reportId, action: "remove_content" });
```

## Fetching Reports

Use `useFetchModeratedReports` to retrieve pending reports for a space:

```tsx theme={null}
import { useFetchModeratedReports } from "@replyke/react-js";

const fetchReports = useFetchModeratedReports();
const reports = await fetchReports({ spaceId });
```

<Tip>Reports appear in the list until they are resolved. Filter by `status: "pending"` in your UI to show actionable items.</Tip>

## Chat Moderation

Spaces with integrated chat also support message moderation via the API. See the [Space Chat API](/api-reference/spaces/chat/get-space-conversation) for details on moderating chat messages within a space.

## Hook Reference

| Hook                                                                            | Description                            |
| ------------------------------------------------------------------------------- | -------------------------------------- |
| [`useModerateSpaceEntity`](/hooks/spaces/use-moderate-space-entity)             | Approve or remove an entity in a space |
| [`useModerateSpaceComment`](/hooks/spaces/use-moderate-space-comment)           | Approve or remove a comment in a space |
| [`useFetchModeratedReports`](/hooks/reports/use-fetch-moderated-reports)        | Fetch pending content reports          |
| [`useHandleSpaceEntityReport`](/hooks/reports/use-handle-space-entity-report)   | Resolve a reported entity              |
| [`useHandleSpaceCommentReport`](/hooks/reports/use-handle-space-comment-report) | Resolve a reported comment             |
