Admin settings

Read and update the typed platform settings key/value store. Paths are relative to the /api/v1 prefix; these are back-office endpoints that require an admin token.

Requires an admin bearer token (see Admin auth). Admin only.

See Common errors.

Endpoints

Method URI Access Description
GET /admin/settings Admin List all platform settings
GET /admin/settings/{key} Admin Read one setting by key
PATCH /admin/settings/{key} Admin Update a setting's value (and optionally its type)

GET /admin/settings

Lists every platform setting.

Response 200

{
  "settings": [
    {
      "key": "broadcast_radius_km",
      "value": 5,
      "type": "integer",
      "description": "Radio de difusión a conductores cercanos"
    }
  ]
}

GET /admin/settings/{key}

Reads a single setting by its key.

Response 200

{
  "setting": {
    "key": "broadcast_radius_km",
    "value": 5,
    "type": "integer",
    "description": "Radio de difusión a conductores cercanos",
    "updated_at": "2026-06-29T10:00:00+00:00"
  }
}

Errors

Status Body When
404 { "error": "SettingNotFound" } Unknown setting key

PATCH /admin/settings/{key}

Updates a setting's value. The value is validated against type (the existing type, unless you send a new one): integer must be numeric, boolean must be boolean-compatible (true/false/1/0), and json must be a valid JSON string or array.

Request body

Field Type Required Rules
value mixed yes must match the resolved type
type string no string, integer, boolean, or json

Response 200

{
  "setting": {
    "key": "broadcast_radius_km",
    "value": 8,
    "type": "integer",
    "description": "Radio de difusión a conductores cercanos",
    "updated_at": "2026-06-29T11:00:00+00:00"
  }
}

Errors

Status Body When
404 { "error": "SettingNotFound" } Unknown setting key
422 { "error": "InvalidValue", "message": "…" } Value doesn't match the resolved type