# chat.moderate

Source: https://docs.lightair.app/developers/remote-api/chat.moderate

> Deletes a chat message, or times out or bans its sender, as the account signed in to that platform.

JSON-RPC 2.0 method of Lightair's Remote API (ws://localhost:4455/rpc). Group: Chat and voice. Script plugins need the `project.write` permission.

Works where Lightair can moderate that platform's chat, as the Chat panel's buttons do. Timeouts last `seconds`, 600 by default, at most two weeks.

## Parameters

| Name | Type | Required | Description |
|---|---|---|---|
| `message` | `string | number` | yes | The message's `id`, or its platform id. |
| `action` | `string` | yes | `delete`, `timeout` or `ban`. |
| `seconds` | `number` | no | A timeout's length. `duration_s` is taken too. |
| `reason` | `string` | no | Why. |

## Result

| Name | Type | Required | Description |
|---|---|---|---|
| `done` | `boolean` | no | true. |

## Errors

Invalid params (-32602) without `action`, or for an unknown one. Not found (-32004) for an unknown message. A state error (-32005) where that platform can't be moderated from Lightair, when the message has no platform id (delete) or no sender (timeout, ban), for `unban`, or when the platform refuses.

## From an AI agent

The MCP server's `moderate_chat (action: delete, timeout or ban)` reaches this method.

## Example

```json
{ "jsonrpc": "2.0", "id": 1, "method": "chat.moderate", "params": { "message": 1042, "action": "timeout", "seconds": 300 } }
```

Result:

```json
{ "done": true }
```

## Related

- [chat.history](https://docs.lightair.app/developers/remote-api/chat.history.md)
