View .md

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

Auth: AdminPermission: admin.allocations.viewRoute name: admin-allocationsController: AllocationsController::indexroute source

Get all allocations Retrieve a paginated list of all IP allocations with optional filtering by node, server, and search query.

ParameterInTypeRequiredDescription
pagequeryintegernoPage number for pagination
limitqueryintegernoNumber of records per page
searchquerystringnoSearch term to filter allocations by IP, port, or notes
node_idqueryintegernoFilter allocations by node ID
server_idqueryintegernoFilter allocations by server ID
Response data fieldTypeDescription
allocationsAllocation[]
paginationPagination
searchobject
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

Auth: AdminPermission: admin.allocations.createRoute name: admin-allocations-createController: AllocationsController::createroute source

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 fieldTypeRequiredDescription
idintegernoOptional allocation ID (for migrations)
node_idintegeryesNode ID where allocation will be created
ipstringyesIP address for the allocation
portinteger | stringyes
ip_aliasstringnoOptional IP alias
server_idintegernoOptional server ID to assign allocation to
notesstringnoOptional notes for the allocation
Response data fieldTypeDescription
allocationsAllocation[]
created_countintegerNumber of allocations created
total_requestedintegerTotal number of ports requested
skipped_countintegerNumber of ports skipped (already exist)
existing_portsinteger[]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

Auth: AdminPermission: admin.allocations.viewRoute name: admin-allocations-availableController: AllocationsController::getAvailableroute source

Get available allocations Retrieve a paginated list of allocations that are not assigned to any server. Optionally filter by node.

ParameterInTypeRequiredDescription
pagequeryintegernoPage number for pagination
limitqueryintegernoNumber of records per page
node_idqueryintegernoFilter available allocations to a specific node
Response data fieldTypeDescription
allocationsAllocation[]
paginationobject
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

Auth: AdminPermission: admin.allocations.deleteRoute name: admin-allocations-bulk-deleteController: AllocationsController::bulkDeleteroute source

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 fieldTypeRequiredDescription
idsinteger[]yesArray of allocation IDs to delete
Response data fieldTypeDescription
deleted_countintegerNumber of allocations deleted
skipped_countintegerNumber of allocations skipped (assigned to servers)
skipped_idsinteger[]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

Auth: AdminPermission: admin.allocations.deleteRoute name: admin-allocations-delete-unusedController: AllocationsController::deleteUnusedroute source

Delete unused allocations Delete all allocations that are not assigned to any server. Optionally filter by node ID and/or IP address (subnet).

Body fieldTypeRequiredDescription
node_idintegernoOptional node ID to filter deletions
ipstringnoOptional IP address to filter deletions by subnet/IP
Response data fieldTypeDescription
deleted_countintegerNumber 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

Auth: AdminPermission: admin.allocations.editRoute name: admin-allocations-bulk-addressController: AllocationsController::bulkUpdateAddressroute source

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 fieldTypeRequiredDescription
node_idintegeryesNode ID containing the allocations
from_ipstringyesCurrent allocation IP address
to_ipstringnoNew allocation IP address
ip_aliasstringnoNew 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}

Auth: AdminPermission: admin.allocations.viewRoute name: admin-allocations-showController: AllocationsController::showroute source

Get allocation by ID Retrieve a specific allocation by its ID with associated node and server information.

ParameterInTypeRequiredDescription
idpathintegeryesAllocation ID
Response data fieldTypeDescription
allocationAllocation
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}

Auth: AdminPermission: admin.allocations.editRoute name: admin-allocations-updateController: AllocationsController::updateroute source

Update allocation Update an existing allocation. Only provided fields will be updated. IP and port combinations must be unique per node.

ParameterInTypeRequiredDescription
idpathintegeryesAllocation ID
Body fieldTypeRequiredDescription
node_idintegernoNode ID
ipstringnoIP address
portintegernoPort number
ip_aliasstringnoIP alias
server_idintegernoServer ID to assign allocation to
notesstringnoAllocation notes
Response data fieldTypeDescription
allocationAllocation
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}

Auth: AdminPermission: admin.allocations.deleteRoute name: admin-allocations-deleteController: AllocationsController::deleteroute source

Delete allocation Permanently delete an allocation. This action cannot be undone. Only unassigned allocations can be deleted.

ParameterInTypeRequiredDescription
idpathintegeryesAllocation ID
Response data fieldTypeDescription
messagestringSuccess 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

Auth: AdminPermission: admin.allocations.editRoute name: admin-allocations-assignController: AllocationsController::assignToServerroute source

Assign allocation to server Assign an unassigned allocation to a specific server.

ParameterInTypeRequiredDescription
idpathintegeryesAllocation ID
Body fieldTypeRequiredDescription
server_idintegeryesServer ID to assign allocation to
Response data fieldTypeDescription
allocationAllocation
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

Auth: AdminPermission: admin.allocations.editRoute name: admin-allocations-unassignController: AllocationsController::unassignFromServerroute source

Unassign allocation from server Remove the server assignment from an allocation, making it available for reassignment.

ParameterInTypeRequiredDescription
idpathintegeryesAllocation ID
Response data fieldTypeDescription
allocationAllocation
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