API Reference
Servers
Server registration, heartbeat, presence, and listing
/api/plugin/provisioning/agent-script Download the current on-VM agent script (used by the VM bootstrap to self-update)
Responses
-
200OK
Request
curl -X GET http://localhost:8090/api/plugin/provisioning/agent-script \
-H "X-Hive-Api-Key: $HIVE_API_KEY"HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("http://localhost:8090/api/plugin/provisioning/agent-script"))
.header("X-Hive-Api-Key", apiKey)
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response =
client.send(request, HttpResponse.BodyHandlers.ofString()); /api/plugin/provisioning/agent-version Current agent version (sha256) — the running agent polls this to detect updates
Responses
-
200OK
{
"sha256": "string"
} Request
curl -X GET http://localhost:8090/api/plugin/provisioning/agent-version \
-H "X-Hive-Api-Key: $HIVE_API_KEY"HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("http://localhost:8090/api/plugin/provisioning/agent-version"))
.header("X-Hive-Api-Key", apiKey)
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response =
client.send(request, HttpResponse.BodyHandlers.ofString()); /api/plugin/provisioning/agent/{serverType} Download the mods bundle for a server type (used by provisioned VMs at boot)
Parameters
-
serverTypestring path required
Responses
-
200OK
Request
curl -X GET http://localhost:8090/api/plugin/provisioning/agent/{serverType} \
-H "X-Hive-Api-Key: $HIVE_API_KEY"HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("http://localhost:8090/api/plugin/provisioning/agent/{serverType}"))
.header("X-Hive-Api-Key", apiKey)
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response =
client.send(request, HttpResponse.BodyHandlers.ofString()); /api/plugin/provisioning/auth-code Report the current OAuth device-login URL/code for a provisioning server
Sent by a provisioned VM while it waits for the operator to authenticate. Moves the provisioning row to AWAITING_AUTH and stores the latest URL + code for the dashboard to display. No-op once the server has registered.
Request body
{
"serverId": "string",
"verifyUrl": "string",
"userCode": "string"
} Responses
-
201Created -
400Bad Request
Request
curl -X POST http://localhost:8090/api/plugin/provisioning/auth-code \
-H "X-Hive-Api-Key: $HIVE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"serverId":"string","verifyUrl":"string","userCode":"string"}'HttpClient client = HttpClient.newHttpClient();
String body = "{\"serverId\":\"string\",\"verifyUrl\":\"string\",\"userCode\":\"string\"}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("http://localhost:8090/api/plugin/provisioning/auth-code"))
.header("X-Hive-Api-Key", apiKey)
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response =
client.send(request, HttpResponse.BodyHandlers.ofString()); /api/plugin/servers List all known servers (online + offline), paginated
Durable registry joined with live presence: each row carries identity/config plus an online flag and a live snapshot (when online). Filters: ?serverType, ?online=true|false, ?search (server id / display name).
Parameters
-
limitinteger query -
onlineboolean query -
pageinteger query -
searchstring query -
serverTypestring query
Responses
-
200OK
{
"items": [
{
"serverId": "string",
"serverType": "string",
"gameType": "string",
"displayName": "string",
"maxPlayers": 0,
"status": "string",
"lastHost": "string",
"lastPort": 0,
"firstSeen": 0,
"lastSeen": 0,
"online": false,
"live": {
"serverId": "string",
"serverType": "string",
"gameType": "MINECRAFT",
"displayName": "string",
"currentPlayers": 0,
"maxPlayers": 0,
"host": "string",
"port": 0,
"startedAt": 0,
"lastHeartbeat": 0,
"gameState": "IDLE",
"playersToStart": 0,
"worlds": [
{
"worldId": "string",
"displayName": "string",
"currentPlayers": 0,
"maxPlayers": 0,
"gameState": "IDLE",
"playersToStart": 0,
"worldType": "string",
"full": false,
"playerCountDisplay": "string",
"joinable": false,
"minigameWorld": false,
"playersNeededToStart": 0
}
],
"full": false,
"playerCountDisplay": "string",
"joinable": false,
"minigameServer": false,
"playersNeededToStart": 0,
"totalPlayers": 0
},
"provisioning": {
"provider": "string",
"phase": "string",
"desiredState": "string",
"region": "string",
"serverVmType": "string",
"ipv4": "string"
}
}
],
"page": 0,
"limit": 0,
"total": 0
} Request
curl -X GET http://localhost:8090/api/plugin/servers?limit=0&online=0&page=0&search=value&serverType=value \
-H "X-Hive-Api-Key: $HIVE_API_KEY"// Browse known servers (online + offline), 0-based page.
hive.server().listServers("skywars", true /* online */, null, 0, 50)
.thenAccept(page -> { }); /api/plugin/servers/heartbeat Send a heartbeat
Refreshes liveness and reports current state, worlds and online players. Send periodically; missing heartbeats mark the server offline.
Request body
{
"serverId": "string",
"serverType": "string",
"gameState": "string",
"playersToStart": 0,
"worlds": [
{
"worldId": "string",
"displayName": "string",
"currentPlayers": 0,
"maxPlayers": 0,
"gameState": "string",
"playersToStart": 0,
"worldType": "string"
}
],
"players": [
{
"uuid": "string",
"name": "string"
}
]
} Responses
-
204Heartbeat accepted. -
400Bad Request
Request
curl -X POST http://localhost:8090/api/plugin/servers/heartbeat \
-H "X-Hive-Api-Key: $HIVE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"serverId":"string","serverType":"string","gameState":"string","playersToStart":0,"worlds":[{"worldId":"string","displayName":"string","currentPlayers":0,"maxPlayers":0,"gameState":"string","playersToStart":0,"worldType":"string"}],"players":[{"uuid":"string","name":"string"}]}'// Send periodically to stay live and report state + presence.
hive.server().sendHeartbeat("skywars-1", "skywars",
"PLAYING", 0, worlds, playersByUuid); /api/plugin/servers/players List online players
Players currently online, optionally filtered by server type.
Parameters
-
serverTypestring queryOptional server-type filter.
Responses
-
200OK.
[
{
"playerUuid": "string",
"playerName": "string",
"serverId": "string",
"serverType": "string"
}
] Request
curl -X GET http://localhost:8090/api/plugin/servers/players?serverType=value \
-H "X-Hive-Api-Key: $HIVE_API_KEY"hive.server().onlinePlayers("skywars").thenAccept(players -> { }); /api/plugin/servers/players Record a player join
Marks a player present on a server. If a transfer was pending, the join completes it as a server switch.
Request body
{
"serverId": "string",
"serverType": "string",
"playerUuid": "string",
"playerName": "string"
} Responses
-
204Recorded. -
400Bad Request
Request
curl -X POST http://localhost:8090/api/plugin/servers/players \
-H "X-Hive-Api-Key: $HIVE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"serverId":"string","serverType":"string","playerUuid":"string","playerName":"string"}'hive.server().playerJoin("skywars-1", "skywars", playerUuid, playerName); /api/plugin/servers/players/world Record a world change
Updates which world/instance a player is in on a server.
Request body
{
"serverId": "string",
"playerUuid": "string",
"newWorldId": "string",
"previousWorldId": "string"
} Responses
-
204Recorded. -
400Bad Request
Request
curl -X POST http://localhost:8090/api/plugin/servers/players/world \
-H "X-Hive-Api-Key: $HIVE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"serverId":"string","playerUuid":"string","newWorldId":"string","previousWorldId":"string"}'hive.server().setPlayerWorld("skywars-1", playerUuid, "arena-7", "lobby"); /api/plugin/servers/players/{playerUuid} Record a player leave
Removes a player's presence on a server. A leave that is the source of a transfer is collapsed into the switch.
Parameters
-
playerUuidstring path requiredPlayer UUID.
-
serverIdstring query
Responses
-
204Recorded.
Request
curl -X DELETE http://localhost:8090/api/plugin/servers/players/{playerUuid}?serverId=value \
-H "X-Hive-Api-Key: $HIVE_API_KEY"hive.server().playerLeave("skywars-1", playerUuid); /api/plugin/servers/register Register a server
Registers a server in the network. The server must advertise a client-reachable host:port so transfers can reference it. A blank host is filled in from the request's remote address; a non-positive port is rejected.
Request body
{
"serverId": "string",
"serverType": "string",
"gameType": "string",
"displayName": "string",
"maxPlayers": 0,
"host": "string",
"port": 0,
"gameState": "string",
"playersToStart": 0,
"worlds": [
{
"worldId": "string",
"displayName": "string",
"currentPlayers": 0,
"maxPlayers": 0,
"gameState": "string",
"playersToStart": 0,
"worldType": "string"
}
]
} Responses
-
201Created -
400Bad Request
Request
curl -X POST http://localhost:8090/api/plugin/servers/register \
-H "X-Hive-Api-Key: $HIVE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"serverId":"string","serverType":"string","gameType":"string","displayName":"string","maxPlayers":0,"host":"string","port":0,"gameState":"string","playersToStart":0,"worlds":[{"worldId":"string","displayName":"string","currentPlayers":0,"maxPlayers":0,"gameState":"string","playersToStart":0,"worldType":"string"}]}'// Announce this server on startup; it becomes matchmakeable.
hive.server().registerServer("skywars-1", "skywars", GameType.HYTALE,
"SkyWars #1", 12 /* maxPlayers */, "10.0.0.5", 5520,
"WAITING", 2 /* playersToStart */, worlds); /api/plugin/servers/unregister Unregister a server
Removes the server's live presence (e.g. on clean shutdown).
Parameters
-
serverIdstring queryServer id.
-
serverTypestring query
Responses
-
204Unregistered.
Request
curl -X POST http://localhost:8090/api/plugin/servers/unregister?serverId=value&serverType=value \
-H "X-Hive-Api-Key: $HIVE_API_KEY"hive.server().unregisterServer("skywars-1", "skywars"); /api/plugin/servers/{serverId}/commands Drain pending control actions for a server (used by the on-VM agent)
Parameters
-
serverIdstring path required
Responses
-
200OK
{
"commands": [
"string"
]
} Request
curl -X GET http://localhost:8090/api/plugin/servers/{serverId}/commands \
-H "X-Hive-Api-Key: $HIVE_API_KEY"HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("http://localhost:8090/api/plugin/servers/{serverId}/commands"))
.header("X-Hive-Api-Key", apiKey)
.method("GET", HttpRequest.BodyPublishers.noBody())
.build();
HttpResponse<String> response =
client.send(request, HttpResponse.BodyHandlers.ofString()); /api/plugin/servers/{serverId}/commands/{commandId}/result Report a file command's result (used by the on-VM agent)
Parameters
-
commandIdstring path required -
serverIdstring path required
Request body
{
"status": "string",
"error": "string",
"result": {
"empty": false,
"valueNode": false,
"containerNode": false,
"missingNode": false,
"array": false,
"object": false,
"nodeType": "ARRAY",
"pojo": false,
"number": false,
"integralNumber": false,
"floatingPointNumber": false,
"short": false,
"int": false,
"long": false,
"float": false,
"double": false,
"bigDecimal": false,
"bigInteger": false,
"textual": false,
"boolean": false,
"null": false,
"binary": false
}
} Responses
-
201Created -
400Bad Request
Request
curl -X POST http://localhost:8090/api/plugin/servers/{serverId}/commands/{commandId}/result \
-H "X-Hive-Api-Key: $HIVE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"status":"string","error":"string","result":{"empty":false,"valueNode":false,"containerNode":false,"missingNode":false,"array":false,"object":false,"nodeType":"ARRAY","pojo":false,"number":false,"integralNumber":false,"floatingPointNumber":false,"short":false,"int":false,"long":false,"float":false,"double":false,"bigDecimal":false,"bigInteger":false,"textual":false,"boolean":false,"null":false,"binary":false}}'HttpClient client = HttpClient.newHttpClient();
String body = "{\"status\":\"string\",\"error\":\"string\",\"result\":{\"empty\":false,\"valueNode\":false,\"containerNode\":false,\"missingNode\":false,\"array\":false,\"object\":false,\"nodeType\":\"ARRAY\",\"pojo\":false,\"number\":false,\"integralNumber\":false,\"floatingPointNumber\":false,\"short\":false,\"int\":false,\"long\":false,\"float\":false,\"double\":false,\"bigDecimal\":false,\"bigInteger\":false,\"textual\":false,\"boolean\":false,\"null\":false,\"binary\":false}}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("http://localhost:8090/api/plugin/servers/{serverId}/commands/{commandId}/result"))
.header("X-Hive-Api-Key", apiKey)
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response =
client.send(request, HttpResponse.BodyHandlers.ofString()); /api/plugin/servers/{serverId}/logs Ship a batch of console log lines for a server (used by the on-VM agent)
Parameters
-
serverIdstring path required
Request body
{
"agentVersion": "string",
"lines": [
{
"ts": "string",
"line": "string"
}
]
} Responses
-
201Created -
400Bad Request
Request
curl -X POST http://localhost:8090/api/plugin/servers/{serverId}/logs \
-H "X-Hive-Api-Key: $HIVE_API_KEY" \
-H "Content-Type: application/json" \
-d '{"agentVersion":"string","lines":[{"ts":"string","line":"string"}]}'HttpClient client = HttpClient.newHttpClient();
String body = "{\"agentVersion\":\"string\",\"lines\":[{\"ts\":\"string\",\"line\":\"string\"}]}";
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("http://localhost:8090/api/plugin/servers/{serverId}/logs"))
.header("X-Hive-Api-Key", apiKey)
.header("Content-Type", "application/json")
.method("POST", HttpRequest.BodyPublishers.ofString(body))
.build();
HttpResponse<String> response =
client.send(request, HttpResponse.BodyHandlers.ofString());