Game servers
All endpoints on this page require Authorization: Bearer <token>.
List servers
Section titled “List servers”GET
/<project>/v2?start=<start>&length=<length>&endUser=<endUser>| Parameter | Required | Meaning |
|---|---|---|
start |
Yes | Zero-based result offset |
length |
Yes | Number of records, greater than zero |
endUser |
No | Filter by the client-side end user identifier |
The query parameter is named endUser. The JSON field is named enduser.
curl \ -H 'Authorization: Bearer <token>' \ -H 'Accept: application/json' \ 'https://api.castles.pro/<project>/v2?start=0&length=50&endUser=customer-123'The response contains rows and total_count.
Get servers by IP address
Section titled “Get servers by IP address”GET
/<project>/v2/<ip_address>Returns an array of servers registered on the requested public IP address.
Get one server
Section titled “Get one server”GET
/<project>/v2/<ip_address>/<main_port>{ "game": "ark", "ipAddress": "5.42.211.10", "enduser": "customer-123", "ports": { "game": 29016, "query": 29015, "rcon": 29020 }, "protection": { "status": "online", "address": "5.42.211.10/29016", "additional": "query:29015, rcon:29020", "comment": "Protected game server" }}Add a server
Section titled “Add a server”POST
/<project>/v2/<ip_address>{ "game": "ark", "ports": { "game": 29016, "query": 29015, "rcon": 29020 }, "enduser": "customer-123"}ipAddress is optional in the request body. When omitted, the API uses the address from the request path. A successful request returns the created server object.
Remove a server
Section titled “Remove a server”DELETE
/<project>/v2/<ip_address>/<main_port>Confirm the IP address and primary port before sending this request. A successful response is:
{ "status": true}Update a server
Section titled “Update a server”PUT
/<project>/v2/<ip_address>/<main_port>The current address and primary port are passed in the path. New values are passed in the JSON body. A change to the address, game, or ports may be applied as removal of the old configuration followed by creation of the new configuration.
Protection status
Section titled “Protection status”| Status | Meaning |
|---|---|
protected |
The server is placed under protection |
online |
The server is protected and responds through its game query protocol |
updating |
A configuration change is queued but not yet applied |
deleted |
The server was removed from protection; this is a terminal status |
Server model
Section titled “Server model”| Field | Meaning |
|---|---|
game |
Supported game identifier |
ipAddress |
Public server address |
enduser |
End user identifier in the client system |
ports.game |
Primary game port |
ports.query |
Query port when required |
ports.rcon |
RCON port when required |
protection.status |
Current protection state |
protection.address |
Address and primary port in the protection configuration |
protection.additional |
Additional ports |
protection.comment |
Service comment |