Skip to main content

Servers

Wings uses these endpoints to load the configuration of the servers on its node, report installation results, reset stuck states after a restart, and report the outcome of server transfers.

All endpoints require daemon authentication. "The calling node" below means the node whose token was used.

Where a path takes {uuid}, it accepts either the server's full UUID or its 8 character short UUID. If no server matches, the response is 404.

Server configuration structure​

GET /api/remote/servers and GET /api/remote/servers/{uuid} both return a server's configuration as two objects: settings and process_configuration.

settings​

Built by ServerConfigurationStructureService.

{
"uuid": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
"meta": {
"name": "jane's Starter Server",
"description": ""
},
"suspended": false,
"environment": {
"SERVER_JARFILE": "server.jar",
"MINECRAFT_VERSION": "latest",
"STARTUP": "java -Xms128M -Xmx{{SERVER_MEMORY}}M -jar {{SERVER_JARFILE}}",
"P_SERVER_UUID": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
"P_SERVER_ALLOCATION_LIMIT": 1
},
"invocation": "java -Xms128M -Xmx{{SERVER_MEMORY}}M -jar {{SERVER_JARFILE}}",
"skip_egg_scripts": false,
"build": {
"memory_limit": 2048,
"swap": 0,
"io_weight": 500,
"cpu_limit": 100,
"threads": null,
"disk_space": 20480,
"oom_disabled": true,
"oom_killer": false
},
"container": {
"image": "ghcr.io/pterodactyl/yolks:java_21"
},
"allocations": {
"default": {
"ip": "203.0.113.10",
"port": 25565
},
"force_outgoing_ip": false,
"mappings": {
"203.0.113.10": [25565, 25566]
}
},
"mounts": [
{
"source": "/srv/shared",
"target": "/home/container/shared",
"read_only": true
}
],
"egg": {
"id": "a1b2c3d4-0000-4000-8000-000000000005",
"file_denylist": []
}
}
FieldTypeDescription
uuidstringServer UUID.
meta.namestringServer name.
meta.descriptionstring or nullServer description.
suspendedbooleantrue when the server's status is suspended.
environmentobjectEnvironment variables. See below.
invocationstringThe server's startup command, or the egg's startup command if the server's is null.
skip_egg_scriptsbooleanWhether the install script is skipped.
build.memory_limitintegerMemory, in MiB.
build.swapintegerSwap, in MiB.
build.io_weightintegerBlock IO weight.
build.cpu_limitintegerCPU limit, in percent.
build.threadsstring or nullCPU pinning, for example 0-1,3.
build.disk_spaceintegerDisk, in MiB.
build.oom_disabledbooleanThe inverse of oom_killer. Kept for older Wings versions.
build.oom_killerbooleanWhether the OOM killer is enabled.
container.imagestringDocker image.
allocations.defaultobjectIP and port of the server's primary allocation.
allocations.force_outgoing_ipbooleanThe egg's force_outgoing_ip flag.
allocations.mappingsobjectEvery allocation assigned to the server on its current node, grouped by IP. Each key is an IP and each value is an array of ports.
mountsarrayMounts attached to the server, each with source, target and read_only (boolean).
egg.idstringThe egg's UUID.
egg.file_denylistarray or nullThe egg's file denylist (inherited from the parent egg when the egg copies its configuration from another egg).

environment is built in this order, with later entries overwriting earlier ones:

  1. Every variable of the server's egg, keyed by env_variable. The value is the server's value, or the egg variable's default value when the server has none.
  2. STARTUP: the server's startup command (the raw startup column, which can be null).
  3. P_SERVER_UUID: the server UUID.
  4. Variables from the environment_variables list in config/everest.php. By default this is P_SERVER_ALLOCATION_LIMIT, set to the server's allocation limit.
  5. Any variables registered at runtime by the Panel or its extensions.

process_configuration​

Built by EggConfigurationService from the egg's configuration (inherited from the parent egg when the egg copies its configuration from another egg).

