Settings API

Settings API

User preferences and configuration key-value store.

Endpoints

List Settings

GET /api/settings

Get all settings for the authenticated user.

Authentication: Required

Response:

{
  "data": [
    ["theme", "dark"],
    ["language", "en"],
    ["notifications", "true"]
  ]
}

Get Setting

GET /api/settings/:name

Get a specific setting value.

Example:

const theme = await api.settings.name('theme').get()

Update Setting

PUT /api/settings/:name

Set or update a setting value.

Request:

await api.settings.name('theme').put('dark')

Usage

// Get all settings
const settings = await api.settings.get()

// Get specific setting
const theme = await api.settings.name('theme').get()

// Update setting
await api.settings.name('theme').put('light')
await api.settings.name('fontSize').put(16)
await api.settings.name('notifications').put(true)

Common Settings

  • theme - UI theme preference
  • language - User language
  • fontSize - Text size
  • notifications - Enable/disable notifications
  • darkMode - Dark mode preference