Skip to main content
Version: v1.0+

Node Management

The Application API Node Management endpoints allow administrators to manage Wings daemon nodes in the panel. These endpoints provide comprehensive node lifecycle management including creation, configuration, allocation management, and deletion.

Administrative Access Required

These endpoints require administrative privileges and should only be used by trusted applications with proper authentication.

Authentication

All Application API requests require authentication using an API key with appropriate permissions:

Authorization: Bearer YOUR_APPLICATION_API_KEY
Accept: Application/vnd.pterodactyl.v1+json
Content-Type: application/json

List All Nodes

Retrieve a paginated list of all nodes in the panel.

GET /api/application/nodes

Query Parameters

ParameterTypeDescriptionDefault
pageintegerPage number for pagination1
per_pageintegerResults per page (1-100)50
filter[name]stringFilter by node name-
filter[uuid]stringFilter by node UUID-
filter[fqdn]stringFilter by FQDN-
sortstringSort field (id, uuid, name, created_at, updated_at)id
includestringInclude relationships (allocations, location, servers)-

Example Request

curl "https://your-panel.com/api/application/nodes?include=location,allocations&per_page=25" \
-H "Authorization: Bearer ptla_YOUR_API_KEY" \
-H "Accept: Application/vnd.pterodactyl.v1+json"

Example Response

{
"object": "list",
"data": [
{
"object": "node",
"attributes": {
"id": 1,
"uuid": "d3aac109-e5e0-4331-b03e-3454f7e02bbe",
"public": true,
"name": "Node 1",
"description": "Main production node",
"location_id": 1,
"fqdn": "node1.example.com",
"scheme": "https",
"behind_proxy": false,
"maintenance_mode": false,
"memory": 8192,
"memory_overallocate": 0,
"disk": 102400,
"disk_overallocate": 0,
"upload_size": 100,
"daemon_listen": 8080,
"daemon_sftp": 2022,
"daemon_base": "/var/lib/pterodactyl/volumes",
"created_at": "2024-01-15T10:26:32+00:00",
"updated_at": "2024-01-15T10:26:32+00:00",
"allocated_resources": {
"memory": 1024,
"disk": 2048
}
},
"relationships": {
"location": {
"object": "location",
"attributes": {
"id": 1,
"short": "us-east",
"long": "US East Coast"
}
},
"allocations": {
"object": "list",
"data": [
{
"object": "allocation",
"attributes": {
"id": 1,
"ip": "192.168.1.100",
"ip_alias": null,
"port": 25565,
"notes": null,
"assigned": true
}
}
]
}
}
}
],
"meta": {
"pagination": {
"total": 1,
"count": 1,
"per_page": 50,
"current_page": 1,
"total_pages": 1,
"links": {}
}
}
}

Get Node Details

Retrieve detailed information about a specific node.

GET /api/application/nodes/{node}

Path Parameters

ParameterTypeDescription
nodeintegerNode ID

Query Parameters

ParameterTypeDescription
includestringInclude relationships (allocations, location, servers)

Example Request

curl "https://your-panel.com/api/application/nodes/1?include=allocations,location,servers" \
-H "Authorization: Bearer ptla_YOUR_API_KEY" \
-H "Accept: Application/vnd.pterodactyl.v1+json"

Create New Node

Create a new Wings daemon node in the panel.

POST /api/application/nodes

Request Body

FieldTypeRequiredDescription
namestringYesNode display name
descriptionstringNoNode description
location_idintegerYesLocation ID where node is located
fqdnstringYesFully qualified domain name
schemestringNoConnection scheme (http/https)
behind_proxybooleanNoWhether node is behind a proxy
publicbooleanNoWhether node is publicly accessible
daemon_basestringNoBase directory for daemon files
daemon_sftpintegerNoSFTP port (default: 2022)
daemon_listenintegerNoDaemon listen port (default: 8080)
memoryintegerYesTotal memory in MB
memory_overallocateintegerNoMemory overallocation percentage
diskintegerYesTotal disk space in MB
disk_overallocateintegerNoDisk overallocation percentage
upload_sizeintegerNoMaximum upload size in MB (default: 100)
maintenance_modebooleanNoWhether node is in maintenance mode

