> ## 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.

# Moderate Message

> Approve or remove a chat message within a space

Takes a direct moderation action on a chat message in a space's integrated conversation. Requires the caller to be a moderator or admin of the space.

## Path Parameters

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

<ParamField path="messageId" type="string" required>
  UUID of the chat message to moderate.
</ParamField>

## Body Parameters

<ParamField body="moderationStatus" type="string" required>
  The moderation action. Only `"removed"` is supported — chat messages cannot be approved via this endpoint.
</ParamField>

<ParamField body="moderationReason" type="string">
  Optional reason for the removal. Up to 1,000 characters.
</ParamField>

<ParamField body="actingUserId" type="string">
  Service or master key only: the moderator the key acts for. The request then has exactly that user's moderation permissions; omit it to act as the project.
</ParamField>

## Response

<ResponseField name="message" type="string">
  Confirmation message.
</ResponseField>

<ResponseField name="moderationStatus" type="string">
  The resulting status: `"removed"`.
</ResponseField>

## Error Responses

<AccordionGroup>
  <Accordion title="Not a Moderator — 403">
    The user named by `actingUserId` cannot moderate this space.

    ```json theme={null}
    { "error": "Moderator access required", "code": "space/moderator-required" }
    ```
  </Accordion>

  <Accordion title="Acting User Not Found — 400">
    ```json theme={null}
    { "error": "Acting user not found.", "code": "chat/acting-user-not-found" }
    ```
  </Accordion>

  <Accordion title="Unauthorized — 403">
    A user token sent an `actingUserId` other than its own user.

    ```json theme={null}
    { "error": "Unauthorized", "code": "chat/unauthorized" }
    ```
  </Accordion>
</AccordionGroup>


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