Skip to main content
Version: v1.0+

Network Management

Manage server network settings including IP allocations, ports, and network configuration.

List Server Allocations

Retrieve all network allocations assigned to a server.

GET /api/client/servers/{server}/network/allocations

URL Parameters

ParameterTypeDescription
serverstringServer identifier (UUID or short ID)

Example Request

GET /api/client/servers/{server}/network/allocations
curl "https://your-panel.com/api/client/servers/d3aac109/network/allocations" \
-H "Authorization: Bearer ptlc_YOUR_API_KEY" \
-H "Accept: Application/vnd.pterodactyl.v1+json" \
-H "Content-Type: application/json"

Example Response

{
"object": "list",
"data": [
{
"object": "allocation",
"attributes": {
"id": 15,
"ip": "45.86.168.218",
"ip_alias": "game.example.com",
"port": 25565,
"notes": "Main Minecraft server port",
"is_default": true
}
},
{
"object": "allocation",
"attributes": {
"id": 16,
"ip": "45.86.168.218",
"ip_alias": "game.example.com",
"port": 25566,
"notes": "Secondary port for plugins",
"is_default": false
}
},
{
"object": "allocation",
"attributes": {
"id": 17,
"ip": "45.86.168.218",
"ip_alias": null,
"port": 25567,
"notes": null,
"is_default": false
}
}
]
}

Allocation Object Attributes

FieldDescription
idUnique allocation identifier
ipIP address of the allocation
ip_aliasFriendly name/hostname for the IP
portPort number
notesUser-defined notes for the allocation
is_defaultWhether this is the primary allocation

Assign New Allocation

Request assignment of an available allocation to the server.

POST /api/client/servers/{server}/network/allocations

Request Body

FieldTypeRequiredDescription
ipstringNoSpecific IP address to assign
portintegerNoSpecific port to assign
Note

If no IP or port is specified, the system will automatically assign the next available allocation from the node's pool.

Example Request

curl -X POST "https://your-panel.com/api/client/servers/d3aac109/network/allocations" \
-H "Authorization: Bearer ptlc_YOUR_API_KEY" \
-H "Accept: Application/vnd.pterodactyl.v1+json" \
-H "Content-Type: application/json" \
-d '{
"ip": "45.86.168.218",
"port": 25568
}'

Success Response

{
"object": "allocation",
"attributes": {
"id": 18,
"ip": "45.86.168.218",
"ip_alias": "game.example.com",
"port": 25568,
"notes": null,
"is_default": false
}
}

Error Responses

Allocation Limit Reached (400)

{
"errors": [
{
"code": "TooManyAllocationsException",
"status": "400",
"detail": "This server has reached its allocation limit."
}
]
}

Allocation Not Available (409)

{
"errors": [
{
"code": "AllocationNotAvailableException",
"status": "409",
"detail": "The requested allocation is not available or already in use."
}
]
}

No Available Allocations (503)

{
"errors": [
{
"code": "NoAvailableAllocationsException",
"status": "503",
"detail": "No available allocations found on this node."
}
]
}

Set Primary Allocation

Change which allocation is the primary (default) allocation for the server.

POST /api/client/servers/{server}/network/allocations/{allocation}/primary

URL Parameters

ParameterTypeDescription
serverstringServer identifier (UUID or short ID)
allocationintegerAllocation ID to set as primary

Example Request

curl -X POST "https://your-panel.com/api/client/servers/d3aac109/network/allocations/16/primary" \
-H "Authorization: Bearer ptlc_YOUR_API_KEY" \
-H "Accept: Application/vnd.pterodactyl.v1+json" \
-H "Content-Type: application/json"

Success Response

{
"object": "allocation",
"attributes": {
"id": 16,
"ip": "45.86.168.218",
"ip_alias": "game.example.com",
"port": 25566,
"notes": "Secondary port for plugins",
"is_default": true
}
}
Primary Allocation

The primary allocation is the main IP:Port combination used for server connections. Only one allocation can be primary at a time.

Error Responses

Server Must Be Stopped (400)

{
"errors": [
{
"code": "ConflictingServerStateException",
"status": "400",
"detail": "Server must be stopped to change the primary allocation."
}
]
}

Update Allocation Notes

Add or modify notes for a specific allocation.

POST /api/client/servers/{server}/network/allocations/{allocation}

URL Parameters

ParameterTypeDescription
serverstringServer identifier (UUID or short ID)
allocationintegerAllocation ID

Request Body

FieldTypeRequiredDescription
notesstringNoNotes for the allocation (max 255 characters)

Example Request

curl -X POST "https://your-panel.com/api/client/servers/d3aac109/network/allocations/17" \
-H "Authorization: Bearer ptlc_YOUR_API_KEY" \
-H "Accept: Application/vnd.pterodactyl.v1+json" \
-H "Content-Type: application/json" \
-d '{
"notes": "Reserved for future web interface"
}'

Success Response

{
"object": "allocation",
"attributes": {
"id": 17,
"ip": "45.86.168.218",
"ip_alias": "game.example.com",
"port": 25567,
"notes": "Reserved for future web interface",
"is_default": false
}
}

Remove Allocation

Unassign an allocation from the server, making it available for other servers.

DELETE /api/client/servers/{server}/network/allocations/{allocation}

URL Parameters

ParameterTypeDescription
serverstringServer identifier (UUID or short ID)
allocationintegerAllocation ID to remove

Example Request

