The Supernova backend exposes a lightweight, strictly-typed JSON REST API.
http://localhost:8080
POST /api/auth/register accepts username, password, and invite_code. The first account is administrator; subsequent accounts require REGISTRATION_INVITE_CODE. POST /api/auth/login returns a bearer token. Send Authorization: Bearer <token> to private routes. GET /api/auth/me returns the current user and is_admin. Maintenance runs and library scanning require administrator access.
GET /api/albums?limit=50&offset=0
Returns a paginated list of albums in the library.
GET /api/albums/{id}
Returns a specific album's metadata.
GET /api/tracks?album_id={id}&limit=50&offset=0
Returns all tracks for a specific album.
GET /api/artists?limit=50&offset=0
Returns all artists in the database.
GET /api/stream/{id}?format={format}&bitrate={bitrate}&time={seconds}
Streams the raw audio file natively using HTTP Range requests.
- Query Params (Optional for Transcoding):
format:mp3,aac,ogg,opusbitrate: e.g.,128,320time: Offset in seconds for fast seeking (e.g.,60)
GET /api/art/album/{id}
Returns the raw binary image (JPEG/PNG) of the album art. Implements ETag caching.
GET /api/hearts
Returns a list of all favorited tracks and albums (Database UUIDs).
POST /api/hearts
Body:
{
"entity_type": "track", // or "album"
"entity_id": "uuid-here"
}DELETE /api/hearts?entity_type={type}&entity_id={id}
Removes a favorite.
GET /api/hearts/export
Generates and downloads a JSON file containing permanent file_path mappings for all hearts, safe against database rebuilds.
POST /api/hearts/import
Body: JSON output from /api/hearts/export.
POST /api/scrobbles
Body:
{
"track_id": "uuid-here"
}GET /api/scrobbles/recent
Returns the 20 most recently listened tracks.