View .md

Realms endpoints (Admin API)

5 FeatherPanel Admin API endpoints from admin/realms.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/realms.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/realms

Auth: AdminPermission: admin.realms.viewRoute name: admin-realmsController: RealmsController::indexroute source

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

ParameterInTypeRequiredDescription
pagequeryintegernoPage number for pagination
limitqueryintegernoNumber of records per page
searchquerystringnoSearch term to filter realms by name or description
Response data fieldTypeDescription
realmsRealm[]
paginationRealmPagination
searchobject
curl -X GET "$PANEL_URL/api/admin/realms" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"

Responses: 200 Realms retrieved successfully · 401 Unauthorized · 403 Forbidden - Insufficient permissions

GET/api/admin/realms/{id}

Auth: AdminPermission: admin.realms.viewRoute name: admin-realms-showController: RealmsController::showroute source

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

ParameterInTypeRequiredDescription
idpathintegeryesRealm ID
Response data fieldTypeDescription
realmRealm
curl -X GET "$PANEL_URL/api/admin/realms/$ID" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"

Responses: 200 Realm retrieved successfully · 400 Bad request - Invalid realm ID · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 404 Realm not found

PATCH/api/admin/realms/{id}

Auth: AdminPermission: admin.realms.editRoute name: admin-realms-updateController: RealmsController::updateroute source

Update realm Update an existing realm. Only provided fields will be updated. Validates field lengths and data types.

ParameterInTypeRequiredDescription
idpathintegeryesRealm ID

Request body: RealmUpdate (application/json)

Body fieldTypeRequiredDescription
namestringnoRealm name
descriptionstringnoRealm description
Response data fieldTypeDescription
realmRealm
curl -X PATCH "$PANEL_URL/api/admin/realms/$ID" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"name":"","description":""}'

Plugin events: featherpanel:admin:realms:realm:updated

Responses: 200 Realm updated successfully · 400 Bad request - Invalid JSON, no data provided, invalid data types, or validation errors · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 404 Realm not found · 500 Internal server error - Failed to update realm

DELETE/api/admin/realms/{id}

Auth: AdminPermission: admin.realms.deleteRoute name: admin-realms-deleteController: RealmsController::deleteroute source

Delete realm Permanently delete a realm from the database. This action cannot be undone.

ParameterInTypeRequiredDescription
idpathintegeryesRealm ID
Response data fieldTypeDescription
messagestringSuccess message
curl -X DELETE "$PANEL_URL/api/admin/realms/$ID" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"

Plugin events: featherpanel:admin:realms:realm:deleted

Responses: 200 Realm deleted successfully · 400 Bad request - Invalid realm ID or realm has spells assigned · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 404 Realm not found · 500 Internal server error - Failed to delete realm

PUT/api/admin/realms

Auth: AdminPermission: admin.realms.createRoute name: admin-realms-createController: RealmsController::createroute source

Create new realm Create a new realm with name and optional description. Validates field lengths and data types.

Request body: RealmCreate (application/json)

Body fieldTypeRequiredDescription
namestringyesRealm name
descriptionstringnoRealm description
idintegernoOptional realm ID (useful for migrations from other platforms)
Response data fieldTypeDescription
realmRealm
curl -X PUT "$PANEL_URL/api/admin/realms" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"name":"","description":"","id":0}'

Plugin events: featherpanel:admin:realms:realm:created

Responses: 201 Realm 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 realm