curl -X DELETE "https://your-panel.com/api/client/servers/d3aac109/network/allocations/18" \
-H "Authorization: Bearer ptlc_YOUR_API_KEY" \
-H "Accept: Application/vnd.pterodactyl.v1+json" \
-H "Content-Type: application/json"

Success Response (204)

Returns empty response body with status code 204.

Error Responses

Cannot Remove Primary Allocation (400)

{
"errors": [
{
"code": "CannotDeletePrimaryAllocationException",
"status": "400",
"detail": "Cannot remove the primary allocation. Set another allocation as primary first."
}
]
}

Server Must Be Stopped (400)

{
"errors": [
{
"code": "ConflictingServerStateException",
"status": "400",
"detail": "Server must be stopped to remove allocations."
}
]
}

Network Configuration Examples

Game Server Setup

Here's how to configure network allocations for different types of game servers:

Minecraft Server

# Add primary allocation for Minecraft
curl -X POST "https://your-panel.com/api/client/servers/d3aac109/network/allocations" \
-H "Authorization: Bearer ptlc_YOUR_API_KEY" \
-H "Accept: Application/vnd.pterodactyl.v1+json" \
-H "Content-Type: application/json" \
-d '{
"ip": "45.86.168.218",
"port": 25565
}'

FiveM Server

# Add primary allocation for FiveM (30120)
curl -X POST "https://your-panel.com/api/client/servers/d3aac109/network/allocations" \
-H "Authorization: Bearer ptlc_YOUR_API_KEY" \
-H "Accept: Application/vnd.pterodactyl.v1+json" \
-H "Content-Type: application/json" \
-d '{
"ip": "45.86.168.218",
"port": 30120
}'

CS:GO Server

# Add primary allocation for CS:GO (27015)
curl -X POST "https://your-panel.com/api/client/servers/d3aac109/network/allocations" \
-H "Authorization: Bearer ptlc_YOUR_API_KEY" \
-H "Accept: Application/vnd.pterodactyl.v1+json" \
-H "Content-Type: application/json" \
-d '{
"ip": "45.86.168.218",
"port": 27015
}'

Multiple Services

Configure multiple allocations for servers running multiple services:

# Add web panel allocation (8080)
curl -X POST "https://your-panel.com/api/client/servers/d3aac109/network/allocations" \
-H "Authorization: Bearer ptlc_YOUR_API_KEY" \
-H "Accept: Application/vnd.pterodactyl.v1+json" \
-H "Content-Type: application/json" \
-d '{
"ip": "45.86.168.218",
"port": 8080
}'

# Add RCON allocation (25575)
curl -X POST "https://your-panel.com/api/client/servers/d3aac109/network/allocations" \
-H "Authorization: Bearer ptlc_YOUR_API_KEY" \
-H "Accept: Application/vnd.pterodactyl.v1+json" \
-H "Content-Type: application/json" \
-d '{
"ip": "45.86.168.218",
"port": 25575
}'

Set Primary Allocation

# Set allocation as primary (main server port)
curl -X POST "https://your-panel.com/api/client/servers/d3aac109/network/allocations/1/primary" \
-H "Authorization: Bearer ptlc_YOUR_API_KEY" \
-H "Accept: Application/vnd.pterodactyl.v1+json"

Multiple Services

Configure multiple allocations for servers running multiple services:

# Add web panel allocation (8080)
curl -X POST "https://your-panel.com/api/client/servers/d3aac109/network/allocations" \
-H "Authorization: Bearer ptlc_YOUR_API_KEY" \
-H "Accept: Application/vnd.pterodactyl.v1+json" \
-H "Content-Type: application/json" \
-d '{
"ip": "45.86.168.218",
"port": 8080
}'

# Add RCON allocation (25575)
curl -X POST "https://your-panel.com/api/client/servers/d3aac109/network/allocations" \
-H "Authorization: Bearer ptlc_YOUR_API_KEY" \
-H "Accept: Application/vnd.pterodactyl.v1+json" \
-H "Content-Type: application/json" \
-d '{
"ip": "45.86.168.218",
"port": 25575
}'

Set Primary Allocation

# Set allocation as primary (main server port)
curl -X POST "https://your-panel.com/api/client/servers/d3aac109/network/allocations/1/primary" \
-H "Authorization: Bearer ptlc_YOUR_API_KEY" \
-H "Accept: Application/vnd.pterodactyl.v1+json"

Port Testing

Test allocation connectivity:

# Test port connectivity
telnet 45.86.168.218 25565

# Verify port listening
netstat -tuln | grep 25565

# Test from specific location
curl -I http://45.86.168.218:8080

Network Monitoring

  • Port scanning: Regular port availability checks
  • Latency monitoring: Track connection latency
  • Bandwidth usage: Monitor data transfer
  • Uptime tracking: Ensure allocation availability

Common Error Codes

StatusCodeDescription
400TooManyAllocationsExceptionAllocation limit reached
400CannotDeletePrimaryAllocationExceptionCannot remove primary allocation
400ConflictingServerStateExceptionServer state prevents operation
401InvalidCredentialsExceptionInvalid API key
403InsufficientPermissionsExceptionMissing required permissions
404NotFoundHttpExceptionAllocation not found
422ValidationExceptionInvalid request data

Required Permissions

Network allocation operations require specific permissions:

PermissionDescription
allocation.readView server allocations
allocation.createAdd new allocations
allocation.updateModify allocation settings
allocation.deleteRemove allocations

Next Steps

Source References

Controller: NetworkAllocationController
Routes: api-client.php - Network allocation endpoints
Allocation Model: Allocation.php
Allocation Service: AllocationSelectionService