curl --request GET \
--url https://api.example.com/api/servers/:server/wscurl --request GET \
--url https://api.example.com/api/servers/:server/wsUpgrades the connection to a websocket for real-time server console output, statistics, and command execution.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/pterodactyl/wings/llms.txt
Use this file to discover all available pages before exploring further.
wss://wings.example.com/api/servers/:server/ws?token=<jwt-token>
throttled event with args ["global"]{
"event": "event_name",
"args": ["arg1", "arg2"]
}
{
"event": "send command",
"args": ["say Hello World"]
}
{
"event": "send logs",
"args": []
}
{
"event": "send stats",
"args": []
}
{
"event": "set state",
"args": ["start"] // start, stop, restart, kill
}
{
"event": "console output",
"args": ["[10:30:15] [Server thread/INFO]: Player joined the game"]
}
{
"event": "status",
"args": ["running"] // offline, starting, running, stopping
}
{
"event": "stats",
"args": ["{\"memory_bytes\":536870912,\"cpu_absolute\":25.5,...}"]
}
{
"event": "token expiring",
"args": []
}
{
"event": "token expired",
"args": []
}
{
"event": "daemon message",
"args": ["Server is starting..."]
}
{
"event": "install output",
"args": ["Downloading server files..."]
}
{
"event": "install started",
"args": []
}
{
"event": "install completed",
"args": []
}
const ws = new WebSocket(
'wss://wings.example.com/api/servers/8d3f9a2e-5c7b-4f1e-9d2a-6e8f1c3b5a7d/ws?token=eyJhbGc...'
);
ws.onopen = () => {
console.log('Connected to server websocket');
// Request logs
ws.send(JSON.stringify({
event: 'send logs',
args: []
}));
};
ws.onmessage = (event) => {
const data = JSON.parse(event.data);
switch(data.event) {
case 'console output':
console.log('Console:', data.args[0]);
break;
case 'status':
console.log('Status changed to:', data.args[0]);
break;
case 'stats':
const stats = JSON.parse(data.args[0]);
console.log('CPU:', stats.cpu_absolute, 'Memory:', stats.memory_bytes);
break;
}
};
ws.onclose = (event) => {
console.log('Disconnected:', event.code, event.reason);
};
// Send a command
function sendCommand(command) {
ws.send(JSON.stringify({
event: 'send command',
args: [command]
}));
}
1000 - Normal closure1001 - Going away1006 - Abnormal closure (no close frame)1012 - Service restart4409 - Server suspended (custom code)router/router_server_ws.go:27