# File Manager endpoints (Admin API)

> 5 FeatherPanel Admin API endpoints from admin/file-manager.php: methods, paths, auth, permissions, rate limits, parameters and responses.

Source: https://featherpanel.com/docs/api/reference/admin/file-manager/

Defined in [`backend/app/routes/admin/file-manager.php`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/file-manager.php). Authentication used here: **Admin**. Read [Authentication](https://featherpanel.com/docs/api/authentication/) for how to send credentials and [Rate limits and errors](https://featherpanel.com/docs/api/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: Admin
- Permission: `admin.root`
- Route name: `admin-file-manager-browse`
- Controller: [`FileManagerController::browse`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/FileManagerController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/file-manager.php#L25)

**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 |

```bash
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: Admin
- Permission: `admin.root`
- Route name: `admin-file-manager-read`
- Controller: [`FileManagerController::readFile`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/FileManagerController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/file-manager.php#L35)

**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`](https://featherpanel.com/docs/api/schemas/#schema-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 |

```bash
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: Admin
- Permission: `admin.root`
- Route name: `admin-file-manager-save`
- Controller: [`FileManagerController::saveFile`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/FileManagerController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/file-manager.php#L45)

**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`](https://featherpanel.com/docs/api/schemas/#schema-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 |

```bash
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`](https://featherpanel.com/docs/plugins/events/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: Admin
- Permission: `admin.root`
- Route name: `admin-file-manager-create`
- Controller: [`FileManagerController::createFile`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/FileManagerController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/file-manager.php#L56)

**Create file or directory** Create a new file or directory. Only available in developer mode and requires ADMIN\_ROOT permissions.

Request body: [`FileCreate`](https://featherpanel.com/docs/api/schemas/#schema-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 |

```bash
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`](https://featherpanel.com/docs/plugins/events/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: Admin
- Permission: `admin.root`
- Route name: `admin-file-manager-delete`
- Controller: [`FileManagerController::deleteFile`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/FileManagerController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/file-manager.php#L67)

**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`](https://featherpanel.com/docs/api/schemas/#schema-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 |

```bash
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`](https://featherpanel.com/docs/plugins/events/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
