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​

This endpoint does not accept a request body. When client auto-allocation is enabled, Pterodactyl selects an available allocation using the server's primary allocation IP, or creates one from the configured auto-allocation port range.

Assigning Specific Allocations

The Client API cannot request a specific IP address or port. To assign specific allocation IDs, use the Application API server build configuration endpoint with add_allocations or remove_allocations.

Example Request​

POST /api/client/servers/{server}/network/allocations
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"

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": "DisplayException",
"status": "400",
"detail": "Cannot assign additional allocations to this server: limit has been reached."
}
]
}

Auto-Allocation Disabled (400)

{
"errors": [
{
"code": "AutoAllocationNotEnabledException",
"status": "400",
"detail": "Server auto-allocation is not enabled for this instance."
}
]
}

No Auto-Allocation Space Available (400)

{
"errors": [
{
"code": "NoAutoAllocationSpaceAvailableException",
"status": "400",
"detail": "Cannot assign additional allocation: no more space available on 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​

Request Additional Allocations​

The Client API can request additional allocations, but it cannot choose the IP address or port. Pterodactyl assigns an available allocation from the server's node.

# Request one additional allocation
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"

# Request another additional allocation
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"

Assign Specific Game Ports​

Specific game ports must already exist as allocations. Administrators can assign specific allocation IDs to a server with the Application API server build configuration endpoint.

# Assign allocation IDs 42 and 43 to a server using the Application API
curl -X PATCH "https://your-panel.com/api/application/servers/2/build" \
-H "Authorization: Bearer ptla_YOUR_API_KEY" \
-H "Accept: Application/vnd.pterodactyl.v1+json" \
-H "Content-Type: application/json" \
-d '{
"allocation": 1,
"memory": 2048,
"swap": 0,
"disk": 20480,
"io": 500,
"cpu": 100,
"feature_limits": {
"databases": 2,
"allocations": 3,
"backups": 1
},
"add_allocations": [42, 43]
}'

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
400DisplayExceptionAllocation limit reached
400AutoAllocationNotEnabledExceptionServer auto-allocation is disabled
400NoAutoAllocationSpaceAvailableExceptionNo auto-allocation space available on the node
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: FindAssignableAllocationService