{
"startup": {
"done": [")! For help, type "],
"user_interaction": [],
"strip_ansi": false
},
"stop": {
"type": "command",
"value": "stop"
},
"configs": [
{
"parser": "properties",
"file": "server.properties",
"replace": [
{ "match": "server-ip", "replace_with": "0.0.0.0" },
{ "match": "server-port", "replace_with": "25565" },
{ "match": "query.port", "replace_with": "25565" }
]
}
]
}
FieldTypeDescription
startup.donearray of stringsThe egg's done value from its startup configuration. A single string is wrapped in an array.
startup.user_interactionarrayAlways empty.
startup.strip_ansibooleanThe egg's strip_ansi value, or false.
stop.typestringcommand, or signal when the egg's stop value starts with ^.
stop.valuestringFor command, the stop command. For signal, the text after ^, uppercased (for example ^C becomes C, ^SIGINT becomes SIGINT).
configsarrayOne entry per file in the egg's configuration files. See below.

Each entry in configs is the egg's configuration for that file with three changes:

  • file is added, set to the file name (the key in the egg's configuration).
  • find is removed and replaced by replace, a list of replacements.
  • Any other keys from the egg's entry (such as parser) are kept as they are.

Files whose entry is not an object or has no find key are skipped.

Each item in replace is one of:

ShapeWhen
{ "match": "<key>", "replace_with": <value> }The find value for the key is a plain value.
{ "match": "<key>", "if_value": "<old value>", "replace_with": <value> }The find value for the key is an object mapping old values to new values. One item is produced per pair.

Placeholders in string values are resolved by the Panel before they are sent:

PlaceholderResolved to
{{server.<path>}}The value at <path> in the legacy server structure. Missing paths become an empty string.
{{env.<NAME>}}The server's environment variable <NAME> (from build.env in the legacy structure).
{{config.<path>}}Left in place for Wings to resolve.

These legacy placeholders are rewritten first:

Written in the eggRewritten to
{{config.docker.interface}}{{config.docker.network.interface}}
{{server.build.env.SERVER_MEMORY}}, {{env.SERVER_MEMORY}}{{server.build.memory}}
{{server.build.env.SERVER_IP}}, {{env.SERVER_IP}}{{server.build.default.ip}}
{{server.build.env.SERVER_PORT}}, {{env.SERVER_PORT}}{{server.build.default.port}}

The legacy server structure used for {{server.*}} lookups has these paths: uuid, build.default.ip, build.default.port, build.ports (IP to ports), build.env (the same values as settings.environment), build.oom_disabled, build.memory, build.swap, build.io, build.cpu, build.threads, build.disk, build.image, service.egg (egg UUID), service.skip_scripts, rebuild (false) and suspended (1 or 0).

List servers​

GET /api/remote/servers

Returns the configuration of every server on the calling node, paginated.

curl "https://panel.example.com/api/remote/servers?page=1&per_page=50" \
-H "Accept: application/json" \
-H "Authorization: Bearer $TOKEN_ID.$TOKEN"

Query parameters​

ParameterTypeRequiredDescription
pageintegerNoPage number. Default 1.
per_pageintegerNoServers per page. Default 50. Cast to an integer. Must be at least 1. There is no upper limit.

Response​

200 OK

This endpoint uses Laravel's resource pagination format, not the meta.pagination format described in the introduction.

{
"data": [
{
"uuid": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d",
"settings": { "uuid": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d", "...": "..." },
"process_configuration": { "startup": { "...": "..." }, "stop": { "...": "..." }, "configs": [] }
}
],
"links": {
"first": "https://panel.example.com/api/remote/servers?page=1",
"last": "https://panel.example.com/api/remote/servers?page=1",
"prev": null,
"next": null
},
"meta": {
"current_page": 1,
"from": 1,
"last_page": 1,
"links": [],
"path": "https://panel.example.com/api/remote/servers",
"per_page": 50,
"to": 1,
"total": 1
}
}

Each item in data has uuid, settings and process_configuration, as described in Server configuration structure. meta.links is Laravel's list of page links (abbreviated as [] above).

Errors​

StatusdetailWhen
400The "per_page" query parameter must be at least 1.per_page is 0, negative, or not a number.

Reset server states​

POST /api/remote/servers/reset

Wings calls this when it starts, because a restart stops any install or backup restore that was running.

For every server on the calling node whose status is restoring_backup, the Panel looks at the server's latest server:backup.restore-started activity log entry. If it has a backup subject, the Panel logs server:backup.restore-failed for the server and that backup.

Then, in the same transaction, every server on the node whose status is installing or restoring_backup has its status set to null (a normal, installed state).

No request body.

Response​

204 No Content

info

Servers that were mid-install are marked as installed (status null), not as install_failed.

Get a server's configuration​

GET /api/remote/servers/{uuid}

Returns the configuration of one server. Wings uses this to sync a server's state with the Panel.

Response​

200 OK

{
"settings": { "uuid": "1a2b3c4d-5e6f-4a7b-8c9d-0e1f2a3b4c5d", "...": "..." },
"process_configuration": { "startup": { "...": "..." }, "stop": { "...": "..." }, "configs": [] }
}

See Server configuration structure for the full contents. There is no top-level uuid key on this endpoint.

Errors​

StatusWhen
404No server matches {uuid}, or the server is on a different node. The response does not reveal which.

Get installation details​

GET /api/remote/servers/{uuid}/install

Returns the egg's install script settings for a server. If the egg copies its install script from another egg, the copied values are returned.

Response​

200 OK

{
"container_image": "ghcr.io/pterodactyl/installers:debian",
"entrypoint": "bash",
"script": "#!/bin/bash\n# Paper Installation Script\n..."
}
FieldTypeDescription
container_imagestringDocker image to run the install script in.
entrypointstringCommand used to run the script, for example bash or ash.
scriptstring or nullThe install script.

Errors​

StatusWhen
404No server matches {uuid}, or the server is on a different node.

Report installation result​

POST /api/remote/servers/{uuid}/install

Wings calls this when a server's install or reinstall finishes.

Request body​

FieldTypeRequiredDescription
successfulbooleanYes (must be present)Whether the install script succeeded.
reinstallbooleanNoWhether this was a reinstall.

What happens​

The server's status is set to:

ConditionNew status
The server's current status is suspendedsuspended (unchanged)
successful is truenull (installed)
successful is false and reinstall is truereinstall_failed
successful is false otherwiseinstall_failed

installed_at is set to the current time in every case, including failures.

Response​

204 No Content

Errors​

StatusWhen
404No server matches {uuid}, or the server is on a different node.

Report transfer failure​

POST /api/remote/servers/{uuid}/transfer/failure

Reports that transferring a server to another node failed. Only the transfer's destination node can call it.

The Panel marks the server's active transfer as unsuccessful and releases the allocations reserved on the destination node (the new primary allocation and new additional allocations). The server stays on its original node.

No request body.

Response​

204 No Content

Errors​

StatusWhen
404No server matches {uuid}, or the calling node is not the transfer's destination node.
409Server is not being transferred. The server has no active transfer.

Report transfer success​

POST /api/remote/servers/{uuid}/transfer/success

Reports that a server was transferred to the calling node. Only the transfer's destination node can call it.

In one transaction, the Panel:

  1. Releases the server's old allocations (old primary and old additional allocations).
  2. Assigns the new primary and new additional allocations to the server.
  3. Sets the server's allocation_id to the new primary allocation and node_id to the destination node.
  4. Marks the transfer as successful.

It then asks Wings on the old node to delete the server. If the old node cannot be reached, the error is logged and the request still succeeds.

No request body.

Response​

204 No Content

Errors​

StatusWhen
404No server matches {uuid}, or the calling node is not the transfer's destination node.
409Server is not being transferred. The server has no active transfer.