The settings API manages persistent key-value configuration flags stored in SQLite.


1. Retrieve Settings

Fetch all system settings and global preferences. Requires an active authenticated session:

GET/api/v1/settings
bash
curl http://localhost:8866/api/v1/settings \
  -H "Authorization: Bearer <session-token>"

Response (200 OK)

json
{
  "theme": "dark",
  "default_view": "columns",
  "show_hidden_files": "false",
  "accent_color": "blue",
  "density": "compact",
  "allow_public_shares": "true",
  "trash_retention_days": "30"
}

2. Update System Settings

Update one or more configuration keys. Requires administrator role:

PUT/api/v1/settings
bash
curl -X PUT http://localhost:8866/api/v1/settings \
  -H "Authorization: Bearer <admin-session-token>" \
  -H "Content-Type: application/json" \
  -d '{
    "theme": "dark",
    "default_view": "list",
    "show_hidden_files": "true",
    "trash_retention_days": "14"
  }'

Response (200 OK)

json
{
  "success": true,
  "message": "Settings saved"
}