View .md

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

Auth: AdminPermission: admin.rootRoute name: admin-file-manager-browseController: FileManagerController::browseroute source

Browse directory contents Browse the contents of a directory in the project filesystem. Only available in developer mode and requires ADMIN_ROOT permissions.

ParameterInTypeRequiredDescription
pathquerystringnoDirectory path to browse (relative to project root)
Response data fieldTypeDescription
pathstringCurrent directory path
itemsFileItem[]
parentstringParent 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

Auth: AdminPermission: admin.rootRoute name: admin-file-manager-readController: FileManagerController::readFileroute source

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.

ParameterInTypeRequiredDescription
pathquerystringyesFile path to read (relative to project root)

Response data: FileContent

Response data fieldTypeDescription
pathstringFile path
contentstringFile content (null for binary files)
isBinarybooleanWhether the file is binary
mimeTypestringMIME type of the file
extensionstringFile extension
sizeintegerFile size in bytes
modifiedintegerLast 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

Auth: AdminPermission: admin.rootRoute name: admin-file-manager-saveController: FileManagerController::saveFileroute source

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 fieldTypeRequiredDescription
pathstringyesFile path to save
contentstringyesFile content to write
Response data fieldTypeDescription
pathstringFile path
sizeintegerNumber of bytes written
modifiedintegerLast 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

Auth: AdminPermission: admin.rootRoute name: admin-file-manager-createController: FileManagerController::createFileroute source

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 fieldTypeRequiredDescription
pathstringyesPath for the new file or directory
isDirectorybooleannoWhether to create a directory (default: false)
Response data fieldTypeDescription
pathstringCreated file or directory path
isDirectorybooleanWhether a directory was created
createdintegerCreation 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

Auth: AdminPermission: admin.rootRoute name: admin-file-manager-deleteController: FileManagerController::deleteFileroute source

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 fieldTypeRequiredDescription
pathstringyesPath of the file or directory to delete
Response data fieldTypeDescription
messagestringSuccess 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