Skip to content

WebSocket - System

Browse the filesystem, read and update settings, run allowlisted commands, and shut down the backend.

These events let you browse the base directories System Bridge exposes, list and inspect files within them, and validate paths.

The available base directory keys are documents, downloads, home, music, pictures and videos, plus any custom directories configured in media.directories in your settings.

Send the GET_DIRECTORIES event to list the available base directories. It takes no data and responds with the DIRECTORIES type.

Request
{
"id": "abc123",
"token": "abc123",
"event": "GET_DIRECTORIES",
"data": {}
}

Send the GET_DIRECTORY event with the base directory key to look up a single directory. It responds with the DIRECTORY type.

Request
{
"id": "abc123",
"token": "abc123",
"event": "GET_DIRECTORY",
"data": {
"base": "documents"
}
}

Send the GET_FILES event with a base directory, and optionally a relative path within it, to list files. It responds with the FILES type.

Request
{
"id": "abc123",
"token": "abc123",
"event": "GET_FILES",
"data": {
"base": "documents",
"path": "subfolder"
}
}

Send the GET_FILE event with the absolute path to a file to get its information. It responds with the FILE type.

Request
{
"id": "abc123",
"token": "abc123",
"event": "GET_FILE",
"data": {
"path": "/home/user/Documents/example.txt"
}
}

To read the contents of a media file, use the Media File Data HTTP endpoint instead.

Send the VALIDATE_DIRECTORY event with a path to check whether it exists and is a directory. It responds with the DIRECTORY_VALIDATED type and a data.valid boolean.

Request
{
"id": "abc123",
"token": "abc123",
"event": "VALIDATE_DIRECTORY",
"data": {
"path": "/home/user/Music"
}
}

Send the GET_DISK_MOUNTS event to list mounted disks, categorised into primary and secondary (bind and squashfs) mounts. It takes no data and responds with the DISK_MOUNTS type.

Request
{
"id": "abc123",
"token": "abc123",
"event": "GET_DISK_MOUNTS",
"data": {}
}

Read and update the backend settings over the WebSocket connection.

Send the GET_SETTINGS event to retrieve the current settings. It takes no data and responds with the SETTINGS_RESULT type.

Request
{
"id": "abc123",
"token": "abc123",
"event": "GET_SETTINGS",
"data": {}
}

Send the UPDATE_SETTINGS event with the settings object to update. It responds with the SETTINGS_UPDATED type and the updated settings.

Request
{
"id": "abc123",
"token": "abc123",
"event": "UPDATE_SETTINGS",
"data": {
"autostart": true,
"logLevel": "INFO"
}
}
KeyTypeDescription
autostartbooleanStart the backend automatically when you log in.
logLevelstringOne of DEBUG, INFO, WARN, ERROR. Defaults to WARN.
hotkeysarrayList of { name, key } hotkey bindings.
commands.allowlistarrayCommands that can be run via Execute Command. Each entry is { id, name, command, workingDir, arguments }.
disks.allowedSecondaryMountPointsarraySecondary mount points to include in disk data.
media.directoriesarrayCustom media directories as { name, path }, exposed as base directories.

Run a command from the allowlist defined in your settings.

Send the COMMAND_EXECUTE event with the commandID of an allowlisted command:

Request
{
"id": "abc123",
"token": "abc123",
"event": "COMMAND_EXECUTE",
"data": {
"commandID": "my-command"
}
}

The command runs asynchronously. You receive a COMMAND_EXECUTING response immediately, followed by a COMMAND_COMPLETED response once it finishes.

Send the EXIT_APPLICATION event to shut down the backend. It takes empty data.

Request
{
"id": "abc123",
"token": "abc123",
"event": "EXIT_APPLICATION",
"data": {}
}