# MBXHub API > MusicBee REST API - v0.5.5.4 > Requires MusicBee 3.5+ (API rev 57). Supports up to API rev 58 (MusicBee 3.6+ APIs available when present). ## Open MBXHub - [HUD](http://127.0.0.1:8080/pages/hud.html) - [Browse](http://127.0.0.1:8080/pages/browse.html) - [API reference](http://127.0.0.1:8080/docs) - [Changelog](http://127.0.0.1:8080/changelog) These links use this guide's Hub address. When reading an exported copy, use your own Hub's address if it differs. The Hub pages work locally without internet access. ## Downloads - [Download latest stable](https://mbxhub.com/downloads/rc/MBX-bundle-latest.zip) - [Download latest preview](https://mbxhub.com/downloads/preview/MBX-bundle-preview.zip) These links always point to the current release in each channel, independently of this guide's version. ## Endpoints - Base URL: `http://127.0.0.1:8080` - WebSocket: `ws://127.0.0.1:8080/ws` - API Docs: `http://127.0.0.1:8080/docs` ## Diagnostics: start here Read `/llms.txt` from the running instance being investigated, then `GET /system/version` and `GET /status`. A source checkout, another MusicBee installation, or another hub's guide may describe a different build. This guide is embedded in MBXHub and cached in the running process; changing its source file takes effect only after the updated build is installed and loaded. ### Find the logs for this instance These are local files on the computer running each component, not HTTP log-download endpoints. MusicBee's persistent storage directory is the value returned by `Setting_GetPersistentStoragePath()`; do not assume it is the executable directory or Windows `%APPDATA%`. For a portable installation it may be `\AppData`. Match the running MusicBee instance before reading its files. The [AutoQ Decision Journal section of /status](http://127.0.0.1:8080/status#journal) displays the resolved journal file path beside the Hub log, making that directory discoverable from the running hub. | Component | Log location | What to look for | | --- | --- | --- | | MBXHub (Hub/plugin) | `\MBXHub\mbxhub.log`; rotated files `mbxhub.log.1`, `.2`, etc. Hub settings are in `mbxhub.json` in the same directory. | REST requests, queue changes, AutoQ decision headlines, playback, and Hub-to-Shell calls and failures. | | MBXCast (MusicBee companion) | `\mbxcast.log` (directly in persistent storage, outside the `MBXHub` subdirectory). | Companion attachment, native Cast output, volume commands, and receiver-to-MusicBee following. | | MBXHub Shell | Default `%LOCALAPPDATA%\MBXHub\mbxhub-shell.log` for the Windows account running Shell. Read `logFile` in `%LOCALAPPDATA%\MBXHub\mbxhub-shell.json`: an absolute path is used directly; a relative path is anchored to `%LOCALAPPDATA%\MBXHub`; an empty value disables file logging. If LocalApplicationData is unavailable, a relative path falls back beside the Shell executable. | Cast execution, receiver/transport errors, preferred-speaker connection, and the Shell side of Hub requests. | For Cast problems, correlate all three logs around the same time. A panel message is a summary, not a diagnosis: inspect the Hub request result and corresponding Shell error before concluding that an engine or speaker is missing or incompatible. Account for time zones: MBXCast timestamps and journal `tsUtc`/`at` fields are UTC; Hub and Shell log timestamps use local time. ### AutoQ decision journal: why these tracks - `GET /diag/autoq/picks` returns `{success:true,data:{count,picks}}`, newest first, for the last **20 instrumented AutoQ decisions**. It records the entry point and trigger, requested count, driver/source/flow, candidate pool and gate removals, scoring components, center/reach, diversity quotas and drops, journey waypoints and ordering when recorded, tracks sent/queued, and elapsed time. See the detailed endpoint entry under System for field distinctions. - HTTP access requires both `diagnostics.diagEndpointEnabled` and `diagnostics.pickJournalEnabled` in the instance's `mbxhub.json`; a disabled gate returns **404** with an explanatory response. This is separate from general authentication/access controls. Read the response body before treating the route as missing. - The in-memory ring records regardless of those two flags, but is cleared on journal initialization/reconfiguration or process restart and retains only 20 records. `count:0` means no records are retained there; it does **not** prove AutoQ was never involved or describe every UI operation. - With `diagnostics.pickJournalEnabled` on, records are also appended as **JSON Lines** to `\MBXHub\autoq-picks.log`, beside the Hub log. File writing does not require the HTTP diagnostic gate. Rotation uses a 5,000,000-byte threshold and two archives: `autoq-picks.1.log` and `autoq-picks.2.log`. Read those for decisions older than the HTTP ring; a disabled journal or failed write can leave gaps. - Correlate a record's `id` and `tsUtc` with the `[AutoQ.PickJournal] AutoQ pick ` Info headline in `mbxhub.log`. The headline is emitted for each recorded decision independently of the journal-file gate, subject to the Hub's log level. - Interpret the operation before its counts: a generate/preview can produce choices without writing to the queue, so empty `queued` is not by itself a failure. `poolRecorded:false` means no pool draw was recorded, not an empty candidate pool. A missing/empty `sequence` does not establish an empty result. On send records, `sentUrls`/`sentQueued` describe the user's tracks and `queued` describes AutoQ's fill; do not combine them or infer selection order from the top-scoring candidates. ### Action journal: what changed `GET /actions?limit=200` is the separate queue/action/undo journal, newest first. It records observed queue, volume, mute, ban, rating, love, and skip changes, including `origin`, `source`, `description`, `undone`, and UTC `at`. It holds the last **200 entries in memory only**; restart clears it. It does not supply track file lists or explain AutoQ's candidate selection, and normal playback advancing is not an action entry. A source of `unknown` is not proof of which UI command was used. If Undo History is disabled, the endpoint returns 404 while the local journal can still record; see Undo & Actions for that access gate. ### Capture a queue oddity before changing it 1. Read `GET /queue?view=play&limit=0`, `GET /autoq/status`, and `GET /autoq/radio` from the affected hub, preserving the capture time. If `currentIndex` is -1, the play view can be empty while `total` is nonzero; also read `GET /queue?limit=0` for the stored list. 2. Read `GET /diag/autoq/picks` and `GET /actions?limit=200`, then the journal files/archives and Hub log around that time. Check these before asking the operator to reconstruct how the queue was made. Generation, applying an existing preview, and later automatic fills are different operations; correlate their records rather than treating the current queue as one generation result. 3. Compare the original and regenerated captures against their own decision records, settings, and timestamps. An empty journal or a different regenerated queue is insufficient evidence of a selection bug. Capture evidence before reproducing with queue writes, changing settings, or restarting a process; those actions require the operator's authorization. ## Authorization - Optional HTTP Basic password gate (off by default). When enabled, remote requests need `Authorization: Basic ` (username ignored). Missing or invalid returns `401` with `WWW-Authenticate: Basic realm="MBXHub"`. - Optional API keys (off by default), independent of the password: named, revocable, each Read or Read-write with an optional explicit Execute grant for ARiA host automation. Send `X-Api-Key: ` (canonical) or `Authorization: Bearer `. On a keys-only hub a missing or wrong key is `401 UNAUTHORIZED` with NO `WWW-Authenticate` header. See Security -> API Keys. - Exempt from the HTTP password gate: localhost and the live-PartyMode surface (guests use the `X-Party-PIN` header instead). `/ws` is exempt only when its resolved `webSocketAuth` is `clear`; Shared LAN defaults to `restricted`, requiring a configured header credential or a single-use ticket for remote sockets. See the WebSocket section and `GET /system/features`. - A speaker the hub is casting to is admitted for its audio and artwork (`/stream/`, `/library/file/.../artwork`) while the cast lasts, past the password, API keys and the access profile; every other route stays gated, and a banned address is still refused. - Configured only in the plugin (Remote Connection Settings -> Configure Access -> Remote Access); not web/API-configurable. A speed bump for trusted LANs, not transport security: without HTTPS the password is sent base64 (effectively cleartext) on every request. ## Player Control - `POST /player/play` - Start playback - `POST /player/pause` - Pause playback. A Listen Here take-over marks its pause with `X-MBX-Listen-Here: takeover` (+ `X-MBX-Listen-Here-Holder`, `X-MBX-Listen-Here-Generation`): judged against the session before MusicBee moves - malformed `400 INVALID_REQUEST`, moved-on `409 LISTEN_HERE_STALE`, nothing moves either way; an unmarked pause is unchanged (see THE ROOM under Listen Here) - `POST /player/playpause` - Toggle play/pause (alias: `/player/play-pause`) - `POST /player/stop` - Stop playback - `POST /player/next` - Next track. When the playing file's Comment carries a time-coded setlist (SL-TPS v1.0), skips to the next setlist entry's `startMs` instead of the next queue file; from the last entry falls through to `Player_PlayNextTrack`. Response carries `scope: "setlist"` + `entryIndex` on setlist hits. Optional body `{"scope":"file"}` skips the setlist step and moves to the next queue file (answer carries `scope: "file"`); Listen Here sends it when its device finishes MusicBee's track (MusicBee sits paused at the takeover point, so a setlist step would land in the same file). Any other `scope` value: `400 INVALID_REQUEST`, nothing moves. No body keeps setlist navigation. Optional `"expectedSequence"` (the `sequence` from `/nowplaying` or `/queue/current` on the track you are moving MusicBee off): if MusicBee has changed track since, or another advance for that same track was already accepted, `409 NOW_PLAYING_CHANGED` and nothing moves - two Listen Here devices finishing one track, or a retry, never skip a second entry. Optional `"cause":"trackEnded"` (only with `expectedSequence`; any other value, or a cause without the fence: `400 INVALID_REQUEST`, nothing moves): the caller's track ended on its own. The hub marks the track MusicBee moves to (`trackEnded: true` on `/nowplaying` and `/queue/current` until MusicBee moves again for any reason), so a Listen Here listener inside its last 10 s finishes its own track before following; a person's Next is never tagged and listeners follow it at once. The coordinator's automatic advance also carries `X-MBX-Listen-Here: advance` (+ holder, generation): judged before MusicBee moves - malformed `400 INVALID_REQUEST`, a session that moved on `409 LISTEN_HERE_STALE`, nothing moves; unmarked requests are unchanged. - `POST /player/previous` - Previous track. Setlist-aware. Within 2s of an entry's start it seeks to the previous entry's `startMs`; after 2s it restarts the current entry. From the first entry within the 2s grace it falls through to `Player_PlayPreviousTrack`. Setlist lookup is cached for 2s so consecutive presses don't re-parse the Comment. - `GET /player/volume` - Get volume (0-100) - `PUT /player/volume` - Set volume (body: {"volume":50} absolute, or {"delta":-5} relative — resolved server-side, clamped 0-100) - `GET /player/shuffle` - Get shuffle state - `PUT /player/shuffle` - Set shuffle (body: {"shuffle":true/false}) - `GET /player/autodj` - AutoDJ state - `POST /player/autodj/start` - Start AutoDJ - `POST /player/autodj/stop` - Stop AutoDJ - `GET /player/repeat` - Get repeat mode - `PUT /player/repeat` - Set repeat (off/all/one) - `GET /player/status` - Full player state - `GET /player/mute` - Mute state - `PUT /player/mute` - Set mute (body: {"mute":true}) - `GET /player/position` - Playback position in ms - `PUT /player/position` - Seek (body: {"position":ms}) - `POST /player/next-album` - Skip to next album - `POST /player/previous-album` - Skip to previous album - `POST /player/queue-random` - Queue a random track (alias: `/player/queuerandom`) ### Audio Processing - `GET /player/equaliser` - Get equalizer state (also `/player/equalizer`) - `PUT /player/equaliser` - Set equalizer - `GET /player/dsp` - Get DSP enabled state - `PUT /player/dsp` - Set DSP enabled - `GET /player/crossfade` - Get crossfade state - `PUT /player/crossfade` - Set crossfade - `GET /player/replaygain` - Get replay gain mode - `PUT /player/replaygain` - Set replay gain mode - `GET /player/scrobble` - Get scrobble (Last.fm) state - `PUT /player/scrobble` - Set scrobble ### Display Settings - `GET /player/stopaftercurrent` - Get stop-after-current state - `POST /player/stopaftercurrent` - Toggle stop-after-current - `GET /player/show-time-remaining` - Show time remaining preference - `GET /player/show-rating-track` - Show rating on track preference - `GET /player/show-rating-love` - Show love rating preference - `POST /player/show-equaliser` - Open the equalizer window in MusicBee (also `/player/show-equalizer`) - `GET /player/button-enabled?button=N` - Check if a UI button is enabled - `GET /player/output-devices` - List audio output devices - `PUT|POST /player/output-device` - Switch output device (body: {"device":"name"}) ## Device & Mixer Control Every write in this section that moves a level or a mute answers `403` when volume is read-only - `apiReadOnlyMode`, `apiReadOnlyPlayer` or `apiReadOnlyPlayerVolume`, the same three settings that gate `PUT /player/volume`, and during a party the same DJ-only rule. One rule for all three faders, not just MusicBee's: a caller silencing the room through the Windows fader is not, to the person listening, doing something different from silencing it through MusicBee's. It also closes `/mixer/volume`'s fall-back - when no speaker is configured, that route lands on the player instead. Reads are unaffected. ### Windows Audio Device - `GET /devices/audio/outputs` - List all active Windows audio render devices (name, id, isDefault) - `GET /devices/audio/volume` - Windows audio device volume and mute state - `PUT /devices/audio/volume` - Set Windows audio device volume (body: {"volume":50}) - `PUT /devices/audio/mute` - Set Windows audio device mute (body: {"mute":true}) ### Network Endpoints - `GET /devices/endpoints` - List configured network endpoints. `type` is one of `devialet` (Phantom), `streamsdk` / `fosi` (StreamUnlimited StreamSDK, e.g. Fosi Audio S3) or `linkplay` / `wiim` - `POST /devices/endpoints` - Add a network endpoint (body: {"ip":"192.168.1.50","type":"devialet","name":"Living Room"}). `type` chooses the wire dialect — devialet | streamsdk | fosi | linkplay | wiim. Reachability is probed with that dialect before the endpoint is stored, and an unknown type is refused 400 UNKNOWN_TYPE rather than saved as an endpoint nothing can reach - `POST /devices/endpoints/scan` - LAN discovery scan; bodyless (Content-Length: 0); ~4s blocking. `?protocol=mdns|ssdp|all` (default mdns): mdns sweeps speaker service types, ssdp sweeps UPnP MediaRenderer:1 (WiiM/LinkPlay, Sonos, TVs). Returns [{name, ip, port, hostName, serviceType, alreadyConfigured, existingId, protocol}]; ssdp rows add {model, manufacturer, location}. A row whose `manufacturer` is recognized also carries `kind` (devialet | streamsdk | linkplay - the wire dialect that drives it) and `kindSource` (which rule fired, for diagnosis). Derived from the UPnP description the scan already fetched, so identification adds no request and no probe. An unrecognized device OMITS both fields rather than guessing - absent means unknown, and a human still picks the type. Exact manufacturer match only, never fuzzy: a near-miss abstains rather than producing a confident wrong answer - `DELETE /devices/endpoint/{id}` - Remove a saved endpoint - `GET /devices/endpoint/{id}/volume` - Get endpoint volume and mute state - `PUT /devices/endpoint/{id}/volume` - Set endpoint volume (body: {"volume":50}). A speaker that does not answer is refused `502 ENDPOINT_UNREACHABLE` rather than reported as set - this route acts on the named endpoint directly and does NOT soft-fall-back to the player the way a `/mixer/volume` read does - `PUT /devices/endpoint/{id}/mute` - Set endpoint mute (body: {"mute":true}) - `GET /devices/endpoint/{id}/sources` - List endpoint input sources - `PUT /devices/endpoint/{id}/source` - Select endpoint input source (body: {"sourceId":"upnp"}) ### Mixer Settings - `GET /mixer/settings` - Get mixer settings. `defaultFader`, `pollIntervalMs`, `defaultEndpointId` (what is stored) and `defaultEndpointResolved` ({id,name,type,ip} or null — the endpoint the endpoint fader would actually act on right now, fallback already applied) - `PUT /mixer/settings` - Set mixer settings (body: {"defaultFader":"device"}). `defaultEndpointId` names which configured endpoint the `endpoint` fader acts on; empty string = first in the list. An id matching no endpoint is refused 400 UNKNOWN_ENDPOINT - `GET /mixer/volume` - Get volume from default fader (player, device, or endpoint). Endpoint mode resolves `mixer.defaultEndpointId`, falling back to the first configured entry in `endpoints[]`; soft-falls-back to player if none configured or the speaker is unreachable. In endpoint mode `endpointActive` says whether the speaker answered (`false`: it did not, and the level is the player's) - `PUT /mixer/volume` - Set volume on default fader. Absolute (body: {"volume":50}) or relative (body: {"delta":-5}), the delta resolved server-side against the active fader's current level — same contract as `/player/volume`, so a first press works before any read has landed and two quick presses cannot race a stale read. Response surfaces the actual `fader` that was hit. In endpoint mode no write moves another fader: when the speaker does not answer (the write, the read a `delta` resolves against, or a call that fails) nothing changes and the answer is `success:false`, `endpointActive:false`; a speaker that answers but does not take the write is `success:false`, `endpointActive:true`; one that takes it is `success:true`, `endpointActive:true`. Only when no endpoint is configured does it fall back to the player (`fader:"player"`) - `GET /mixer/mute` - Mute state of the default fader, resolved exactly as `/mixer/volume` is, so volume and mute always land on the same device. `fader` is the one actually hit - `PUT /mixer/mute` - Set mute on the default fader (body: {"mute":true}), or {"toggle":true} to invert whatever the current fader reports without a read-then-write round trip ### Streaming - `POST /player/update-play-statistics` - Apply a caller-chosen count type to a track (body: {"url","countType"?,"disableScrobble"?}; countType: IncreasePlayCount / IncreaseSkipCount / NoChange). Prefer `/player/report-play`, which judges played vs skipped server-side. 403 FEATURE_DISABLED when `apiDisablePlayCountUpdates` is on; gated by player access during party mode; shares the per-IP play-stat rate limit with `/player/report-play` - `POST /player/report-play` - Report a Listen Here (browser streaming) playback exit (body: {"url","positionMs","durationMs","cueStartMs"?,"cue"?,"abandoned"?,"disableScrobble"?}). `cue: true` marks a CUE-backed source - required for a sheet's FIRST sub-track, whose cueStartMs is 0. Server applies MusicBee's own play-count trigger settings (percent/seconds, read live) and increments play or skip count via the MusicBee API; position 0 records nothing. `countType` is IncreasePlayCount / IncreaseSkipCount / NoChange, or `native-owned` (acknowledged, nothing marked: `counted: false`, `result: false`) only while all three hold: hub setting `cast.dedicatedAccounting` is exactly `native` (default `cast`; any other value reads as `cast`), the current cast is MusicBee-owned (casting enabled, no queue-configuration change pending; Shared contributions may be enabled), and MusicBee's active output is MBXCast. It replaces marks only: a report that would record nothing still answers NoChange, refusals keep their answers, and an unreadable output marks as before. A `native-owned` answer holds the duplicate window like a counted play. Under the default nothing changes: the MBXHub Shell's per-item Cast reports mark as they always have. Optional `"castSessionId"` (sent by the Shell's Cast reports; same id rule as `clientId`) names the report's cast session: while MusicBee follows that session (Follow Cast, see Cast), and for its final report after the followed session ended, the answer is `linked-cast` (acknowledged, nothing marked: `counted: false`, `result: false`) because MusicBee counts that listen itself. Like `native-owned` it replaces marks only and holds the duplicate window; a verified Listen Here device, an unfollowed session and a session after Unlink count as before. `abandoned: true` marks a non-deliberate exit (tab close, output toggle, external track change): past threshold it still counts a play, below it nothing is recorded — never a fabricated skip. Counted plays also feed the AutoQ session signal and (when TrueShuffle is enabled) the shuffle played-set + AutoReset completion check — neither feature is required for counting. Duplicate reports from the same client for the same track (keyed url+cueStartMs, so CUE sub-tracks of one file never collide) inside an adaptive window are ignored (`deduped: true`). When `durationMs` is omitted or 0 the server derives it from the CUE sheet for sub-tracks (next track start − this start; the sheet's last track has no derivable end, so only the seconds rule can count it as a play and no skip is ever fabricated) or the library duration for whole files. Play-stat endpoints share a per-IP rate limit (`rateLimitPlayStatsPerMinute`, 429 when exceeded; loopback exempt). 404 if file not in library or `apiDisablePlayReporting`/`apiDisablePlayCountUpdates` is on Optional `"listener":true` from a device listening beside another: the play still counts (every listening device reports its own) but does not drive AutoQ/shuffle progression - the coordinating device's report does that once. Optional `"clientId"` (the device's Listen Here holder id), `"deviceToken"` (the ownershipToken it holds as coordinator, or the listenerToken it holds as a listener) and `"episodeId"` (fresh per loaded track); each `[A-Za-z0-9_-]{1,64}`, anything else treated as absent, never refused. When id + token match a device the hub holds right now the report is VERIFIED: its duplicate window keys on the episode (two tabs behind one IP each count; a retry of one episode counts once) and the `native-owned` gate does not apply (an independent listener's play counts beside a Dedicated native cast). The id alone proves nothing - it is public on `GET /listen-here/holder`; unverified reports (wrong/stale token, no token, no ids, every Shell cast report) keep the address window and the owner gate exactly as before. Every Listen Here surface (play, player, HUD, dashboard, mixer) reports through one shared reporter. THE VERIFIED ROLE DECIDES PROGRESSION (CQ3): the token proves `coordinator`, `listener` or `private` (a device playing its own queue, token from `POST /listen-here/private`), and the answer names it as `role` (null when unverified). A verified `listener` or `private` play counts and never drives AutoQ/shuffle progression whatever the body flags say; a verified `coordinator` drives it even with `"listener":true`; a token the hub RETIRED (the device left Private, or departed a shared session into Private) still verifies the device's final report for the report-retirement window - at least the page's 61 s 429 retry - and counts, but never drives (the live coordinator does). Unverified reports keep the hints: `"listener":true`, and `"private":true` (new, the same effect: counts, drives nothing); both are echoed. The role is resolved once and carried; it is never a request flag's to claim. ## Now Playing - `GET /nowplaying` - Current track metadata. Also `sequence`: changes every time MusicBee changes track (tagged with this hub run); compare it, never parse it - it is what `POST /player/next`'s `expectedSequence` takes. And `trackEnded`: true while MusicBee is on the track a `POST /player/next {"cause":"trackEnded"}` produced (a Listen Here coordinator's track ended on its own), false again the moment MusicBee moves for any other reason - `GET /nowplaying/artwork` - Album art (binary image) - `GET /nowplaying/lyrics` - Track lyrics. Response: `{ hasLyrics, lyrics, source?, label?, comment? }`. `source` is `"lyrics"` (MusicBee field) or `"comment"` (fallback to the track Comment tag when no real lyrics exist). When `source: "lyrics"` and the track also has a non-empty Comment tag, an additional `comment` field is included so clients can offer a Lyrics/Comment toggle. When `source: "comment"`, `label` is the chip text shown above the body (default "from comment"). Both the sibling `comment` field and the fallback path are truncated to `LyricsFallback.MaxDisplayChars` (default 4000). Configurable via `LyricsFallback.{Enabled, MaxDisplayChars, Label}`; hard-killable via `ApiDisableLyricsFallback` (also suppresses the `comment` field). - `GET /nowplaying/position` - Playback position in ms - `GET /nowplaying/property?type=X` - File property (Size, Bitrate, DateAdded, etc.) - `GET /nowplaying/tag?field=X` - File tag (Artist, Album, Genre, Rating, etc.) - `GET /nowplaying/artwork-url` - Artwork as data URL (base64) - `GET /nowplaying/downloaded-artwork` - Downloaded artwork (binary) - `GET /nowplaying/downloaded-artwork-url` - Downloaded artwork as data URL - `GET /nowplaying/downloaded-lyrics` - Downloaded lyrics from provider - `GET /nowplaying/artist-picture` - Artist picture (binary, ?fadingPercent=0) - `GET /nowplaying/artist-thumbnail` - Artist thumbnail (smaller) - `GET /nowplaying/artist-picture-urls` - Artist picture URLs (?localOnly=false). Response includes a `pictures` array with `src` URLs (serveable via `/nowplaying/artist-pictures/{index}`) in addition to raw file paths. - `GET /nowplaying/artist-pictures/{index}` - Serve current artist's Nth picture as binary image (0-based). Query: ?localOnly=true. A remote (http/https) picture over 16 MiB answers `502 ARTWORK_TOO_LARGE`. - `GET /nowplaying/is-soundtrack` - Whether current track is a soundtrack - `GET /nowplaying/soundtrack-pictures` - Soundtrack picture URLs - `GET /nowplaying/spectrum` - Real-time spectrum data (frequency analysis) - `GET /nowplaying/sound-graph` - Waveform graph data - `GET /nowplaying/sound-graph-ex` - Extended waveform graph data - `GET /nowplaying/peak` - Current stereo peak and RMS levels (0.0-1.0). Returns {peak: [L, R], rms: [L, R]}. Requires MusicBee 3.6+ (API rev 58+) ## Queue - `GET /queue` - List queue (?offset=0&limit=50; `limit=0` = every row from the offset). To read Up Next, start AT the cursor: `GET /queue/current`, then `?offset=&limit=0`. A default page stops at row 50 while `upcomingTotal` counts the whole list, so past that point the count and the rows describe different things. Each track has an optional `provenance:{driver,reason,whenUtc}` (driver: AutoQ|TrueShuffle|Journey|Station|Manual) stamping who filled it and why; omitted when unknown (older fills / manual MB adds). Each track also has `upcoming` (bool) and the response carries `upcomingTotal` (int) - see "Two views of one list" below - `GET /queue?view=play` - The rows in MusicBee's PLAY ORDER, opt-in. Only the exact value `play` selects it: no `view`, an empty one or any other value (`Play` included) is the list view above, byte for byte, and never carries `view` or `viewTotal`. The sequence is the current row, then each `playOrder` index once - indices are de-duplicated, never paths, so a file queued twice is two rows; `currentIndex` below 0 is an empty sequence. `offset`/`limit` page POSITIONS in that sequence by the list's rules (default 50, `limit=0` = every row from the offset, at most 10000 rows per page - the same cap; an offset past the end is an empty page). `from=` instead of `offset` starts the page at that MusicBee row's place in the sequence, that row first; `from` with `offset` is `400 INVALID_REQUEST`. The answer adds `view: "play"` and `viewTotal` (the sequence's length before paging); `total` stays the list's length, `offset` is the position the page starts at, and `currentIndex`, `playOrder`, `upcomingTotal` and each row's `upcoming` keep their meanings. Every row keeps its ORIGINAL list `index` (what `/queue/play`, `/queue/move` and `DELETE /queue/{index}` take) and, in this view only, carries `kind` (MusicBee's codec name, e.g. `ALAC audio file`; `""` when unknown). CUE rows keep their own `cueTrack` and `cueStartMs` in any order. `409 QUEUE_CHANGED` when a native read is incomplete, its version/current track changes during capture or metadata collection, an index is outside the captured list, or `from` is not in the sequence: read it again - the answer is never shortened to hide it. `409 QUEUE_CURRENT_MISMATCH` when MusicBee is playing a different file than its list's current row (not while stopped): reading again does not clear it; it clears when MusicBee changes track. The MBXHub Shell's cast reads MusicBee's queue this way, so a Shell of this version needs a hub that has this view - `GET /queue?view=play&identity=complete&limit=80` adds `data.identity` with `schemaVersion: 1`, `complete: true`, an opaque `observation`, nullable `queueVersion`, and `rows` containing every physical row's `rawUrl` and nullable `rawTrackNo`. Array position is the native index; duplicate paths remain distinct rows. The manifest is uncapped; only selected track metadata is paged. Start at offset zero. A later `from` or nonzero `offset` requires `expectedObservation`; it is also allowed at zero. Invalid combinations return `400 INVALID_REQUEST`; changed context returns `409 QUEUE_CHANGED`. Never combine pages from different observations. The token is equality context, not authorization or durable occurrence identity. Selected tracks echo both raw fields and explicitly include `cueTrack` and `cueStartMs` (both zero for ordinary files). CUE identity must resolve from exact source membership and native track number; ambiguity or invalid CUE metadata returns `409 CUE_IDENTITY_UNRESOLVED`. The resolved `url` may differ from `rawUrl`. Native descriptors, current row and play order are rechecked after metadata hydration. Without this opt-in, existing response fields are unchanged. - Each HYDRATED row of the complete-identity view also carries `cueFrame` (`"song"` on a MusicBee virtual track, `"file"` on a whole-file row or a file without a sheet of several songs, absent when the hub cannot decide - a length it could not read; never guessed) and, on a `file`-frame CUE row, `fileDurationMs` (the row's own length) beside an UNCHANGED `duration` (the sheet slice, which the Cast reads). Decided per request from that request's own sheets and the row's length, never through the now-playing resolver. THE COPIER'S RECIPE (a page copying MusicBee's program - CQ3 Private break-away): the FIRST request is `GET /queue?view=play&identity=complete&limit=0` with NO `from` and offset 0 (`from` or a nonzero offset without `expectedObservation` is `400`); its answer carries `identity.observation`, `currentIndex`, `currentPositionMs`, `playOrder`, `viewTotal` and up to 10,000 hydrated rows; while hydrated rows < `viewTotal`, page with `offset=&limit=0&expectedObservation=` - a change under you is `409 QUEUE_CHANGED`: read once more from the bootstrap, and give up on a second change. Completeness is COUNTED by the caller (`identity.complete` is descriptor completeness, always true); the occurrence is the captured `currentIndex` row, and its frame is that row's `cueFrame` - `/nowplaying` is not read for it. A whole-file row starts at the file and ends at `fileDurationMs`; a virtual track at `cueStartMs` and its song boundary ### Two views of one list (what `upcoming` is for) MusicBee keeps ONE now-playing list and shows two views of it: - **Playing Tracks** - every row, in list order, history included - **Up Next** - only what will still play, in MusicBee's play order `GET /queue` returns the LIST (the first view). Removing a track from Up Next does NOT delete its row: MusicBee drops the row out of its play order and leaves it in the list, and does not mark it played either - so neither list membership nor played-state identifies such a row. Only play order does. - `upcoming: true` = MusicBee's own play order still includes this row. Render Up Next by keeping these. - `upcomingTotal` = how many such rows exist across the WHOLE list. Do NOT derive this as `total - currentIndex - 1` (that counts rows removed from Up Next) and do not count a filtered page (it is one page). - `playOrder` = the list indices MusicBee will play, IN THE ORDER it will play them - shuffle and Up Next order included. `upcoming` says whether a row plays; `playOrder` says when. It always covers the WHOLE queue, whatever `limit` pages, because order cannot be read off one page; a paged caller that only needs membership can ignore it. It is the same walk as `upcoming`, so the two never disagree, and a row whose file cannot be read still counts - it is still queued. A Listen Here device does not copy it: it follows MusicBee's live queue track by track (Mirror), so a track added after Listen Here started still plays there. The HUD queue pane lists the device's own sent tracks first, then MusicBee's upcoming rows in this order. - Addressing stays by list index. `index` on each row is what `/queue/move`, `/queue/play` and `DELETE /queue/{index}` take. Filtering makes rendered rows non-contiguous, so read each row's own `index` - never derive one from its position in a filtered list. - Under repeat-all, rows BEFORE the current index are `upcoming: true` - they genuinely play again. Under repeat-one, MusicBee's oracle reports the ordinary forward order, so `upcoming` describes what would play with repeat-one off. - A hub that predates this field omits it; treat a missing `upcoming` as true so the list degrades to the older behavior rather than to an empty panel. - `GET /queue/current` - Current track index, plus `sequence` and `trackEnded` (as on `/nowplaying`) - `POST /queue/add` - Add tracks (body: {"url":"path","position":"next|last"} or batch: {"urls":["path1","path2"],"position":"last"}). Every url has to be a library entry: a file MusicBee does not hold is `404 NOT_FOUND` (`File not in library: `) before anything is queued, and a batch holding one is refused whole. The same boundary applies to `/queue/playnow` and `/queue/play-list` - `POST /queue/playnow` - Play track immediately (body: {"url":"path","cueTrack":3}); a url not in the library is `404 NOT_FOUND` - `POST /queue/play-list` - Play a whole list in one call, in order, atomically (body: {"urls":["path1","path2"],"position":"replace|next|last"}, default replace). A url not in the library is `404 NOT_FOUND` with nothing queued. `replace` starts the first track now and queues the rest behind it in one array call; `next` and `last` do not disturb playback. Response: {"result":true,"queued":N,"position":"replace"}. A refused first track is `500 PLAYBACK_REJECTED` with nothing queued. Host only: during a party a guest gets 403 for every position, and `requestId` is ignored, not honored. `cueTrack` is not supported here - `POST /library/albums/{album}/play` - Play an album by name, one call (body: {"albumArtist":"...","position":"replace|next|last"}; path segment percent-encoded). Resolves the tracks the way `/library/files?album=` does - exact name, `albumArtist` picks one of two albums sharing a name, without it every album of that name - orders them disc then track, and hands them to the same path as `/queue/play-list`, so the same response, the same host-only gate and the same refusals. A name nothing matches is `404 NOT_FOUND` and nothing changes - `POST /library/genres/{genre}/play` - Play every track of a genre, one call (body: {"position":"replace|next|last"}). Same path, same gate; ordered by the library's default sort, the order `/library/files?genre=` answers in - `POST /queue/clear` - Clear queue - `POST /queue/move` - Reorder (body: {"from":0,"to":5}) - `DELETE /queue/{index}` - Remove track by index - `POST /queue/play` - Play track at index (body: {"index":3,"cueTrack":1}) - `GET /queue/next-index?offset=1` - Get index N tracks ahead/behind - `GET /queue/has-prior` - Whether queue has prior tracks - `GET /queue/has-following` - Whether queue has following tracks - `POST /queue/play-library-shuffled` - Clear queue and play library shuffled - `GET /queue/{index}/url` - Get file URL for track at index - `GET /queue/{index}/tag?field=X` - Get tag for track at index - `GET /queue/{index}/property?type=X` - Get property for track at index ### Virtual Tracks (CUE) Virtual Tracks share the same audio file URL. The queue response includes Virtual Track metadata: - `cueTrack` - Track number when detected - `cueStartMs` - Start offset in milliseconds within the physical file - Track titles from CUE sheet (not embedded audio metadata) - Include `cueTrack` in add/playnow to preserve track identity. `/queue/playnow` seeks straight to the track. `/queue/add` (single `url` only; a batch `urls` add ignores `cueTrack`) holds the track's start until that row comes up, then starts playback there; both return it as `seekPosition` (ms). `/queue/play-list` takes no `cueTrack` at all: it is meaningless for a list, and a numeric `#N` fragment on a url is stripped to the file exactly as a batch add strips it - `GET /nowplaying` also returns `cueTrack` + `cueStartMs` for the current track; browser-mode clients seek the container to `cueStartMs` and pass it through to `/player/report-play`. It also returns `cueFrame` - `"song"` when the playing row is one song of a sheet (a MusicBee virtual track: `position` counts from the SONG's start) or `"file"` when it is a whole-file row (album play from the web, Play Now of a song, or MusicBee's own whole-file listing: `position` counts from the FILE's start). A file with no sheet of several songs is `"file"` too - it is one row, and that is decided, not unknown (a concert file whose setlist lives in its Comment with no .cue beside it is the ordinary case). ABSENT only when the hub cannot decide: a sheet of several songs whose row or file length read 0, typically the first instant of playback - read absence as "cannot be decided", never as a frame. `GET /nowplaying/position` and the WebSocket `TrackChanged` event carry the same field with the same meaning, so the frame always travels with the start it is read beside. Why it exists: `cueStartMs` comes from the file's TrackNo tag, and a whole-file row reports the FILE's tags - so on a file tagged with a number its sheet contains, `cueStartMs` is a song's start beside a file-relative position (4 of the 11 CUE-backed files in the reference library). A consumer placing the heard song adds `cueStartMs` to `position` only when `cueFrame` is `"song"`, uses `position` alone when it is `"file"`, and shows nothing when it is absent. A consumer SEEKING (Listen Here's take-over resumes the stream where MusicBee is; its hand-back seeks MusicBee to where the stream is) reads the frame the same way, and when it is absent asks `/nowplaying` once more about a second later before falling back to the song-frame arithmetic. ### CUE Track Resolution MBXHub detects CUE-backed audio files and resolves per-track metadata automatically across all surfaces: - `GET /player/status` - Returns CUE track title, artist, trackNo, cueTrack field - `GET /nowplaying/position` - Includes `cueTrack` and `cueTitle` when active - Which track: MusicBee's own TrackNo names the CUE track - right when the library holds the album as one row per sub-track (position and duration are then the sub-track's). On a WHOLE-FILE row (the hub's album play or Play Now of a song, or MusicBee listing the file as one row), MusicBee's tags are the file's whatever the position, so `cueTrack` and `cueStartMs` name the file's own TrackNo throughout the file and the position is file-relative; those two fields keep that meaning on purpose (identity, resume and play reports rely on it). The row kind is reported beside them as `cueFrame` (above), and the dashboard's now-playing sub-line and the play page's song line use it to name the song being heard inside the file, from the sheet's offsets. `/nowplaying`'s `title` stays MusicBee's - `GET /nowplaying/tag?field=TrackTitle` - Returns CUE track title (not base file) - WebSocket `TrackChanged` events include `cueTrack` and `cueStartMs` fields when CUE active, and `cueFrame` (`"song"` | `"file"`) when the hub can decide it - at a track change MusicBee's row length can still read 0, so the event is where the frame is most often absent; consumers then read `/nowplaying` once the track is about a second old - Dashboard shows resolved CUE track metadata - Listen Here streaming: seeks to `cueStartMs`, shows track-relative progress, auto-advances at track end CUE parsing uses a built-in regex parser with encoding detection (BOM, UTF-8 validation, Windows-1252 fallback). No external CUE library is loaded or required. ## Undo & Actions MBXHub settings -> API Access -> Disable Features -> **Undo History** sets `apiDisableUndoHistory` (default false). When true, GET/POST `/undo` and GET `/actions` return 404 `NOT_FOUND` for all API clients, including localhost, and the web Undo offer disappears. The local journal keeps recording and Workbench Ctrl+Z continues through direct Core calls; neither depends on these endpoints. GET `/system/features` reports `undoHistory` as false. The hub journals every change it observes to the queue, volume, mute, bans, ratings, love and skips. Undo is ONE step back: it reverses the newest USER action not already undone. Changes the user did not ask for are never offered: AutoQ top-ups/fills, automatic skips and an undo's own writes are recorded as `automatic`; playback advancing to the next track is not recorded at all. After an undo nothing is offered until a new user action lands. The journal holds the last 200 entries in memory only - a restart clears it. Two doors reach the same record: Ctrl+K on the web pages ("Undo: " as the first row) and Ctrl+Z in the AutoQ Workbench. The dashboard ban gesture (ban, then Previous within 10 s) is unchanged. - Queue Undo captures the complete upcoming queue with no arbitrary track-count cutoff. One immediate mistake-reversal offer: playback advancement, another queue operation (including AutoQ), or a shuffle or repeat toggle expires it; a new settled user edit replaces it. Native track transitions, trusted Cast occurrence changes and accepted Listen Here observation changes invalidate it; position ticks do not. No replay of played tracks or merging through later edits. Incomplete or concurrently changed reads are refused before restore writes. The 200-entry history limit is separate from the number of tracks one operation may affect. - `GET /undo` - What Undo would reverse. `{"available":false}`, or `{"available":true,"id":42,"kind":"volume","description":"volume 40 -> 12"}` (the hub's description uses an arrow character). kind: queue|volume|mute|ban|rating|love|skip. Needs no write permission and changes nothing; 404 when Undo History API access is disabled - `POST /undo` - Reverse it. Optional body `{"expectedId":42}` (the id GET /undo answered) - only that entry may be reversed. 200 `{message,kind}`; 409 `NOTHING_TO_UNDO`; 409 `UNDO_CHANGED` (a different entry is on offer - nothing touched; "Something else happened first — open Undo again"); 403 when the kind's own gate refuses (queue: all three Add, Remove and Reorder permissions because restoration rebuilds the upcoming queue; volume/mute: player volume; skip: player playback; ban: shuffle, as POST /banlist; rating/love: the library tag-edit switch); 404 `NOT_FOUND` when Undo History API access, love or ratings are disabled; 400 `INVALID_REQUEST` for a body that is not JSON or a non-whole-number expectedId; 500 `UNDO_FAILED` (MusicBee refused; retry is available only while the offer remains valid - a queue undo refused after it removed the upcoming rows puts those rows back and is not offered again); 503 `NOT_READY` while starting - `GET /actions` - The journal, newest first, automatic and undone entries included (?limit=1..200, default 50, else 400 `INVALID_LIMIT`; ?address= filters to one client). Fields: `id, kind, origin (user|automatic), source (unknown|webApp|workbench|api|musicBee|autoQ|undo), clientAddress, clientName, description, undone, at` (UTC). `clientAddress`/`clientName` are ABSENT when the client is unknown (MusicBee's own window, or no observed name) - never invented. Descriptions only, no file URLs or paths. 404 `NOT_FOUND` when Undo History API access is disabled; 503 `NOT_READY` while starting ## Library - `GET /library/files` - Query files (?query=&artist=&albumArtist=&album=&genre=&people=&offset=&limit=&sort=). `?people=X` on an album-scoped query (`&album=Y`) now post-filters across MB's full role-union — `Artists` (144 — Artist + Performer + Guest + Remixer), `Composer` (43), and `Conductor` (45). This catches feat./guest credits that MB's `ArtistPeople` XmlFilter omits from the Guest role bucket (e.g. David Guetta - "The Whisperer (feat. Sia)" where Sia is tagged GuestArtist). Whole-library `?people=` without `?album=` still uses `ArtistPeople` for speed and continues to miss pure-guest credits. Additional params: `?include=` attaches per-track value of a tag for display (e.g. the active sort field when expanding an album under a custom-* sort) — accepts any tag from the 48-tag customSorts allowlist (`Custom1`..`Custom16`, `Virtual1`..`Virtual25`, `Year`, `OriginalYear`, `Sort*`); unknown values silently ignored. Each returned row gets `extraField` + `extraValue` when set. `?roles=true` adds every per-track role-credit field MB tracks separately — `artistsRole`, `performers`, `guests`, `remixers`, `composers`, `conductors`, `artistsUnion` — populated raw from `Library_GetFileTag`. Default off; only paid for when requested. `?setlist=hint` emits a `hasSetlist:bool` per row — true when that track's Comment tag matches the time-coded setlist heuristic (≥3 monotonically increasing entries; see `/library/file/{urlHash}/setlist` for the full accepted-formats grammar, SL-TPS v1.0). Drives the SET LIST badge on the dashboard and the Tracklist tab on `nowplaying.html`. Opt-in to pay the per-row Comment + regex cost; default off. `?sort=year` (and the year/date track sorts on album expansion) extract the 4-digit year from malformed Year tags before sorting — full dates like `20180727`, `2024-01-01`, `5/27/2014`, `1999/2000` sort by their year component instead of as integers ten million high. Sort key only; stored tags and displayed values untouched. Toggle off with the **Disable malformed-Year sort normalization** Advanced setting. The `url` field is the track's identifier: the file path as MusicBee holds it on the host (a Windows path, not a `file://` URI), resolved on the host and never opened by the client. Pass it back verbatim wherever a track is named, percent-encoded in a path segment. `total` counts tracks after CUE expansion and is the same for every page size, `?limit=1` included. - `GET /library/artists` - List artists (?offset=&limit=&sort=). One row per DISTINCT TAG VALUE, so a track tagged `A; B` is its own row. With the Browse setting `splitArtists` on, the artist list reads MusicBee's role union (`artists`, separators normalized by MusicBee's Multiple Artist Splitter) and both this list and `/library/genres` split on `;` - one row per person or genre, counts summed, no row carrying a `;`. The hub splits on nothing else: a name the Multiple Artist Splitter left whole stays one name. The `?artist=` drilldown resolves through `ArtistPeople` either way. On by default. Lists only: the `/search` artists bucket (and with it Cmd+K and browse.html's search Artists section) is always one row per person whatever this switch says - a search names a term (see `GET /search`). - `GET /library/albums` - List albums (?artist=&offset=&limit=&sort=) - `GET /library/albums/detailed` - Albums with firstTrackUrl, year, dateAdded and dateAddedSort for artwork lookups and sorting (?offset=&limit=) — eliminates per-album /library/files round-trips. Each album row includes `virtualKind` (`"cue"` | `"setlist"` | `null`) indicating whether the album is a CUE-split or setlist virtual tracklist. EVERY album row here (detailed, unheard, with-pdf, with-video, and the /library/slices previews) carries `dateAddedSort` beside `dateAdded`: the same moment as `yyyy-MM-ddTHH:mm:ss`, or `""` when the hub could not read it. `dateAdded` is MusicBee LOCALE text and `Date.parse` of a non-ISO string is implementation defined, so on a day-first hub a client ordered rows differently per browser. Sort on `dateAddedSort`; parse `dateAdded` only as a fallback for an older hub that omits it. - `GET /library/albums/by-artist` - Albums for an artist (?albumArtist= or ?artist=, &sort=alpha|year|year-asc). ?artist= queries ArtistPeople (track credits; an album appears when at least one track credits the artist), ?albumArtist= matches the album artist (exact, or one of its `;` parts when `browse.splitArtists` is on). Either way `count` is the album's track count. Each album row includes `virtualKind` (`"cue"` | `"setlist"` | `null`). - `GET /library/albums/unheard` - Albums where all tracks have playCount=0 (?offset=&limit=) - `GET /library/albums/with-pdf` - Albums that contain PDF booklets (?offset=&limit=) - `GET /library/albums/with-video` - Albums whose folder contains a video file (derived from the Video library, Source Type 64, matched by folder) (?offset=&limit=) - `GET /library/genres` - List genres (?sort=). One row per distinct Genre tag value; splits on `;` when the Browse setting `splitArtists` is on (same switch as `/library/artists`). - `GET /library/album-artists` - List album artists. One row per distinct Album Artist tag value; splits on `;` when `splitArtists` is on (same switch as `/library/artists`), counts summed. With the switch on, `/library/albums/by-artist?albumArtist=X` also returns albums whose album artist lists X as one of its `;` parts; off, it is an exact match. - `GET /library/slices?by=genre|year|decade|rating|mood` - One row per value of a field, largest first — the view behind `/pages/slices.html`. `?by=` is required; anything else is `400 BAD_FIELD`. `&top=` how many values get a preview row (default `slices.topN`, clamped 1..200), `&preview=` covers per row (default `slices.rowLength`, clamped 0..200; `0` = every album in the value). Both come back CLAMPED, not as sent. Response `data`: `by`, `total` (distinct values = `values.length + more.length`), `top`, `preview`, `values:[{value, albums, preview:[album row]}]`, `more:[{value, albums}]` — the tail past `top`, as name+count, for the page's "More…" list. Each `preview` entry is exactly a `/library/albums/detailed` row (`name`, `count`, `firstTrackUrl`, `year`, `dateAdded`, `dateAddedSort`, `albumArtist`, `sortAlbumArtist`, `virtualKind`). Attribution: `genre` puts an album in a row for EVERY genre tagged on it and an album with no genre in NO row (genre has no missing bucket); `year` is the first four digits of the Year tag, else `"Unknown"`; `decade` is that year floored to ten and suffixed (`"1990s"`), else `"Unknown"`; `rating` is the album-rating tag when set, else the mean of the album's rated tracks rounded half-up, else `"Unrated"`; `mood` is the channel most of the album's analyzed tracks fall in (ties by channel name), else `"No mood data"`. Values sort by album count descending then by name, with the missing bucket always LAST; preview albums are newest-added first then by name. `by=mood` costs one channel lookup per track, so the per-album tally is cached until the album index publishes a new snapshot; a mood source that throws answers `500` rather than reporting the whole library as unanalyzed. - `GET /library/inbox` - Files in MusicBee Inbox (Source Type 4). Progressive: browse tab hidden if empty - `GET /library/audiobooks` - Audiobook files (Source Type 32). Progressive: browse tab hidden if empty - `GET /library/videos` - Video files (Source Type 64). Progressive: browse tab hidden if empty - `GET /library/search?q=term` - Full-text search over title/artist/album/album artist/genre (a track on an album whose album artist matches is found even when its own artist does not). Two modes: **strict** (default) requires the typed phrase to appear as a contiguous run of whole words in a single field — "st anger" matches the album "St. Anger" (including mid-typing partials like "st an") but NOT "Stranger" or "Strange Anger"; **substring** is loose — any query word appearing as a substring passes ("anger" matches "Stranger"). Default mode from `Library.DisableStrictSearch` setting (false=strict, shipped default). Override per-call with `?substring=true|false`. Diacritic and punctuation normalized. Response includes `mode: "strict"|"substring"`. Also supports `?sort=`. Add `?dsl=true` to route the query through `SearchDslParser` (qualifier syntax — `artist:`, `album:`, `genre:`, `year:`, `rating:`, `fmt:`, range / boolean / grouping); cheat sheet at `GET /library/search/syntax`. Backstop: queries shorter than `search.live.minQueryLength` (default 2) return `400 QUERY_TOO_SHORT` with `{error: "Query must be at least N characters (got M)."}` — single-char walks stall every other MB-API consumer for the duration of the cursor lock, so this protects fleet-wide responsiveness from runaway non-conforming clients (curl, scripts). - `GET /library/search/syntax` - Returns the DSL grammar as JSON (qualifiers, operators, worked examples). Response shape: `{version, qualifiers:[{name, type, allowsRange, allowsOperators, filterable, mapping, enumValues}], operators:[{symbol, description}], examples:[{query, description}]}`. `filterable` (bool) marks the qualifiers the AutoQ candidate filter can evaluate — a filter-scoped client derives its allow-list from this flag rather than hardcoding one. Authoritative source — the reference below is derived from the same data. Used by Cmd+K's cheatsheet and any other client surfacing DSL syntax to users. #### Query DSL Reference The DSL layers on top of free-text: every plain word still matches normally, qualifiers narrow the result, operators compose. Auto-detected on `/library/search` and `/search` when `library.search.dsl.enabled = true` (default); force per-call with `?dsl=true`. **Qualifiers** (22 total): | Qualifier | Type | Range/Ops | Maps to | Notes | |---|---|---|---|---| | `artist:` | string | — | ArtistPeople | Includes featured / album artists | | `album:` | string | — | Album | | | `albumartist:` | string | — | AlbumArtist | Compilation-aware | | `genre:` | string | — | Genre | Multi-value tags split client-side | | `year:` | int | range + ops | Year | `year:1985`, `year:1985..1990`, `year:>=2000` | | `decade:` | enum | — | derived from Year | Values: `60s`, `70s`, `80s`, `90s`, `00s`, `10s`, `20s` | | `rating:` | int | range + ops | Rating (0–5) | `rating:>=4`, `rating:3..5`. Also takes the literal `none` — `rating:none` is every unrated track (no stars), and `-rating:none` is every track that has any rating | | `loved:` | bool | — | Love ("L") | `loved:true` / `loved:false`. Runs in the MusicBee query itself, so it composes inside an `OR` — `loved:true OR rating:>=4` is one query, not two halves | | `bpm:` | int | range + ops | Tempo (Truedat/Essentia) | Requires fingerprint or mood-cache data | | `mood:` | string | — | AutoQ mood channel | **Post-filter** — exact, case-insensitive match on the track's best mood channel from the mood cache (`mood:chill`). Scanned tracks only; a cold mood cache matches nothing rather than everything. Combine channels with `OR` | | `vibe:` | float | range + ops | AutoQ vibe score | 0–1. `vibe:>=0.7` | | `arousal:` | float | range + ops | AutoQ arousal (energy axis) | 0–1. `arousal:>0.7`, `arousal:0.7..1.0`. SMFM contributes the same axis as a 2nd source. **Post-filter** | | `valence:` | float | range + ops | AutoQ valence (bright/dark axis) | 0–1. `valence:<0.4`. **Post-filter** | | `source:` | enum | — | MB Source Type | Values: `library`, `inbox`, `audiobooks`, `videos`, `podcasts`. Default from `library.search.dsl.defaultSource` | | `playlist:` | string | — | playlist filter | **Post-process** — intersects with named playlist membership | | `added:` | date | range + ops | DateAdded | ISO (`2025-01-01`), relative (`now-7d`), or named alias | | `played:` | date | range + ops | DateLastPlayed | Same date format as `added:` | | `playcount:` | int | range + ops | PlayCount | `playcount:>10`, `playcount:0` (never played) | | `duration:` | int (seconds) | range + ops | Duration | `duration:>3600` (over an hour) | | `path:` | string | — | FilePath substring | Case-insensitive substring match on full path | | `type:` | string | — | file extension | **Post-process** — exact, case-insensitive match on the file extension (`type:flac`, `type:mp3`). Dot optional. Combine formats with `OR` | | `key:` | string | — | Camelot mix key | **Post-process** — exact, case-insensitive match on the track's Camelot code from the mood cache (`key:9A`, `key:11B`). Scanned tracks only — no key data never matches. Combine wheel-compatible codes with `OR` | | `lyric:` | string | — | lyrics body | **Post-process**, expensive. Gated on `library.search.dsl.allowLyricSearch = true` (default off) | **Any-field / custom slots**: beyond the 21 named qualifiers above, the field registry covers every MusicBee custom slot — `custom1:`…`custom20:` translate to a `Field="CustomN"` condition (e.g. `custom7:live`; Custom17-20 arrived with MusicBee 3.5). Combine with existing qualifiers as usual (`albumartist:"various" custom7:live`). These dynamic slots are NOT listed by `GET /library/search/syntax` (which returns only the 21 static qualifiers). Mood-position search uses the first-class `arousal:`/`valence:` range qualifiers (above), which filter on the AutoQ V/A. **Operators**: | Symbol | Meaning | Where it applies | |---|---|---| | `>` | greater than | Qualifiers with `allowsOperators` | | `>=` | greater than or equal | Same | | `<` | less than | Same | | `<=` | less than or equal | Same | | `..` | inclusive range (low..high) | Qualifiers with `allowsRange` | | `-` (prefix) | exclude | Free-text term or qualifier (e.g. `-genre:metal`, `-live`) | | `OR` / `or` | boolean OR | Between sibling expressions. Default between terms is AND | | `( ... )` | grouping | Forces precedence inside a larger expression | **Examples**: | Query | Result | |---|---| | `artist:radiohead` | Tracks by Radiohead | | `year:1985..1990` | Tracks released between 1985 and 1990 inclusive | | `year:1965 rating:>4` | 1965 tracks rated above 4 — two range/op qualifiers (implicit AND) | | `mood:chill rating:>=4` | Chill-mood tracks rated 4 or higher — mood is post-filter | | `rock -genre:metal` | Rock tracks excluding metal — free-text plus exclusion | | `(rock or metal) -live` | Rock or metal, but not live recordings | | `source:audiobooks duration:>3600` | Audiobooks longer than one hour | | `played:5` | Favorites you haven't played in the last 30 days | | `decade:80s -genre:disco` | 80s, no disco — decade enum plus genre exclusion | **Composition rules**: - Default between terms is AND. Use `OR` (or lowercase `or`) for disjunction; parentheses for grouping. - **Where a grouped query runs.** A query that is ONLY a group (`genre:rock OR genre:metal`) is handed to MusicBee's engine whole and runs there. A group placed BESIDE another condition (`artist:davis (genre:rock OR genre:jazz)`) is evaluated in the post-filter instead: MusicBee silently drops the sibling condition when a group sits next to it — measured 2026-08-18 on a ~7.5k library, where `artist:davis` alone matched 0 tracks yet `(genre:rock OR genre:jazz) artist:davis` returned 3385. Same results either way; the difference is that the post-filter path is capped, so a query producing more candidates than `library.search.dsl.maxPostFilterCandidates` answers `413 POST_FILTER_CAP_EXCEEDED` instead of quietly returning the wrong set. Add a selective condition, or write the group on its own. - Free-text terms work alongside qualifiers — `radiohead year:>=2000` filters Radiohead from 2000 onward. - Post-filter qualifiers (`mood`, `playlist`, `lyric`) run after candidate selection, capped by `library.search.dsl.maxPostFilterCandidates` (default 5000). - Unknown qualifiers return `422 INVALID_DSL` with parse position and Levenshtein-based "did you mean" suggestions. - Date format: ISO (`2025-01-01`), relative (`now-7d`, `now-30d`), or named alias from `search.dsl.dateAliases` (defaults: `lastweek` = `now-7d`, `lastmonth` = `now-30d`, `thisyear` = `now-365d`; hand-editable, read on every query). Relative dates and aliases are resolved to a calendar date before MusicBee sees them; any other spelling MusicBee reads as a date passes through (`2026/09/11`, `9/11/2026`, `Sep 11 2026` - the machine's date format decides day-first or month-first). A value that is not a date (`lastwek`, `20260911`) answers `422 INVALID_DSL` naming it; before 2026-10-23 such a value, and every `now-Nd` or alias, silently matched the whole library. - **DSL result rows carry `dateAdded` and `dateAddedSort`** — the raw MusicBee DateAdded string (the same value `GET /library/file/{url}` returns) and the same moment as `yyyy-MM-ddTHH:mm:ss`, or `""` when it could not be read — so a client can order query-backed rows newest-first without a second call per track, and without running `Date.parse` over a locale string no two browsers read the same way. On `/library/search?dsl=true` only; the non-DSL search rows and `/library/files` keep the shape they have. - **`?as=albums` on `/library/search?dsl=true`** answers the matches grouped into albums instead of track rows: `data.albums:[{name, albumArtist, firstTrackUrl, year, dateAdded, dateAddedSort, count}]`, `total` = albums, `trackCount` = matched tracks, `offset`/`limit` page the albums. One album per album artist (else artist) + album, compared case-sensitively; a track with no album is skipped; the first track in the query's sort order is the cover track and supplies `year`; `dateAdded`/`dateAddedSort` are the album's newest track. No `as`, or `as=tracks`, is the track answer as before; any other value is `400 INVALID_REQUEST`, refused before the library is queried. The Slices key rows use it. - `GET /search?q=&buckets=&limit=&cursor=` - Federated search. Runs typed buckets (tracks / albums / artists / playlists / saved) in parallel and returns a unified response with cursor pagination on the tracks bucket, facet counts, and a top-hit. Cursors are opaque and TTL-checked (stale → 410, malformed → 400, query-mismatch → 400). Opaque is NOT signed: the payload is base64url JSON any caller can read and mint, and nothing checks it came from here. Deliberate - the cursor is advisory, `?offset=` reaches exactly the same rows, and pagination is not an access boundary. Treat a cursor as a position, never as a permission. Backs the Cmd+K palette, the dashboard search bar, player.html, browse.html, and explore.html. **DSL routing:** auto-detects DSL queries the same way `/library/search` does (qualifier colons, `..` ranges, `>`/`<`, ` OR `, leading `-`). When detected and `Search.Dsl.Enabled=true` (default), routes through DSL pipeline and response carries `mode: "dsl"`. Per-call `?dsl=true` explicit override still works. Plain free-text queries continue to use strict/substring mode; the tracks bucket matches title, artist (each credited person), album, album artist and genre. **Tracks bucket relevance-sorted** by match strength (title > album > artist, with prefix-match bonus) regardless of mode. Backstop: same `search.live.minQueryLength` (default 2) check as `/library/search` — short queries return `400 QUERY_TOO_SHORT`. Per-bucket `?limit=` caps at 500 so browse.html's client-side aggregation gets the full intended slice. **Artists bucket is always one row per person** (2026-10-29): rows come from MusicBee's artists collection (the `artists` key tag), split on `;`, merged case-insensitively, `trackCount` summed - `timbaland` finds `Timbaland` on every install. `browse.splitArtists` governs the lists (`/library/artists`, `/library/album-artists`, `/library/genres`), not this bucket; a search names a term. A split part is kept only when its name matches the query by the same word-prefix rule as the rest of search - strict by default, so `timb` finds Timbaland and `ranger` does not find Stranger; `?substring=true` loosens it - a title-only match does not put its people in this bucket, and nothing is regex-split; MusicBee's Multiple Artist Splitter decides where a name ends. Every consumer of the bucket (Cmd+K included) sees the same rows. The bucket has its own page size: `?artistsLimit=N` (optional; default = `limit`; same clamp; artists bucket only), because each kept row costs one album lookup - browse.html asks `artistsLimit=50` beside `limit=500`, and every bucket's `limit` field echoes the page size it ran with. The envelope carries `splitArtists` (bool, always `true`: the shape this payload carries, kept because clients read it) and `splitAlbumArtists` (bool: the current `browse.splitArtists` setting, so a client grouping by album artist knows whether to split an `A; B` album artist and whether `/library/albums/by-artist?albumArtist=` matches a `;` part). Every tracks-bucket row carries `artists` (string[]: the people on the track per MusicBee's own collection - `MultiArtist`, else `Artists`, else the displayed `artist`) beside the unchanged `artist` string. Both ride the DSL path too. browse.html's search Artists section = this bucket plus the people of the matched tracks (their `artists[]`; a track that matched by title still credits its people), one row each - a search never shows a composite row beside a split one. - `GET /system/search-index` - Live engine + index state snapshot. Currently reports `engine:"mb"` (the seam is preserved for future search engines). - `GET /library/file/{url}` - Get file metadata - `PUT /library/file/{url}` - Update tags (body: {"Artist":"name","Title":"name"}) - `GET /library/files/raw` - Raw file path list (no metadata, faster) - `GET /library/cuetest?album=&count=&method=batch|iterate|cue` - Diagnostic: queues tracks from an album to test CUE queueing (count 1-10, default 3). batch/iterate add to the end of the queue; cue replaces the queue with the album's .cue file and plays it. Changes the queue, so it is gated like POST /queue/playnow: refused in read-only mode, by the queue-add switch, and by the party roles - `POST /library/add` - Add file to library (body: {"url":"path"}) - `POST /library/artwork/batch` - Batch artwork fetch (body: {"urls":["path1","path2",...]}, max 50). Returns base64 data URIs keyed by URL, null for missing artwork - `POST /library/files/batch` - Batch titles (body: {"urls":["path1","path2",...]}, max 200). Returns {"tracks":[{"url","title","artist","album"}]} in request order, each url echoed exactly as sent; a file the library does not hold comes back with title "" - show its file name instead - `POST /library/find-device-ids` - Find device persistent IDs (body: {"urls":[...]}) - `POST /library/sync-delta` - Get sync delta (body: {"deviceId":"...","since":"ISO date"}) - `POST /library/commit` - Commit pending tag changes to file (body: {"file":"path"}). Use after batching Library_SetFileTag RPC calls - `GET /library/evaluate?expression=&fileUrl=` - Evaluate MusicBee expression (template syntax: , $If(), virtual tags). fileUrl optional, defaults to now-playing. - `GET /library/no-artwork` - MusicBee's placeholder image for tracks with no artwork (binary). Cache-Control: 24h. - `GET /library/file/{url}/lyrics` - Lyrics for specific file - `GET /library/file/{url}/artwork` - Artwork for specific file (binary) - `GET /library/file/{url}/artwork-url` - Artwork as data URL for specific file - `GET /library/file/{url}/artwork-count` - Returns `0` (no artwork) or `1` (artwork present). Probes up to 20 embedded-artwork LOCATIONS and picks the largest byte-size as the canonical image; `/artwork?index=0` then serves that variant. Cached per fileUrl. - `GET /library/file/{url}/pdf` - PDF booklet from track's album folder (binary, application/pdf) - `GET /library/file/{url}/fan-art` - List all images in the track's album folder and one level of subfolders. Returns {folder, images:[], count}. Excludes: canonical primary-cover filenames (folder/cover/front/album × .jpg/.jpeg/.png) — duplicates of the primary artwork served by `/artwork`; ALL Windows Media Player cache files (AlbumArtSmall*, AlbumArt_*); thumbnails (<5KB); Thumbs.db; desktop.ini. Security: track must be in MusicBee library. - `GET /library/fan-art/{path}` - Serve a single fan art image by absolute path (binary). Security: image must be in a directory containing a MusicBee library file. Cache-Control: 1 hour. - `GET /library/file/{url}/videos` - List video files in the track's album folder (+ one subdir level). Filters by extension: `.mp4`, `.mkv`, `.webm`, `.mov`, `.m4v`, `.avi`. Returns `{folder, videos: [{path, name, sizeBytes}], count}`. Drives the Video tab on `nowplaying.html` Extras and the Videos section on `explore.html` expanded album view. Security: track must be in MusicBee library. - `GET /library/video/{path}` - Serve a single video file by absolute path (binary, Content-Type by extension: video/mp4, video/x-matroska, video/webm, video/quicktime, video/x-msvideo). Same library-scope check as `/library/fan-art/{path}` — the path's directory (or its parent) must contain at least one MusicBee library file. Cache-Control: 1 hour. - `GET /library/file/{url}/has-pdf` - Check if PDF booklet exists (returns {hasPdf: bool, url: string}) - `GET /library/file/{url}/device-id` - Device persistent ID - `PUT /library/file/{url}/device-id` - Set device persistent ID - `GET /library/file/{urlHash}/setlist` - Returns the parsed time-coded set list embedded in a track's Comment tag. Response: `{ fileUrl, fileDurationMs, entries:[{index, startMs, title, rawTime, cueTime}], trailingNotes, parsedAt, extractedCueExists, extractedCuePath, source }`. Each entry carries `rawTime` (the matched timecode verbatim, e.g. `"0:40"`) and `cueTime` (CUE MM:SS:FF form, e.g. `"00:40:00"`, 75 fps) so consumers don't re-derive them. `fileDurationMs` is the parent file's length so the Tracklist UI can compute per-entry durations including the trailing entry — 0 when a paired CUE exists (signals trailing-duration math is unreliable). Returns `404 NO_SETLIST` if neither the Comment nor a paired CUE names this file's songs. When the Comment holds no setlist the route answers from the file's paired `.cue` sheet instead, and `source` says which tag the songs came from (`"comment"` | `"cue"`). The Comment wins whenever it holds a setlist, so files that answer today answer identically (most sidecars were extracted from that Comment); a hand-edited `.cue` that diverges later loses until the Comment is cleared. CUE-sourced entries carry `startMs` + `title` with `rawTime` and `cueTime` null (a sheet has no Comment line to quote); a multi-FILE sheet is filtered to the url asked about as `/library/files` does; a sheet of one song spanning the file is not a set of songs (still 404). `/nowplaying`'s `hasSetlist` is unchanged and stays Comment-only (it drives the SET LIST badge), so a client that wants the songs asks this route and treats 404 as none. **Accepted line formats** (SL-TPS v1.0): each candidate line is tested independently (multiline `^…$`), with optional leading bullet (`-` / `•` / `*`) and optional decorative index prefix (digits, optional `.` or `)`, optional `-` / `–` / `—`). Then one of two core shapes: **time-first** `[HH:]MM:SS [optional separator] TITLE` or **time-last** `TITLE [optional separator] [HH:]MM:SS`. The optional separator accepts `-`, `–`, `—`, or `:` followed by whitespace (the colon variant is common on YouTube-comment paste-throughs, e.g. `02:46 : Last Train`). The timestamp may also be wrapped in parens, e.g. `(0:11) Live In The Moment` (common on YouTube/Reddit comments); title-internal parens are preserved verbatim. Hours optional; minutes 1-2 digits; seconds exactly 2 digits. Worked examples that all match: `0:40 - Catch These Fists`, `0:00:00 Sweet Lies`, `01 - The SoundMaker - 00:00`, `1. Amyl And The Sniffers - Foo 00:00`, `Man Made Of Meat 01:09`, `02:46 : Last Train`, `(0:11) Live In The Moment`. Index prefixes in the text are decorative; the parser assigns sequential `1, 2, 3, …` from match order. Lines that don't match are silently skipped. Detection rules: ≥3 matched lines (configurable `MinEntries`), timestamps strictly monotonic increasing, optional duration sanity (last timestamp must be before file duration when known). `{urlHash}` is computed from the track's `url` (the `url` field from `/library/files` or `/nowplaying`): `base64url(sha1(utf8(url))[0:16])` with `=` stripped → 22 chars. Browser clients use `MBXShared.urlHashOf(url)` (shared.js), byte-equivalent on secure and non-secure LAN-HTTP contexts. - `POST /library/file/{urlHash}/extract-setlist-cue` - Body: `{ overwrite: bool }` (default false). Parses the Comment via the same heuristic, builds a real CUE sidecar at `.cue` (UTF-8 with BOM so `CueParser.DetectEncoding` round-trips), atomic write via tmp (per-call guid suffix) → `File.Replace` → `.bak`. Invalidates `AlbumIndex` so the next browse / search / NP read returns the virtual tracks. Returns `200 OK { cuePath, entriesWritten }`. Errors: `409 CUE_EXISTS` (pre-existing CUE, `overwrite=false`), `400 NO_SETLIST`, `500 WRITE_FAILED`. Gated by `AccessControl.LibraryTags` so PartyMode guests cannot write. Duration sanity: detector rejects setlists whose last timestamp lands past the file's duration. Deep-link query params on the standalone pages (no new endpoints): - `/pages/nowplaying.html?tab=tracklist` - Opens the page with the segmented `[Lyrics | Comment | Tracklist]` control switched to the Tracklist tab on the first successful setlist load. Used by the dashboard SET LIST badge. - `/pages/play.html?np-tab=tracklist` - Same intent for the full-player chrome variant: appends `&tab=tracklist` to the middle-pane nowplaying iframe src so the embedded NP page lands on the Tracklist tab. Used when `DashboardLayout.liveSetBadgeTarget` is set to `"play"`. - `/pages/browse.html?album=&artist=&trackUrl=` - After the album drilldown renders, the watcher polls for the row whose `data-url` hashes to `` (via `MBXShared.urlHashOf`) and scrolls it into view with a brief accent pulse. Generated by the Now Playing right-click "Copy deep link" item. - `GET /library/artist/{name}/similar` - Similar artists (?limit=10) - `GET /library/artist/{name}/picture` - Artist picture (binary) - `GET /library/artist/{name}/thumbnail` - Artist thumbnail (smaller) - `GET /library/artist/{name}/pictures` - Artist picture URLs (?localOnly=false). Response includes a `pictures` array with `src` URLs (serveable via `/library/artist/{name}/pictures/{index}`) in addition to raw file paths. - `GET /library/artist/{name}/pictures/{index}` - Serve artist picture by index as binary image (0-based, from /pictures list). Query: ?localOnly=true. A remote (http/https) picture over 16 MiB answers `502 ARTWORK_TOO_LARGE`. - `GET /library/recent` - Recently played tracks sorted by last played descending (?limit=50&offset=0&days=30) - `GET /library/videos` - Video files from MusicBee's Video library node. Returns `{total, videos: [{url, title, artist, album, kind, duration}]}`. Title falls back to filename when tag is empty. Uses Source Type 64 query ## Saved Search & History ### Saved searches Persisted query under a name, evaluated on a schedule. Backed by `mbxhub-search.json` next to `mbxhub.json`. Enabled by default; toggle via `library.search.savedSearch.enabled`. Disabled endpoints return 404 NOT_FOUND. **All write/mutation routes return 403 FORBIDDEN when `ApiReadOnlyMode` is set.** - `GET /search/saved` - List all saved searches `{searches:[...], total}` - `POST /search/saved` - Create. Body `{name, query, delivery?, schedule?, mbPlaylist?}`. Server generates id. 422 INVALID_DSL on parse error (with parse position); 409 on duplicate name (case-insensitive, per host); 422 INVALID_NAME if name missing or > 80 chars - `GET /search/saved/{id}` - Fetch one - `PUT /search/saved/{id}` - Update name / query / delivery / schedule / mbPlaylist - `DELETE /search/saved/{id}` - 204 on success, 404 if unknown - `GET /search/saved/{id}/results` - Evaluate now; returns Track B response shape (matched URLs + count) - `POST /search/saved/{id}/run` - Force re-evaluation; returns diff vs `LastMatchUrls`. Drives the `SearchMatched` WS broadcast (D2) ### Search history Server-side recent-search log shared by Cmd+K and any other search bar. Falls through to client localStorage if 404. Mutations gated on `ApiReadOnlyMode`. - `GET /search/history?limit=N` - Newest-first. `limit` defaults 20, caps at 200 - `POST /search/history` - Body `{query, source}`. Empty body clears (returns `{cleared:true}`) - `DELETE /search/history` - Wipe all entries ## Radio - `GET /radio/stations` - List radio stations (returns `{total, stations: [{url, name}]}`) ## Playlists - `GET /playlists` - List all playlists - `POST /playlists` - Create playlist (body: {"name":"My Playlist","files":["path1","path2"]}) - `GET /playlists/{url}/files` - Get playlist tracks - `POST /playlists/{url}/files` - Add tracks (body: {"urls":["path1","path2"]}) - `POST /playlists/{url}/play` - Play playlist - `GET /playlists/{url}` - Get playlist details - `PUT /playlists/{url}` - Replace playlist contents (body: {"files":["path1","path2"]}); response data includes `result` and `trackCount` - `DELETE /playlists/{url}` - Delete playlist ## WebSocket Connect to `ws://127.0.0.1:8080/ws` for real-time events: ```javascript const ws = new WebSocket('ws://127.0.0.1:8080/ws'); ws.onmessage = (e) => { const msg = JSON.parse(e.data); // msg.event: TrackChanged, PlayStateChanged, VolumeChanged, etc. // msg.data: event-specific payload // msg.timestamp: ISO 8601 timestamp }; // Subscribe to specific events: ws.send(JSON.stringify({ subscribe: ['TrackChanged', 'PlayStateChanged'] })); ``` Credentials (open by default): the feed needs no credential unless the hub resolves it RESTRICTED - read `GET /system/features` -> `webSocketAuth` (`"clear"` | `"restricted"`), never guess from posture. Only a Shared LAN profile ever restricts it (by default; the plugin can turn that off: MBXHub settings -> Remote Access tab -> "Live event feed"; console-only). Private LAN and This computer only behave exactly as before, whatever the setting holds. Local connections are never gated. When restricted, a remote handshake needs ONE of: - A program: `X-Api-Key: ` or `Authorization: Bearer ` on the upgrade request (a Basic install's `Authorization: Basic` works too) - a browser cannot set a header on a WebSocket handshake, which is why the second door exists. - A page: `POST /ws/ticket` (gated like any route; a page holding a session, a key, or running locally can mint) -> `{"ticket":"...","expiresInSeconds":30,"webSocketAuth":"restricted"}`; connect to `/ws?ticket=`. SINGLE-USE and thirty seconds: mint before EVERY connect, including each reconnect (`MBXShared.connectWebSocket` does this itself). A KEY in the query string is never a credential, on `/ws` or anywhere. - A refused handshake answers `401` before the socket is accepted, in the REST gate's two shapes (`AUTH_REQUIRED` + Basic challenge when the password is on; `UNAUTHORIZED`, no challenge, otherwise). Restricted with neither the password nor keys configured refuses every remote handshake, and `POST /ws/ticket` answers `401 UNAUTHORIZED` too - by design, not a downgrade. `POST /ws/ticket` is on the Read-key allow-list and is a read by category. Event types: - `TrackChanged` - {"fileUrl":"...","title":"...","artist":"...","album":"...","duration":ms,"artworkUrl":"/nowplaying/artwork","cueTrack":N,"cueStartMs":ms,"cueFrame":"song"|"file"} (cueTrack + cueStartMs present only when CUE active; cueFrame only when the hub can decide the row kind - see `GET /nowplaying`) - `PlayStateChanged` - {"state":"playing|paused|stopped"} - `PositionChanged` - {"position":ms,"duration":ms} - `VolumeChanged` - {"volume":0-100,"muted":bool} - `ShuffleChanged` - {"enabled":bool} - `RepeatChanged` - {"mode":"none|all|one"} - `TempoChanged` - {"file":"..."} - MB 3.5+ playback-tempo notification relay (no tempo value in the MB API; observation event) - `QueueChanged` - {"action":"changed","index":-1,"totalTracks":-1} - `MetadataChanged` - {"fileUrl":"...","rating":-1 to 5,"love":"L|B|"} - `Reaction` - {"emoji":"fire","type":"fire","nickname":"Guest","trackTitle":"...","trackArtist":"..."} - `TasteChanged` - {"topGenres":[...],"topArtists":[...],"bpmRange":[lo,hi],"mood":"...","moodConfidence":0.0-1.0,"influenceCount":N,"reactionCount":N} - `ThemeChanged` - a device with a theme of its own IGNORES this (see `/device/theme`) - {"activeMode":1|2,"accentHue":0-360,"accentSaturation":0-100,"accentLightness":0-100,"bgHue":0-360,"bgSaturation":0-100,"bgLightness":0-100,"surfaceHue":0-360,"surfaceSaturation":0-100,"surfaceLightness":0-100,"textHue":0-360,"textSaturation":0-100,"textLightness":0-100,"intensity":0-100} - `InfluenceChanged` - An AutoQ influence was added or removed. `{"action":"added|removed","type":"","target":"...","value":"..."}` - `type` is absent on the DELETE path; the dashboard's own toggle also carries `source` and `message`, and a party vote carries `nickname`. Fired from `POST /influences`, `DELETE /influences/{target}/{value}`, `POST /dashboard/influence/{genre|artist}/{up|down}` and `POST /partymode/vote` - `SystemEvent` - A named signal pushed in from outside the plugin process. `{"name":"...","payload":...}` - the pushed name and the request body, `null` when the body was empty or not JSON. SUBSCRIBE TO `SystemEvent`, NOT TO THE PUSHED NAME. Fired from `POST /system/events/{name}`. Names in use: `CastStatus` - the Cast session's state, pushed by the paired Shell; its payload is `GET /cast/status`'s `data` (see Cast) - `Shutdown` - MusicBee is closing or restarting. `{"restart":bool,"delay":seconds}` - `delay` is the restart countdown, `0` on a plain exit. Sent BEFORE the close is issued so clients can reconnect gracefully rather than discover the socket gone. Fired from `POST /app/exit` and `POST /app/restart` - `SearchMatched` - Periodic-evaluator broadcast when a saved search's match set changes. `{"id":"...","name":"...","added":[urls],"removed":[urls],"total":N,"evaluatedAt":"ISO8601"}`. Driven by `SavedSearchScheduler` ticking each saved-search interval; only fires when the diff is non-empty - `MoodCacheReady` - One-shot broadcast when the cold mood cache finishes loading. `{"entries":N}` (count of moods now in cache). Dashboard's WS handler calls `softUpdate` on receipt to fill the mood pill without a polling fetch. Fires once per plugin start, immediately after MoodCache phase 3 (valence/arousal) completes - `PartyStateChanged` - Party mode started or ended. `{"isActive":bool}`. Fired from StartParty/StopParty (REST endpoint or WinForms dialog). Already-open pages (player.html) redirect to `/pages/partymode/` the instant a party starts, instead of polling `/partymode/status`; fresh loads are handled server-side by a 302 redirect - `CharmActivated` - A person activated one of a charm's entries. `{"charmId":"...","event":"activated","placement":"menu","entryIndex":0,"entryLabel":"Open Thing","atUtc":"ISO8601"}`. ADDRESSED FOR A `proc` CHARM: it goes to the socket bound to that charm and to nobody else - see "Binding a charm's socket" below. A `page` CHARM'S ACTIVATION IS BROADCAST, because the hub has no handle on the iframe: every connected client that has not filtered it out receives it, and the dashboard's socket handler forwards it into the right frame. The payload is the same either way - which charm, which entry, where it sits, and nothing else. `event` is `activated`, the whole verb set this release; `placement` says which surface was touched; `entryIndex` is the index into the charm's own `expand[]`, not a position in a menu - `ListenHereClaimed` - A page took the Listen Here audio (`POST /listen-here/claim`). `{"holder":"lh-abc123","page":"/pages/play.html"}`. A page that HELD the audio and sees another holder now (it was away past the abandon window) joins as a listener (`POST /listen-here/join`) and keeps playing; a listener ignores it; neither touches MusicBee. Ignore your own id. Fires only when the holder changes. Priority delivery: nothing later repeats it, and a dropped one leaves two pages playing at once until the holder check catches up - `ListenHereRoomChanged` - A device's Listen Here room changed (CQ4): `{"clientId":"c-...","room":"here-too"|"here-only"|null,"effective":"here-only"|"here-too","revision":3,"generation":2,"source":"device"|"console"}`. `source:"device"` = the device proposed a new revision on its claim/join/check-in; `source:"console"` = the MusicBee Client Manager set it (the device adopts and acknowledges it on its next check-in). Informational for other pages; the device's own answer carries the same state. Normal delivery (the next check-in answer repeats it) - `ListenHereEnded` - The shared Listen Here session was ended at the MusicBee Client Manager (CQ4, B1): `{"generation":2,"reason":"console","notice":"Ended at the MusicBee PC"}`. A device of THAT generation lets go, shows the notice and posts nothing (no release, no leave, no hand-back: MusicBee is left as it is); another generation ignores it. Priority delivery: one-shot - a dropped one leaves a device playing a closed session until its next check-in answers `ended:true` - `ListenHereSourceChanged` - A shared queue started on a device was started or changed (CQ5): its start, an accepted edit, transport, advance or property, the owner's presence changing (a departure, a reclaim), a reassignment, an end, or a Client Manager action. `{"sourceId":"...","generation":3,"revision":7,"occurrence":2,"notice":null|"Unlocked at the MusicBee PC"}`. A device in THAT queue re-reads `GET /listen-here/sources/{id}`; nobody else acts on it, and it tells no other listener to stop. NOT raised for a check-in's position, a member joining or leaving, or an election. Normal delivery (the next heartbeat answer carries the same state) - `ListenHereSourceEnded` - A shared queue ended (CQ5): by its owner, at the Client Manager, or because nobody was listening. `{"sourceId":"...","generation":3,"reason":"owner"|"Client Manager"|"abandoned","notice":"..."}` - `owner` = the owner's `/end`, `Client Manager` = End session at the MusicBee PC, `abandoned` = the owner had departed and nobody was left listening. Only that queue's devices stop. Raised once per queue and generation. Priority delivery: one-shot - a dropped one leaves a device playing a queue that is gone until its next check-in answers `ended:true` ### Binding a charm's socket A registered charm names itself on a socket by presenting its ticket in a `bind` message. After that the connection receives `CharmActivated` for THAT charm - a person clicking one of its menu or bar entries arrives here. ```javascript // Sent by the charm, once, after connecting: ws.send(JSON.stringify({ bind: '' })); // Then, on a click - the ordinary event envelope: // {"event":"CharmActivated","timestamp":"ISO8601","data":{ ...the payload above... }} ``` - SUBSCRIPTIONS DO NOT APPLY TO A BOUND SOCKET. A bound client gets its own charm's events whatever it subscribed to. Binding is the narrower and more deliberate act - the client presented that charm's credential to name itself - and a charm that also had to remember to subscribe would be one forgotten line away from a menu item that silently does nothing. The subscription list still decides the broadcast events. - LOOPBACK ONLY. A `bind` from anywhere but the machine MBXHub runs on is ignored, and ignored ABOVE resolution (the same order the REST gate uses), so a socket from across the network cannot learn whether the ticket it presented is a real one. - BEING IGNORED IS NOT FATAL. A ticket that resolves to nothing - unknown, never approved, revoked - leaves the connection an ordinary event socket; it is simply not bound, and the charm learns that by receiving nothing. There is no bind acknowledgment either way. - BINDING IS FOR A `proc` CHARM. A `page` charm runs in a frame the dashboard owns, so its activation is broadcast rather than addressed and the dashboard forwards it into that frame; there is no socket for a page to bind, and `CharmActivated` is a subscribable type like any other. - `bind` is handled BEFORE `subscribe` in the same frame, so one message may do both. - The ticket is resolved through its digest and then forgotten. No plaintext is kept, and no route re-reads one - a charm that loses its ticket is approved again. ## Static Pages (/pages/) MBXHub serves HTML, CSS, and JS from the `/pages/` directory. ### How It Works - Files location: `%APPDATA%\MusicBee\MBXHub\pages\` - Access via: `http://{host}/pages/yourfile.html` - Supports: .html, .css, .js, .json, images - No build step - just save and refresh ### Included Pages Read these for working reference code: - `GET /pages/index.html` - Landing page listing available views - `GET /pages/player.html` - LEGACY (kept serving for bookmarks/default-page users; receives no new features - superseded by the device-adaptive play.html). Full 3-column player (browse iframe, now playing, queue) with drag-drop queue reorder and touch support - `GET /pages/nowplaying.html` - Focused standalone now-playing view. Drag-drop queue reorder on upcoming tracks. Auto-stacks below 800px into three collapsible blades (Now Playing, Queue, Lyrics). - **Now Playing has two states**, never fully collapses to header-only: **Expanded** (~50% viewport, full artwork + reactions) and **Compact** (~52px header bar with mini artwork thumb + title + artist + transport buttons: prev / play-pause / next, all hitting `/player/previous` `/player/playpause` `/player/next`). The play/pause icon mirrors `isPlaying` driven by the `PlayStateChanged` WebSocket event. - **Queue and Lyrics use last-touch-wins**: at most one is Expanded at a time. Tapping a collapsed Queue or Lyrics header expands it and auto-collapses the peer to its header bar. - Floating 6px progress bar fixed at viewport bottom drives seek via click -> `PUT /player/position`. Position fill driven by the `PositionChanged` WebSocket event with a 30s `/nowplaying/position` poll as a tab-visibility-gated safety net. - All blade-collapse / transport markup is gated by the stacked layout (typical at tablet width or fullscreen browser). Charm-tab / iframe-mode rendering is unchanged - gated by `body.iframe-mode` and `html.embedded` rules. - `GET /pages/hud.html` - MBXHub HUD: a compact now-playing / queue / browse / reactions page. Works standalone in any browser, and is the page the MBXHub Shell's Overlay hosts (on by default; summon with Ctrl+Shift+M; toggle from the Shell tray Settings > Enable Overlay or `overlay.enabled` in `mbxhub-shell.json`, where `overlay.hotkey` / `overlay.startPage` also live). `theme.overlayThemeMode` picks which theme slot the Shell-hosted surfaces use — the HUD, the HUD's settings window and the Charm Bar, always the SAME slot (0 = follow the active mode); the HUD re-reads the theme on every summon, so a theme change lands without a restart. `hud.dashboardPage` (default `/dashboard`) sets where the HUD's `Open full dashboard` menu entry goes - root-relative only, anything else falls back to the default. BROWSE LANDING: the HUD remembers the last Browse choice between Library and Slices - the last press on its own view switch, held per HUD - and reopens it; `hud.browseDefault` is `auto` (default), `library` or `slices`. `auto` lets the DEVICE decide: a phone lands on `slices`, a desktop on `library`. `library` or `slices` FORCES that landing on every device. The class is detected, never configured — the Shell's overlay window is a known desktop (`window.chrome.webview`), a browser is read from its viewport width (under 768 CSS px is mobile), and width is deliberate because it is what the browser's own "Request desktop site" moves; touch queries would not, so honoring them would override the user's override. Only those two are landings: the Mixer is use-case specific and Stations is less known, so pressing either leaves the memory alone and neither can be set as the default. Immersive is unchanged - whatever fills the frame opens full-window exactly as Browse does. In a narrow overlay the Ctrl+K palette temporarily widens the window while open. `/pages/overlay.html` is an alias. The HUD can also be a DRAWER (tray: `HUD as a drawer`, off by default and remembered PER VIEW; turning it OFF clears every view so off means off, and the tray tick reads the current view each time the menu opens). ON: the HUD rests off the screen edge with a small THUMB showing at the middle of that edge — a pill with a gripper, a chevron and a pin, in the page's theme colors — comes out when the pointer rests on the thumb, and slides back a couple of seconds after the pointer leaves; the pin keeps it out, and a pinned drawer also ignores Esc, because Esc is the fastest way to lose a window you are working in. OFF: an ordinary window, and the thumb (pin included) is not shown at all. Only the thumb wakes it, not the whole edge, so a tall HUD does not open every time the pointer goes past. The edge is chosen for the monitor: one with empty desktop beyond it, so on a screen with another monitor to its right the drawer docks LEFT. What gets remembered is where it sits when it is OUT, never where it rests, or it would reopen off-screen. Focus buys time before it retreats, not immunity — a drawer you can only shut by closing it is not a drawer. See the Overlay section below for what a page must do to behave well when hosted. When hosted by the Shell the HUD has three SIZES, cycled by a chevron in its chrome: `full` (the whole HUD), `player` (a wide short bar - artwork, track, transport, volume, progress hairline) and `transport` (transport and mute only). The size is CHOSEN, not inferred from width - the page's separate narrow-width pass is a different thing. `overlay.mode` remembers the last size and `overlay.bounds` / `overlay.bounds.player` / `overlay.bounds.transport` each remember that size's own window rectangle, so summoning returns the HUD exactly as it was left. There is no second hotkey: every standard Windows shortcut nearby means minimize, and this is minimal rather than minimized. Ctrl+K from a compact size returns to `full` first, because the palette needs vertical room for results. In an ordinary browser the chevron does not appear - a page in a tab cannot resize its window. The HUD can also be dragged by its own content (the `MBXHub` name, the artwork, the compact bar) rather than only by the host's invisible edge band. CLOSE BOX: one button, drawn by the page, pinned to the top-right corner in every size and in immersive. There were two before - the Shell drew a button in a 24px band at full size and the page drew its own inline in the compact bar, so cycling size moved it, and immersive had none at all. The Shell now draws none for the HUD and keeps no band, which gives the window that 24px back as height; the target bar reserves 24px of width for the button instead, which clips the target name only at the 320px minimum. Hidden outside the Shell: a page in a browser tab cannot close its own window. IMMERSIVE BROWSE: pressing the `Browse` chip while Browse is already the current view hides the HUD's own chrome - the target bar, the Services block, the ministrip and the view selector - and gives the whole window to the embedded library; `browse.html` is not changed by this and does not know about it. The `⋮` menu carries the same entry (`Immersive browse`), which also switches to Browse on the way. Two ways out, both always available: a persistent round control at the bottom-LEFT (44px, clear of browse.html's A-Z rail on the right edge) and `Esc`. The exit is a real control rather than a hover reveal because on a device this view is touch-first and hover does not exist there. Immersive never survives a change of view - anything that leaves Browse puts the chrome back, because a HUD with no header and no selector on another view has nothing left to press. Not persisted: it lasts for the visit. METADATA LINKS: on the Playing view the artist and the album are links. They have carried the accent since the sentence was built and now act on it: each opens the HUD's own Browse frame drilled into that artist or that album, with the album carrying its album artist so a title two artists share opens the right one. A value that is empty is not a link, so nothing is playing offers no dead click. `browse.html` gained the matching half: a `navigate` message that arrives before the page has finished loading is HELD until it is ready rather than drilling underneath the tab render that follows - which affects every sender of that message, the Ctrl+K palette and the dashboard search overlay included. IMMERSIVE PLAY: a small control in the bottom-right of the cover on the Playing view fills the display with the artwork; the details and the transport sit over it and ride the same chrome fade, so at rest the picture has nothing on it. A 44px round button top-right leaves, and so does Esc — a real control rather than a hover reveal, because this view is touch-first and hover does not exist there. In a BROWSER it is `requestFullscreen`, and a refusal is reported to `mbxhub.log` via clientLog rather than swallowed. HOSTED by the Shell the page cannot take the screen itself, so it asks (`overlay.fullscreen` / `overlay.fullscreenExit`) and paints the host's `overlay.fullscreenChanged` echo; the Shell takes the whole monitor the window is on, covers the taskbar, and brings a drawer fully out first. Distinct from IMMERSIVE BROWSE below, which gives the window to the embedded library instead and keeps its own exit inside the browse pane. TRACK DETAIL: the dashboard's two detail switches govern the HUD as well, which until v0.5.5.0 they could not — the dashboard renders server-side and read them straight off settings, so `GET /system/settings` now carries them (`dashboardLayout.disableVirtualTracklistBadge`, `liveSetBadgeTarget`, `hideFileInfo`). The SET LIST / CUE badge sits on the artwork beside the rating, shown only when the playing track has one (`/nowplaying`'s `hasSetlist`, or `cueTrack > 0` for a virtual — CUE wins, since a virtual's Comment still carries the parent file's set list) and only while the badge switch is on; pressing it opens the tracklist where `liveSetBadgeTarget` says, Now Playing by default or the player view. FILE PROPERTIES live in the ⓘ info sheet as a `File` source rather than over the artwork: the dashboard's format line (codec plus BITRATE for a lossy file or SAMPLE RATE for a lossless one, with the hi-res mark above 44.1 kHz) and the raw `kind` / `sampleRate` / `bitrate` under it, because the line deliberately drops whichever of the two says nothing about that format. Values come from the `/nowplaying` poll the HUD already makes; `hideFileInfo` removes the chip entirely rather than emptying it. The format is computed by `MBXShared.formatFileInfo`, the JS home for a rule that also exists in C# for the dashboard's first paint. LISTEN HERE in the HUD: one output with configurable placement: title bar (default), Services, or neither. The system default is hud.listenHerePlacement; this device can override it in HUD presentation. Controls remain full-mode only; nothing is added to the compact bar. VOLUME IN THE TITLE BAR: the speaker, the - / + steppers beside it (shown on touch screens), the level and the fader name are one cluster, shown or hidden together by `hud.volumeControls` (`shown`, the default, or `hidden`), with a per-device override in HUD Settings; hidden, the title bar re-fits without them. Dragging the speaker left or right steps the mixer volume only while `hud.volumePull` is on, and it is OFF by default. With the pull off, a tap on the speaker still mutes, and the - / + buttons and the arrow keys on the focused speaker (Tab to it; a mouse click does not focus it) still step the volume. CAST is the MBXHub Shell's, not the browser's: the Shell casts MusicBee's queue, from the current track on, to a Google Cast receiver, and the cast outlives the page. The HUD places Cast independently using hud.castPlacement (titlebar, services, neither), with a per-device override. play.html and the dashboard carry the same control (`components/cast-remote.js`). It is shown while the hub's casting is on (`cast.enabled`) and hidden entirely when it is off. With nothing cast, pressing it lists the receivers from `/cast/receivers` with a Rescan row, and picking one starts the cast; while a cast runs the button is lit, and pressing it opens play/pause, previous, next, stop, seek, volume and mute for the receiver. It needs the Shell running on the hub's computer (without one the control says so in one line) and remote connections on, because the receiver fetches each track from the hub's LAN address. On the rolled-up strip, the Cast button opens the same control before or during a cast without unrolling the HUD. Shell opens its Cast window; browser hosts open the anchored panel. Mixer content keeps clear of the bottom transport controls. See the Cast section for the routes. The output switch: speakers (room) <-> browser (this device), shown when `/system/features` says streaming is on. It is the SAME output layer play.html runs (`components/listen-here.js`): flipping to browser takes the room's current track over onto the HUD's own audio at the room's position and pauses the room; flipping back pauses here and resumes the room; while on browser, Play on selected output in the HUD's browse pane and its queue verbs drive a local queue. The room is paused at takeover; later room playback is left alone, so both outputs may sound until a listener stops one or changes output. The HUD follows the owned track for title, artwork and progress; stars and hearts are read-only during independent local playback. Mixer volume controls name the resolved mixer target. Browse reports Playback requested, which does not confirm receiver playback. Mixer network entries select the endpoint fader; This device plays in this browser. Output and local queue share one feature read; foreground refresh after 30 seconds and deliberate retry refresh it without a periodic discovery timer. The choice is remembered per HUD (`localStorage["mbxhub-hud-output"]`), separately from play.html's. On the Browse view switch only Library is built in; Mixer, Stations, Music Map and Slices are registry views (overlay-placement entries in their manifests, listed by `GET /charms/pages?placement=overlay`), so hiding a charm in Charm Manager (`charmBar.hidden`) takes its button off the switch - Mixer and Stations included since v0.5.5.2. - **Fixed Browse / Playing / Queue selector** (pill-behind-glyph) - the three views are always one tap apart, and the target bar above them names the target with volume and an inline pause off the Playing view. - **Track-details (i) view** off the target bar - shows only what the track actually has: lyrics, comment, set list, fan art, video, similar. Registry-driven, one chip per source that has content, and the button itself is absent when there is nothing to show. - **Playing view** - prev / play-pause / next transport and the reactions (fire / heart / downvote inline, upvote / ban in overflow) sit beside the art, with Mode (mood / flow / ON-AIR) one tap away via the shared radio strip. - **Browse view** - a play-first Services grid above the embedded browse page: start a station or a program, reach devices. - **Mini-strip** appears whenever you leave the Playing view, so transport stays reachable from Browse and Queue. Queue shows count + total time, tap-to-play-from-here and a two-tap clear. - `GET /pages/browse.html` - Library browser: 8 tabs (Albums/Artists/Genres/Playlists/Tracks/Podcasts/Radio/Moods) with responsive tab sizing, drilldown and breadcrumbs, diacritic-normalized fuzzy search with 8-category grouped results, album art grid with lazy loading, batch queue via long-press, playlist picker, search-driven Tracks tab via /library/search, video items with direct play (no drilldown), auto-search fallback (when inline name filtering yields no results, auto-triggers full-text server search), light/dark theme. FRAMED, the row queue verbs (Play now / Next / Last) are handed to the host page as `mbxhub.frameAction` messages ONLY once the host has answered the frame's ask: the page posts `{frameHostQuery: true}` to its parent and a host that performs frame actions answers `{frameHost: true}` (play.html, the HUD, the dashboard and player.html all do). Until an answer arrives a verb waits one beat and then calls `/queue/*` itself, so a page of your own that frames browse.html and does not answer still gets working rows - the hub is called with the frame's own standing, not the host's. Answer the ask if you want to route those verbs yourself (a Listen Here host does). - `GET /pages/config.html` - Settings and configuration interface for dashboard and AutoQ - `GET /pages/autoq.html` - AutoQ Tuning Console: mixer-style sliders for all scoring weights, reaction scores, and normalization ranges. Save sends only the fields changed on the page (a nested weight by its own key), so a setting changed somewhere else since the page loaded is kept; after Reset to defaults, Save sends every default - `GET /pages/autoqworkbench/{faders|live|builder|stations|programs}.html` - AutoQ Workbench: five single-purpose pages that make up one workbench. Each is reachable on its own and is one entry on the `autoqworkbench` charm (not device-specific, so it ships visible - it is NOT in the `charmBar.hidden` defaults). No page adds a REST endpoint - all five ride existing surfaces. - `faders.html` - The tunings mixing console. Vertical faders for `scoringWeights` (7), `reactionScores` (5), `influenceScores` (4) and the `estimation` normalization ranges (14), grouped exactly as `GET /autoq/settings` groups them. 400ms-debounced `PUT /autoq/settings` of the whole mutated object (`moodChannels` / `estimation` / `genreProfiles` round-trip untouched); the save indicator is judged from the PUT response only (`saving…` → `saved ✓` / `save failed`); Reset-to-server cancels a pending save and refetches. The normalization rack dims and disables while `estimation.usePercentileNormalization` is on, the same inert treatment autoq.html gives those fields. - `live.html` - ON-AIR. Track header with artwork and a metadata sentence, a Valence/Arousal plot (12 mood channels, target ring, current-track dot), a Camelot ring lighting the harmonic neighbors (relative + ±1 hour) with a Key | Chroma toggle on its card (Chroma draws `/autoq/track-mood` `raw.hpcp12` - 12 values, A first - as a ring of twelve note flares, each longer and more vivid the stronger that note is, with a `Most prominent notes: A · E · D` line; the choice is remembered in the browser), reactions (fire / heart / downvote inline, upvote / ban in overflow → `POST /autoq/react {emoji, nickname:"Host"}`; ban chains a bodyless `POST /player/next` with `Content-Length: 0`), previous / play-pause / next beside the timeline (while a cast is live they post `/cast/previous` | `/cast/pause` | `/cast/play` | `/cast/next` naming the cast's session, otherwise the bodyless `POST /player/previous` | `/player/playpause` | `/player/next`), and Mode via `MBXShared.attachRadioStrip`. Opened in a browser, the header carries Home (`/`) and Pages (`/pages/`); in a dashboard frame or a Shell window they are hidden. After the current track: Upcoming Tracks, the next five in play order (`GET /queue?view=play&offset=0&limit=6`, row 0 is now; read on every poll), then the wheel and Why This Track, which ends in a Track detail link to `/pages/autoq.html` (hidden with Home and Pages); each of the three folds from its heading, remembered in the browser. The current track's Artist and Album are links: a click sets Slice by Artist or Album on the Music Map with that name picked (the artist is looked up with `GET /library/files?artist=`, so a guest or compilation track is found) and frames those tracks, with no reload; the link's own address does the same on load - `live.html?view=library&artist=` or `&album=`. 5s poll of `/nowplaying` + `/autoq/radio` + `/autoq/track-mood` with 1s interpolation; ms → seconds converted once at the fetch boundary. The queue-order why-trail is NOT available over REST (`AutoQDialog.HarmonicTrailFor` is plugin-internal), so the page renders only what `/autoq/radio` + `/autoq/track-mood` provide and says where the trail lives. The mood plot has a Song / Library toggle: Library is the music map - every scanned library track as a star (`GET /autoq/mood-map`), a **Slice by** control (Genre | Mood | Artist | Album | Track | Fresh | Never heard | Most played | Playlist, and Ring once a station has been seeded) that sets what the legend lists, what colours the stars and what the find box searches - every slice dims, nothing hides; with Mood, the line under the map and the selector name the lit moods (up to three, then the first two and +N), and a click on the map lights only the mood of the region under it - once that mood is the one lit, a click on its star opens the card (every other field opens the card on the first click); a fullscreen button fills the screen with the map and its slice controls (in a browser, the Fullscreen API on the map card; in a Shell window it asks the host with `overlay.fullscreen` / `overlay.fullscreenExit` and follows `overlay.fullscreenChanged`); Track finds a title (`GET /library/search?q=&limit=8`), lights it, opens its card and zooms the map to it about 4x; Fresh (added in the last N days, default 42), Never heard (no plays) and Most played (at least N plays, default 10) each light one DSL query (`GET /library/search?q=&dsl=true`, paged) with a number box beside the selector for N - Fresh sends an absolute date (`added:>YYYY-MM-DD`), computed in the page; Playlist lights any MusicBee playlist picked by name, auto playlists included, so a MusicBee "Top 25 Most Played" is an exact top N (`GET /playlists`, `GET /playlists/{url}/files`, a CUE set counted once per file); these four zoom the map to fit what they lit, at no more than 4x; the Ring slice keeps a seeded ring lit and the note counts how many picks since the seed fell inside it, a click on a star for title and artist with Play now / Play next and a Ring slider that is the orbit's inner radius in V/A units (0.01-0.30; the readout is `r 0.05 · N tracks`, a live count of the band) and a Seed a station button that seeds from that band, nearest first, at most 100, the picked track always first - then `POST /autoq/stations` and `POST /autoq/stations/{id}/play`, so it creates AND starts; around the seed the map draws three rings with live counts and knobs, taps open a ring drawer (titles via `POST /library/files/batch`), rings and tracks assemble into a list that Plays (one ring = a seeded run, several entries = `POST /autoq/programs/play`), Queues, or Saves as a ring station or a program, the radio's trail from `/autoq/radio` `recentlyPlayed` (only while the radio runs) and the next five queued as a path ahead. Zooming in adds detail by how many lit stars the view holds (600 / 200 / 40; the whole map adds none): the mood or genre that owns each part of the view, then an artist's name where neighboring stars share it, then each star's title with its artist beneath. The map data carries no names, so titles and artists are read with `POST /library/files/batch` for the stars in view only (200 at most, one request at a time, a quarter second after the view settles, kept for the life of the page; an open ring drawer's own read serves both). A mouse or pen resting on a star tags it `Artist - Title`; touch is unchanged. The count line under the map reads ` of in view` when the zoom hides some lit stars, with the level's word once its names are on the map. `?view=library` opens straight into it - the Music Map charm uses that, in the overlay and in a browser. - `builder.html` - Stage-then-Apply queue building. `GET /library/search?q=` (flat `data.tracks`; minimum query length 2, mirroring the server's own `QUERY_TOO_SHORT` gate) feeds a results list with a `+ Stage` verb per row; staging is local, and Apply posts the whole stage as ONE `POST /queue/add {position:"last", urls:[...]}`. Apply is the only queue-write verb. Clear empties the stage only (two-tap armed), Reload is user-driven, there is no auto-refresh anywhere, and the queue below is read-only with a current-row pill. - `stations.html` - Saved stations. Flow + seed count per row, Play (`POST /autoq/stations/{id}/play`), inline rename (Enter commits `PUT {name}`; Escape and blur revert), two-tap-armed `DELETE`, and "Save current run" (`POST /autoq/stations/from-run {name}`). There is no name-only create button: `POST /autoq/stations` requires `seedUrls`, a journey or a ring. - `programs.html` - Saved programs, i.e. sequences of stations. Entry count per row, Play (`POST /autoq/programs/{id}/play`), inline rename (`PUT {name}`), two-tap-armed `DELETE`. Management only - `POST /autoq/programs` requires at least one entry (a saved station that resolves, a ring, or a track url), so programs are created elsewhere - the music map's list, or the Workbench - and managed here. - `GET /pages/stations.html` - Saved AutoQ stations, listed and started. Rows show flow, seed count, genre-free flag and creation date; tapping one calls `POST /autoq/stations/{id}/play`. Header carries AutoQ's own enabled/mode state, since starting a station turns AutoQ on. List-and-start only - rename, genre-free and delete are on the radio strip's stations menu, and creating a station is a Workbench verb. Charm id `stations`; opened from the HUD Services row or as its own charm window - `GET /pages/mixer.html` - Unified fader mixing surface: three independent faders for Player (MusicBee), Device (Windows audio), and Endpoint (network speaker) volume. Configurable default fader, mute controls, endpoint source selection. Charm bar integration via postMessage. OUTPUT PICKER: one chooser for where the sound goes - `Speakers` (always first and always present: it is the way back), `This device` (Listen Here, offered only when streaming is available), then each configured endpoint by name. Picking an endpoint stores `mixer.defaultEndpointId` (`PUT /mixer/settings`), and the endpoint strip names the endpoint the fader actually acts on. Picking `This device` depends on where the page is running. STANDALONE (its own Charm Bar window) the page holds the audio itself, through the same Listen Here component as play.html and the HUD, reading the room position at the moment of the hand-off. FRAMED (inline on the dashboard, in the HUD's charm frame, or in play.html) the `