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

# Handle Comment Report

> Resolve a reported comment within a space

Resolves a filed report against a comment in a space. Requires the caller to be a moderator or admin of that space.

## Path Parameters

<ParamField path="spaceId" type="string" required>
  UUID of the space.
</ParamField>

<ParamField path="reportId" type="string" required>
  UUID of the comment report to resolve.
</ParamField>

## Body Parameters

<ParamField body="commentId" type="string" required>
  UUID of the reported comment. Used when performing `remove-comment`.
</ParamField>

<ParamField body="actions" type="string[]" required>
  One or more actions to take. Must contain at least one value. Available actions:

  * `"remove-comment"` — marks the comment as removed via moderation
  * `"ban-user"` — bans the author of the reported content from the space and the child spaces where they are an active member, and ends their membership of those spaces' chats, so they can no longer post to or receive them (they keep read access to messages from before the ban). The same rules as [Ban Member](/v8/api-reference/spaces/membership/ban-member) apply, with the same errors: a moderator cannot ban a moderator or admin, only the space creator can ban an admin, and the last admin of a space cannot be banned. A refused ban rolls back the whole request, including any removal in the same request. An author who is not a member of the space (for example, who left before the report was handled) is banned all the same: the ban is kept as a banned membership, so they can't join the space or its child spaces. If the author is already banned in the space, the ban is not repeated and the rest of the request still applies; it is still re-applied to their active memberships in child spaces, under the same rules (requires `reason`)
  * `"dismiss"` — dismisses the report without action (requires `summary`; cannot be combined with other actions)
</ParamField>

<ParamField body="summary" type="string">
  Summary of the action taken. Required when using `dismiss` or any non-dismiss action.
</ParamField>

<ParamField body="reason" type="string">
  Reason for the ban, kept in the space's ban log. Required when `ban-user` is included in `actions`.
</ParamField>

## Response

Returns `201 Created`:

```json theme={null}
{ "message": "Report handled successfully", "code": "report/handled" }
```

## Error Responses

<AccordionGroup>
  <Accordion title="Report Not Found — 404">
    ```json theme={null}
    { "error": "Report not found", "code": "report/not-found" }
    ```
  </Accordion>

  <Accordion title="Report Not in Space — 404">
    ```json theme={null}
    { "error": "Report does not belong to this space", "code": "report/not-found-in-space" }
    ```
  </Accordion>

  <Accordion title="Comment Not Found — 404">
    ```json theme={null}
    { "error": "Comment not found", "code": "report/comment-not-found" }
    ```
  </Accordion>

  <Accordion title="Comment Not in Space — 404">
    ```json theme={null}
    { "error": "Comment does not belong to this space", "code": "report/comment-not-in-space" }
    ```
  </Accordion>

  <Accordion title="User Not Found — 404">
    ```json theme={null}
    { "error": "User not found in this project", "code": "report/user-not-found" }
    ```
  </Accordion>

  <Accordion title="Invalid Action Combination — 400">
    ```json theme={null}
    { "error": "Cannot combine 'dismiss' with other actions", "code": "report/invalid-actions" }
    ```
  </Accordion>

  <Accordion title="Missing Required Fields — 400">
    ```json theme={null}
    { "error": "Summary is required for dismissing a report", "code": "report/missing-fields" }
    ```

    Also returned when `ban-user` is used without `reason`:

    ```json theme={null}
    { "error": "reason is required for banning a user", "code": "report/missing-fields" }
    ```
  </Accordion>

  <Accordion title="userId Not Accepted — 400">
    `ban-user` bans the author of the reported content, so the request takes no `userId`.

    ```json theme={null}
    { "error": "userId is not accepted: ban-user bans the author of the reported content.", "code": "report/user-id-not-accepted" }
    ```
  </Accordion>

  <Accordion title="No Author — 400">
    The reported content has no author to ban (for example, its author deleted their account).

    ```json theme={null}
    { "error": "The reported content has no author to ban.", "code": "report/no-author" }
    ```
  </Accordion>

  <Accordion title="Target Mismatch — 400">
    The `commentId` sent does not match what the report is about, or the report is about another kind of content.

    ```json theme={null}
    { "error": "The supplied target id does not match the target of this report", "code": "report/target-mismatch" }
    ```

    ```json theme={null}
    { "error": "This report targets a entity, not a comment", "code": "report/target-type-mismatch" }
    ```
  </Accordion>
</AccordionGroup>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.