Permissions endpoints (Admin API)
5 FeatherPanel Admin API endpoints from admin/permissions.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/permissions.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/permissions
Get all permissions Retrieve a paginated list of all permissions with optional search functionality and role filtering.
| 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 permissions by permission name |
role_id | query | integer | no | Filter permissions by specific role ID |
Response data field | Type | Description |
|---|---|---|
permissions | Permission[] | |
pagination | PermissionPagination | |
search | object |
curl -X GET "$PANEL_URL/api/admin/permissions" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json"Responses: 200 Permissions retrieved successfully · 401 Unauthorized · 403 Forbidden - Insufficient permissions
GET/api/admin/permissions/{id}
Get permission by ID Retrieve a specific permission by its ID.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | integer | yes | Permission ID |
Response data field | Type | Description |
|---|---|---|
permission | Permission |
curl -X GET "$PANEL_URL/api/admin/permissions/$ID" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json"Responses: 200 Permission retrieved successfully · 400 Bad request - Invalid permission ID · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 404 Permission not found
PATCH/api/admin/permissions/{id}
Update permission Update an existing permission. Only provided fields will be updated. Validates role ID and permission name format.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | integer | yes | Permission ID |
Request body: PermissionUpdate (application/json)
| Body field | Type | Required | Description |
|---|---|---|---|
role_id | integer | no | Role ID |
permission | string | no | Permission name |
Response data field | Type | Description |
|---|---|---|
permission | Permission |
curl -X PATCH "$PANEL_URL/api/admin/permissions/$ID" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"role_id":0,"permission":""}'Plugin events: featherpanel:admin:permissions:permission:updated
Responses: 200 Permission updated successfully · 400 Bad request - Invalid JSON, no data provided, invalid data types, or validation errors · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 404 Permission not found · 500 Internal server error - Failed to update permission
DELETE/api/admin/permissions/{id}
Delete permission Permanently delete a permission from the database. This action cannot be undone.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
id | path | integer | yes | Permission ID |
Response data field | Type | Description |
|---|---|---|
message | string | Success message |
curl -X DELETE "$PANEL_URL/api/admin/permissions/$ID" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json"Plugin events: featherpanel:admin:permissions:permission:deleted
Responses: 200 Permission deleted successfully · 400 Bad request - Invalid permission ID · 401 Unauthorized · 403 Forbidden - Insufficient permissions · 404 Permission not found · 500 Internal server error - Failed to delete permission
PUT/api/admin/permissions
Create new permission Create a new permission for a specific role. Validates role ID and permission name format.
Request body: PermissionCreate (application/json)
| Body field | Type | Required | Description |
|---|---|---|---|
role_id | integer | yes | Role ID |
permission | string | yes | Permission name |
Response data field | Type | Description |
|---|---|---|
permission | Permission |
curl -X PUT "$PANEL_URL/api/admin/permissions" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"role_id":0,"permission":""}'Plugin events: featherpanel:admin:permissions:permission:created
Responses: 201 Permission 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 permission