Allocations endpoints (Admin API)
11 FeatherPanel Admin API endpoints from admin/allocations.php: methods, paths, auth, permissions, rate limits, parameters and responses.
Last synced from FeatherPanel 15b94e9 on .
On this page
Defined in backend/app/routes/admin/allocations.php. Authentication used here: Admin. Read Authentication for how to send credentials and Rate limits and errors for the response envelope.
Paths, methods, permissions and rate limits come from the route file. Summaries, parameters and response codes come from the OpenAPI annotations on the controllers; endpoints without annotations show only what the route file declares.
Endpoints
GET/api/admin/allocations
Get all allocations Retrieve a paginated list of all IP allocations with optional filtering by node, server, and search query.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
page | query | integer | no | Page number for pagination |
limit | query | integer | no | Number of records per page |
search | query | string | no | Search term to filter allocations by IP, port, or notes |
node_id | query | integer | no | Filter allocations by node ID |
server_id | query | integer | no | Filter allocations by server ID |
Response data field | Type | Description |
|---|---|---|
allocations | Allocation[] | |
pagination | Pagination | |
search | object |
curl -X GET "$PANEL_URL/api/admin/allocations" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json"Responses: 200 Allocations retrieved successfully · 401 Unauthorized · 403 Forbidden - Insufficient permissions
PUT/api/admin/allocations
Create new allocation(s) Create one or more IP allocations. Supports single port or port range creation. Port ranges are limited to 1000 ports maximum.
| Body field | Type | Required | Description |
|---|---|---|---|
id | integer | no | Optional allocation ID (for migrations) |
node_id | integer | yes | Node ID where allocation will be created |
ip | string | yes | IP address for the allocation |
port | integer | string | yes | |
ip_alias | string | no | Optional IP alias |
server_id | integer | no | Optional server ID to assign allocation to |
notes | string | no | Optional notes for the allocation |
Response data field | Type | Description |
|---|---|---|
allocations | Allocation[] | |
created_count | integer | Number of allocations created |
total_requested | integer | Total number of ports requested |
skipped_count | integer | Number of ports skipped (already exist) |
existing_ports | integer[] | List of ports that already existed |
curl -X PUT "$PANEL_URL/api/admin/allocations" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"id":0,"node_id":0,"ip":"","port":0,"ip_alias":"","server_id":0,"notes":""}'Plugin events: featherpanel:admin:allocations:allocation:created
Responses: 201 Allocation(s) created successfully · 400 Bad request - Invalid data or validation errors · 401 Unauthorized · 403 Forbidden - Insufficient permissions
GET/api/admin/allocations/available
Get available allocations Retrieve a paginated list of allocations that are not assigned to any server. Optionally filter by node.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
page | query | integer | no | Page number for pagination |
limit | query | integer | no | Number of records per page |
node_id | query | integer | no | Filter available allocations to a specific node |
Response data field | Type | Description |
|---|---|---|
allocations | Allocation[] | |
pagination | object |
curl -X GET "$PANEL_URL/api/admin/allocations/available" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json"Responses: 200 Available allocations retrieved successfully · 401 Unauthorized · 403 Forbidden - Insufficient permissions
DELETE/api/admin/allocations/bulk-delete
Bulk delete allocations Delete multiple allocations at once by providing an array of allocation IDs. Only unassigned allocations will be deleted. Allocations assigned to servers will be skipped.
| Body field | Type | Required | Description |
|---|---|---|---|
ids | integer[] | yes | Array of allocation IDs to delete |
Response data field | Type | Description |
|---|---|---|
deleted_count | integer | Number of allocations deleted |
skipped_count | integer | Number of allocations skipped (assigned to servers) |
skipped_ids | integer[] | IDs of allocations that were skipped |
curl -X DELETE "$PANEL_URL/api/admin/allocations/bulk-delete" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"ids":[]}'Plugin events: featherpanel:admin:allocations:allocation:deleted
Responses: 200 Allocations deleted successfully · 400 Bad request - Invalid or missing IDs · 401 Unauthorized · 403 Forbidden - Insufficient permissions
DELETE/api/admin/allocations/delete-unused
Delete unused allocations Delete all allocations that are not assigned to any server. Optionally filter by node ID and/or IP address (subnet).
| Body field | Type | Required | Description |
|---|---|---|---|
node_id | integer | no | Optional node ID to filter deletions |
ip | string | no | Optional IP address to filter deletions by subnet/IP |
Response data field | Type | Description |
|---|---|---|
deleted_count | integer | Number of allocations deleted |
curl -X DELETE "$PANEL_URL/api/admin/allocations/delete-unused" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"node_id":0,"ip":""}'Plugin events: featherpanel:admin:allocations:allocation:deleted
Responses: 200 Unused allocations deleted successfully · 400 Bad request - Invalid node ID or IP address · 401 Unauthorized · 403 Forbidden - Insufficient permissions
PATCH/api/admin/allocations/bulk-address
Bulk update allocation IP or alias Update the IP address and/or IP alias for every allocation on a node that currently uses a specific IP address.
| Body field | Type | Required | Description |
|---|---|---|---|
node_id | integer | yes | Node ID containing the allocations |
from_ip | string | yes | Current allocation IP address |
to_ip | string | no | New allocation IP address |
ip_alias | string | no | New IP alias. Send null or an empty string to clear it. |
curl -X PATCH "$PANEL_URL/api/admin/allocations/bulk-address" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"node_id":0,"from_ip":"","to_ip":"","ip_alias":""}'Plugin events: featherpanel:admin:allocations:allocation:updated
Responses: 200 Allocations updated successfully · 400 Bad request - Invalid data · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 404 Node or matching allocations not found · 409 Target IP has ports already assigned to another server
GET/api/admin/allocations/{id}
Get allocation by ID Retrieve a specific allocation by its ID with associated node and server information.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | integer | yes | Allocation ID |
Response data field | Type | Description |
|---|---|---|
allocation | Allocation |
curl -X GET "$PANEL_URL/api/admin/allocations/$ID" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json"Responses: 200 Allocation retrieved successfully · 400 Invalid ID format · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 404 Allocation not found
PATCH/api/admin/allocations/{id}
Update allocation Update an existing allocation. Only provided fields will be updated. IP and port combinations must be unique per node.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | integer | yes | Allocation ID |
| Body field | Type | Required | Description |
|---|---|---|---|
node_id | integer | no | Node ID |
ip | string | no | IP address |
port | integer | no | Port number |
ip_alias | string | no | IP alias |
server_id | integer | no | Server ID to assign allocation to |
notes | string | no | Allocation notes |
Response data field | Type | Description |
|---|---|---|
allocation | Allocation |
curl -X PATCH "$PANEL_URL/api/admin/allocations/$ID" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"node_id":0,"ip":"","port":0,"ip_alias":"","server_id":0,"notes":""}'Plugin events: featherpanel:admin:allocations:allocation:updated
Responses: 200 Allocation updated successfully · 400 Bad request - Invalid data or validation errors · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 404 Allocation not found
DELETE/api/admin/allocations/{id}
Delete allocation Permanently delete an allocation. This action cannot be undone. Only unassigned allocations can be deleted.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | integer | yes | Allocation ID |
Response data field | Type | Description |
|---|---|---|
message | string | Success message |
curl -X DELETE "$PANEL_URL/api/admin/allocations/$ID" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json"Plugin events: featherpanel:admin:allocations:allocation:deleted
Responses: 200 Allocation deleted successfully · 400 Bad request - Failed to delete allocation · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 404 Allocation not found · 409 Conflict - Allocation is assigned to a server
POST/api/admin/allocations/{id}/assign
Assign allocation to server Assign an unassigned allocation to a specific server.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | integer | yes | Allocation ID |
| Body field | Type | Required | Description |
|---|---|---|---|
server_id | integer | yes | Server ID to assign allocation to |
Response data field | Type | Description |
|---|---|---|
allocation | Allocation |
curl -X POST "$PANEL_URL/api/admin/allocations/$ID/assign" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"server_id":0}'Responses: 200 Allocation assigned to server successfully · 400 Bad request - Invalid server ID or assignment failed · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 404 Allocation not found
POST/api/admin/allocations/{id}/unassign
Unassign allocation from server Remove the server assignment from an allocation, making it available for reassignment.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | integer | yes | Allocation ID |
Response data field | Type | Description |
|---|---|---|
allocation | Allocation |
curl -X POST "$PANEL_URL/api/admin/allocations/$ID/unassign" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json"Responses: 200 Allocation unassigned from server successfully · 400 Bad request - Allocation not assigned or unassignment failed · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 404 Allocation not found