Example Request

curl -X POST "https://your-panel.com/api/application/nodes" \
-H "Authorization: Bearer ptla_YOUR_API_KEY" \
-H "Accept: Application/vnd.pterodactyl.v1+json" \
-H "Content-Type: application/json" \
-d '{
"name": "Node 2",
"description": "Secondary node for testing",
"location_id": 1,
"fqdn": "node2.example.com",
"scheme": "https",
"behind_proxy": false,
"public": true,
"daemon_base": "/var/lib/pterodactyl/volumes",
"daemon_sftp": 2022,
"daemon_listen": 8080,
"memory": 16384,
"memory_overallocate": 0,
"disk": 204800,
"disk_overallocate": 0,
"upload_size": 100,
"maintenance_mode": false
}'

Example Response

{
"object": "node",
"attributes": {
"id": 2,
"uuid": "bf3b26c0-9d2e-4d8f-8c8a-1234567890ab",
"public": true,
"name": "Node 2",
"description": "Secondary node for testing",
"location_id": 1,
"fqdn": "node2.example.com",
"scheme": "https",
"behind_proxy": false,
"maintenance_mode": false,
"memory": 16384,
"memory_overallocate": 0,
"disk": 204800,
"disk_overallocate": 0,
"upload_size": 100,
"daemon_listen": 8080,
"daemon_sftp": 2022,
"daemon_base": "/var/lib/pterodactyl/volumes",
"created_at": "2024-01-20T14:30:45+00:00",
"updated_at": "2024-01-20T14:30:45+00:00",
"allocated_resources": {
"memory": 0,
"disk": 0
}
}
}

Update Node Configuration

Update an existing node's configuration.

PATCH /api/application/nodes/{node}

Path Parameters

ParameterTypeDescription
nodeintegerNode ID

Request Body

FieldTypeRequiredDescription
namestringNoNode display name
descriptionstringNoNode description
location_idintegerNoLocation ID
fqdnstringNoFully qualified domain name
schemestringNoConnection scheme
behind_proxybooleanNoWhether node is behind a proxy
publicbooleanNoWhether node is publicly accessible
daemon_basestringNoBase directory for daemon files
daemon_sftpintegerNoSFTP port
daemon_listenintegerNoDaemon listen port
memoryintegerNoTotal memory in MB
memory_overallocateintegerNoMemory overallocation percentage
diskintegerNoTotal disk space in MB
disk_overallocateintegerNoDisk overallocation percentage
upload_sizeintegerNoMaximum upload size in MB
maintenance_modebooleanNoWhether node is in maintenance mode

Example Request

curl -X PATCH "https://your-panel.com/api/application/nodes/2" \
-H "Authorization: Bearer ptla_YOUR_API_KEY" \
-H "Accept: Application/vnd.pterodactyl.v1+json" \
-H "Content-Type: application/json" \
-d '{
"name": "Updated Node 2",
"description": "Updated description for node 2",
"memory": 20480,
"disk": 409600
}'

Get Node Configuration

Get the Wings daemon configuration for a node.

GET /api/application/nodes/{node}/configuration

This endpoint returns the complete Wings configuration that should be placed in the Wings configuration file.

Example Request

curl "https://your-panel.com/api/application/nodes/1/configuration" \
-H "Authorization: Bearer ptla_YOUR_API_KEY" \
-H "Accept: Application/vnd.pterodactyl.v1+json"

Response

Returns HTTP 204 No Content on successful deletion.

Error Responses

Common Error Codes

Status CodeDescription
400Bad Request - Invalid input data
401Unauthorized - Invalid API key
403Forbidden - Insufficient permissions
404Not Found - Node does not exist
422Validation Error - Invalid field values
429Too Many Requests - Rate limit exceeded

Example Error Response

{
"errors": [
{
"code": "ValidationException",
"status": "422",
"detail": "The fqdn field is required.",
"source": {
"field": "fqdn"
}
}
]
}

Best Practices

Security Considerations

  1. API Key Protection: Store API keys securely and never expose them in client-side code
  2. HTTPS Only: Always use HTTPS for API requests and Wings communication
  3. Firewall Configuration: Properly configure firewalls for node communication
  4. Regular Updates: Keep Wings daemon updated to latest version
  5. Secure Configuration: Use secure Wings configuration with proper SSL certificates

