Locations endpoints (Admin API)
5 FeatherPanel Admin API endpoints from admin/locations.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/locations.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/locations
Get all locations Retrieve a paginated list of all locations with optional search functionality.
| 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 locations by name |
type | query | string | no | Filter by location purpose (game = Wings/game servers, vps = VDS/VM nodes, web = web hosting) |
Response data field | Type | Description |
|---|---|---|
locations | Location[] | |
pagination | LocationPagination | |
search | object |
curl -X GET "$PANEL_URL/api/admin/locations" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json"Responses: 200 Locations retrieved successfully · 401 Unauthorized · 403 Forbidden - Insufficient permissions
GET/api/admin/locations/{id}
Get location by ID Retrieve a specific location by its ID.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | integer | yes | Location ID |
Response data field | Type | Description |
|---|---|---|
location | Location |
curl -X GET "$PANEL_URL/api/admin/locations/$ID" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json"Responses: 200 Location retrieved successfully · 400 Bad request - Invalid location ID · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 404 Location not found
PATCH/api/admin/locations/{id}
Update location Update an existing location. Only provided fields will be updated. Validates field lengths.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | integer | yes | Location ID |
Request body: LocationUpdate (application/json)
| Body field | Type | Required | Description |
|---|---|---|---|
name | string | no | Location name |
description | string | no | Location description |
flag_code | string | no | ISO 3166-1 alpha-2 country code (e.g., "us", "ua") for flag display. Set to null to remove the flag. |
type | string | no | Location purpose: game hosting, VPS/VDS, or web hosting (immutable after creation) |
Response data field | Type | Description |
|---|---|---|
location | Location |
curl -X PATCH "$PANEL_URL/api/admin/locations/$ID" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"name":"","description":"","flag_code":"","type":""}'Plugin events: featherpanel:admin:locations:location:updated
Responses: 200 Location updated successfully · 400 Bad request - Invalid JSON, no data provided, invalid data types, or validation errors · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 404 Location not found · 500 Internal server error - Failed to update location
DELETE/api/admin/locations/{id}
Delete location Permanently delete a location record.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | integer | yes | Location ID |
Response data field | Type | Description |
|---|---|---|
message | string | Success message |
curl -X DELETE "$PANEL_URL/api/admin/locations/$ID" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json"Plugin events: featherpanel:admin:locations:location:deleted
Responses: 200 Location deleted successfully · 400 Bad request - Invalid location ID · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 404 Location not found · 500 Internal server error - Failed to delete location
PUT/api/admin/locations
Create new location Create a new location with name and optional description. Validates field lengths.
Request body: LocationCreate (application/json)
| Body field | Type | Required | Description |
|---|---|---|---|
name | string | yes | Location name |
description | string | no | Location description |
flag_code | string | no | ISO 3166-1 alpha-2 country code (e.g., "us", "ua") for flag display |
type | string | yes | Location purpose: game hosting, VPS/VDS, or web hosting (immutable after creation) |
webhosting_alpha_accepted | boolean | no | Required to be true when creating a Web Hosting location |
id | integer | no | Optional location ID (useful for migrations from other platforms) |
Response data field | Type | Description |
|---|---|---|
location | Location |
curl -X PUT "$PANEL_URL/api/admin/locations" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"name":"","description":"","flag_code":"","type":"","webhosting_alpha_accepted":false,"id":0}'Plugin events: featherpanel:admin:locations:location:created
Responses: 201 Location created successfully · 400 Bad request - Invalid JSON, missing required fields, invalid data types, or validation errors · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 500 Internal server error - Failed to create location