File Manager endpoints (Admin API)
5 FeatherPanel Admin API endpoints from admin/file-manager.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/file-manager.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/file-manager/browse
Browse directory contents Browse the contents of a directory in the project filesystem. Only available in developer mode and requires ADMIN_ROOT permissions.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
path | query | string | no | Directory path to browse (relative to project root) |
Response data field | Type | Description |
|---|---|---|
path | string | Current directory path |
items | FileItem[] | |
parent | string | Parent directory path |
curl -X GET "$PANEL_URL/api/admin/file-manager/browse" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json"Responses: 200 Directory contents retrieved successfully · 401 Unauthorized · 403 Forbidden - Developer mode not enabled or insufficient permissions · 404 Directory not found · 500 Internal server error - Failed to browse directory
GET/api/admin/file-manager/read
Read file contents Read the contents of a file. Binary files will return null content with isBinary flag set to true. Only available in developer mode and requires ADMIN_ROOT permissions.
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
path | query | string | yes | File path to read (relative to project root) |
Response data: FileContent
Response data field | Type | Description |
|---|---|---|
path | string | File path |
content | string | File content (null for binary files) |
isBinary | boolean | Whether the file is binary |
mimeType | string | MIME type of the file |
extension | string | File extension |
size | integer | File size in bytes |
modified | integer | Last modification timestamp |
curl -X GET "$PANEL_URL/api/admin/file-manager/read?path=$PATH" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json"Responses: 200 File content retrieved successfully · 400 Bad request - Path is not a file · 401 Unauthorized · 403 Forbidden - Developer mode not enabled or insufficient permissions · 404 File not found · 413 File too large (max 5MB) · 500 Internal server error - Failed to read file
POST/api/admin/file-manager/save
Save file contents Save content to a file. Creates backup of existing files before overwriting. Only available in developer mode and requires ADMIN_ROOT permissions.
Request body: FileSave (application/json)
| Body field | Type | Required | Description |
|---|---|---|---|
path | string | yes | File path to save |
content | string | yes | File content to write |
Response data field | Type | Description |
|---|---|---|
path | string | File path |
size | integer | Number of bytes written |
modified | integer | Last modification timestamp |
curl -X POST "$PANEL_URL/api/admin/file-manager/save" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"path":"","content":""}'Plugin events: featherpanel:admin:file_manager:file:saved
Responses: 200 File saved successfully · 401 Unauthorized · 403 Forbidden - Developer mode not enabled, insufficient permissions, or access denied to path · 500 Internal server error - Failed to save file
POST/api/admin/file-manager/create
Create file or directory Create a new file or directory. Only available in developer mode and requires ADMIN_ROOT permissions.
Request body: FileCreate (application/json)
| Body field | Type | Required | Description |
|---|---|---|---|
path | string | yes | Path for the new file or directory |
isDirectory | boolean | no | Whether to create a directory (default: false) |
Response data field | Type | Description |
|---|---|---|
path | string | Created file or directory path |
isDirectory | boolean | Whether a directory was created |
created | integer | Creation timestamp |
curl -X POST "$PANEL_URL/api/admin/file-manager/create" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"path":"","isDirectory":false}'Plugin events: featherpanel:admin:file_manager:file:created
Responses: 200 File or directory created successfully · 401 Unauthorized · 403 Forbidden - Developer mode not enabled, insufficient permissions, or access denied to path · 409 Conflict - File or directory already exists · 500 Internal server error - Failed to create file or directory
POST/api/admin/file-manager/delete
Delete file or directory Delete a file or directory (recursively for directories). Prevents deletion of critical system directories. Only available in developer mode and requires ADMIN_ROOT permissions.
Request body: FileDelete (application/json)
| Body field | Type | Required | Description |
|---|---|---|---|
path | string | yes | Path of the file or directory to delete |
Response data field | Type | Description |
|---|---|---|
message | string | Success message |
curl -X POST "$PANEL_URL/api/admin/file-manager/delete" \
-H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
-H "Accept: application/json" \
-H "Content-Type: application/json" \
-d '{"path":""}'Plugin events: featherpanel:admin:file_manager:file:deleted
Responses: 200 File or directory deleted successfully · 401 Unauthorized · 403 Forbidden - Developer mode not enabled, insufficient permissions, access denied to path, or critical system directory · 404 File or directory not found · 500 Internal server error - Failed to delete file or directory