Chat
Base: /api/chat
The chat section has two jobs. With GET you read the event log of the server, mainly player chat but also joins, leaves, broadcasts and permission changes. With POST you send a broadcast message to all players. This lets you build, for example, a chat mirror to Discord, a notice when someone joins, or an announcement from your panel. Everything the mod records is stored as a text file per event type, there is no database.
/api/chat
Get chat and events
Returns the latest entries of an event log as a list of JSON objects, oldest first. The default is playerChat. Other event types the mod writes: playerJoin, playerLeave, broadcast, groupPermissionChange and playerPermissionChange. Every entry contains timestamp (ISO time with time zone), server and, depending on the type, player, message, group, action or permissions.
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
limit
|
integer | No | Number of entries, default 50 |
eventType
|
string | No | Event log to read (letters, digits, _), default playerChat |
Response Example
[
{
"server": "main",
"player": "Steve",
"message": "hello"
}
]
cURL
curl -X GET 'http://localhost:5550/api/chat?limit=20&eventType=playerChat' \
-H 'X-Admin-Token: YOUR_TOKEN'
Internal Behavior
/api/chat/broadcast
Broadcast message
Sends a message to all online players. The text is sent with the prefix [Server]. The response contains success: true if the server accepted the message.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
message
|
string | Yes | Text, sent with the prefix [Server] |
Response Example
{
"success": true
}
cURL
curl -X POST 'http://localhost:5550/api/chat/broadcast' \
-H 'X-Admin-Token: YOUR_TOKEN' \
-H 'Content-Type: application/json' \
-d '{"message": "Restart in 5 minutes"}'