View .md

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

Auth: AdminPermission: admin.locations.viewRoute name: admin-locationsController: LocationsController::indexroute source

Get all locations Retrieve a paginated list of all locations with optional search functionality.

ParameterInTypeRequiredDescription
pagequeryintegernoPage number for pagination
limitqueryintegernoNumber of records per page
searchquerystringnoSearch term to filter locations by name
typequerystringnoFilter by location purpose (game = Wings/game servers, vps = VDS/VM nodes, web = web hosting)
Response data fieldTypeDescription
locationsLocation[]
paginationLocationPagination
searchobject
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}

Auth: AdminPermission: admin.locations.viewRoute name: admin-locations-showController: LocationsController::showroute source

Get location by ID Retrieve a specific location by its ID.

ParameterInTypeRequiredDescription
idpathintegeryesLocation ID
Response data fieldTypeDescription
locationLocation
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}

Auth: AdminPermission: admin.locations.editRoute name: admin-locations-updateController: LocationsController::updateroute source

Update location Update an existing location. Only provided fields will be updated. Validates field lengths.

ParameterInTypeRequiredDescription
idpathintegeryesLocation ID

Request body: LocationUpdate (application/json)

Body fieldTypeRequiredDescription
namestringnoLocation name
descriptionstringnoLocation description
flag_codestringnoISO 3166-1 alpha-2 country code (e.g., "us", "ua") for flag display. Set to null to remove the flag.
typestringnoLocation purpose: game hosting, VPS/VDS, or web hosting (immutable after creation)
Response data fieldTypeDescription
locationLocation
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}

Auth: AdminPermission: admin.locations.deleteRoute name: admin-locations-deleteController: LocationsController::deleteroute source

Delete location Permanently delete a location record.

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

Auth: AdminPermission: admin.locations.createRoute name: admin-locations-createController: LocationsController::createroute source

Create new location Create a new location with name and optional description. Validates field lengths.

Request body: LocationCreate (application/json)

Body fieldTypeRequiredDescription
namestringyesLocation name
descriptionstringnoLocation description
flag_codestringnoISO 3166-1 alpha-2 country code (e.g., "us", "ua") for flag display
typestringyesLocation purpose: game hosting, VPS/VDS, or web hosting (immutable after creation)
webhosting_alpha_acceptedbooleannoRequired to be true when creating a Web Hosting location
idintegernoOptional location ID (useful for migrations from other platforms)
Response data fieldTypeDescription
locationLocation
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