Performance Tips

  1. Resource Planning: Plan memory and disk allocations carefully
  2. Monitoring: Monitor node resource usage and performance
  3. Allocation Management: Create allocations efficiently to avoid conflicts
  4. Maintenance Mode: Use maintenance mode for node updates
  5. Load Balancing: Distribute servers across multiple nodes

Wings Setup

After creating a node via the API, you'll need to:

  1. Install Wings: Install the Wings daemon on the target server
  2. Configure Wings: Use the configuration endpoint to get the Wings config
  3. Start Wings: Start the Wings daemon with the configuration
  4. Verify Connection: Ensure the node appears as connected in the panel

Integration Examples

// Node management service example
class NodeService {
constructor(apiKey, baseUrl) {
this.apiKey = apiKey;
this.baseUrl = baseUrl;
this.headers = {
'Authorization': `Bearer ${apiKey}`,
'Accept': 'Application/vnd.pterodactyl.v1+json',
'Content-Type': 'application/json'
};
}

async getAllNodes(options = {}) {
const params = new URLSearchParams(options);
const response = await fetch(`${this.baseUrl}/api/application/nodes?${params}`, {
headers: this.headers
});
return response.json();
}

async createNode(nodeData) {
const response = await fetch(`${this.baseUrl}/api/application/nodes`, {
method: 'POST',
headers: this.headers,
body: JSON.stringify(nodeData)
});
return response.json();
}

async getNodeConfiguration(nodeId) {
const response = await fetch(`${this.baseUrl}/api/application/nodes/${nodeId}/configuration`, {
headers: this.headers
});
return response.json();
}

async createAllocations(nodeId, allocationData) {
const response = await fetch(`${this.baseUrl}/api/application/nodes/${nodeId}/allocations`, {
method: 'POST',
headers: this.headers,
body: JSON.stringify(allocationData)
});
return response.json();
}

async deleteNode(nodeId) {
const response = await fetch(`${this.baseUrl}/api/application/nodes/${nodeId}`, {
method: 'DELETE',
headers: this.headers
});
return response.status === 204;
}
}

Rate Limiting

The Application API implements rate limiting to prevent abuse:

  • Default Limit: 240 requests per minute per API key
  • Burst Limit: Up to 10 requests per second
  • Headers: Response includes rate limit headers
X-RateLimit-Limit: 240
X-RateLimit-Remaining: 235
X-RateLimit-Reset: 1642686400

Source Code References

Controllers and Routes

Method: NodeController@index (List Nodes)
Route: GET /api/application/nodes
Source: NodeController.php

Method: NodeController@view (Get Node)
Route: GET /api/application/nodes/{node}
Source: NodeController.php

Method: NodeController@store (Create Node)
Route: POST /api/application/nodes
Source: NodeController.php

Method: NodeController@update (Update Node)
Route: PATCH /api/application/nodes/{node}
Source: NodeController.php

Method: NodeController@delete (Delete Node)
Route: DELETE /api/application/nodes/{node}
Source: NodeController.php

Method: NodeConfigurationController@configuration (Get Configuration)
Route: GET /api/application/nodes/{node}/configuration
Source: NodeConfigurationController.php

Method: AllocationController@index (List Allocations)
Route: GET /api/application/nodes/{node}/allocations
Source: AllocationController.php

Method: AllocationController@store (Create Allocations)
Route: POST /api/application/nodes/{node}/allocations
Source: AllocationController.php

Method: AllocationController@delete (Delete Allocation)
Route: DELETE /api/application/nodes/{node}/allocations/{allocation}
Source: AllocationController.php

Services

Node Creation Service: NodeCreationService.php
Node Update Service: NodeUpdateService.php
Node Deletion Service: NodeDeletionService.php
Allocation Services: Allocation Services

Models and Validation

Node Model: Node.php
Allocation Model: Allocation.php
Node Store Request: StoreNodeRequest.php
Node Update Request: UpdateNodeRequest.php

Route Definitions

Application Routes: api-application.php - Lines 75-90

For detailed implementation and the latest updates, refer to the Pterodactyl Panel repository.