Chat
Base: /api/chat
Chat history, events and broadcasts
Handler: ChatHandler
GET
/api/chat
Get chat and events
Returns the latest chat messages or entries of another event log (for example playerJoin, playerLeave, broadcast).
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
Reads the last lines of mods/Eranio_HytaleAdminAPI/Events/{eventType}.log.
POST
/api/chat/broadcast
Broadcast message
Sends a message to all online players.
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"}'
Internal Behavior
Sends via the universe and logs it to the broadcast and playerChat event logs.