# Console endpoints (Admin API)

> 2 FeatherPanel Admin API endpoints from admin/console.php: methods, paths, auth, permissions, rate limits, parameters and responses.

Source: https://featherpanel.com/docs/api/reference/admin/console/

Defined in [`backend/app/routes/admin/console.php`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/console.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

### POST `/api/admin/console/execute`

- Auth: Admin
- Permission: `admin.root`
- Route name: `admin-console-execute`
- Controller: [`ConsoleController::executeCommand`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/ConsoleController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/console.php#L25)

**Execute system command** Execute a system command in the specified working directory. This endpoint is only available in developer mode and requires ADMIN\_ROOT permissions.

| Body field | Type | Required | Description |
| --- | --- | --- | --- |
| `command` | string | yes | The command to execute |
| `cwd` | string | no | Working directory for command execution |

| Response `data` field | Type | Description |
| --- | --- | --- |
| `stdout` | string | Standard output from the command |
| `stderr` | string | Standard error output from the command |
| `return_code` | integer | Command exit code |
| `execution_time` | number | Command execution time in milliseconds |
| `command` | string | The executed command |
| `working_directory` | string | Working directory where command was executed |
| `timestamp` | string (date-time) | Command execution timestamp |

```bash
curl -X POST "$PANEL_URL/api/admin/console/execute" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"command":"","cwd":""}'
```

Plugin events: [`featherpanel:admin:console:command:executed`](https://featherpanel.com/docs/plugins/events/console/#command-executed)

Responses: `200` Command executed successfully · `400` Bad request - No command provided · `401` Unauthorized · `403` Forbidden - Developer mode not enabled or insufficient permissions · `500` Internal server error - Command execution failed

### GET `/api/admin/console/system-info`

- Auth: Admin
- Permission: `admin.root`
- Route name: `admin-console-system-info`
- Controller: [`ConsoleController::getSystemInfo`](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/Controllers/Admin/ConsoleController.php)
- [route source](https://github.com/MythicalLTD/FeatherPanel/blob/15b94e9fc9df233123706b47c42728b81e48cb3d/backend/app/routes/admin/console.php#L36)

**Get system information** Retrieve detailed system information including OS, PHP version, disk usage, memory usage, and uptime. This endpoint is only available in developer mode and requires ADMIN\_ROOT permissions.

| Response `data` field | Type | Description |
| --- | --- | --- |
| `os` | string | Operating system |
| `php_version` | string | PHP version |
| `server_software` | string | Web server software |
| `server_name` | string | Server name |
| `user` | string | Current user |
| `home` | string | Home directory |
| `working_directory` | string | Current working directory |
| `disk_usage` | object | Disk usage information |
| `memory_usage` | object | Memory usage information (Linux only) |
| `uptime` | string | System uptime |

```bash
curl -X GET "$PANEL_URL/api/admin/console/system-info" \
  -H "Authorization: Bearer $FEATHERPANEL_API_KEY" \
  -H "Accept: application/json"
```

Responses: `200` System information retrieved successfully · `401` Unauthorized · `403` Forbidden - Developer mode not enabled or insufficient permissions · `500` Internal server error - Failed to fetch system info
