Skip to content

API overview

This is a useful resource when you are creating a self-hosted Audioland server - to check it, script against it or understand what the desktop app does. It is an orientation, not an endpoint catalog: the audited source names three endpoints exactly, and this page does the same instead of inventing paths. The maintained, per-request reference is the Bruno collection in the server repository.

Everything is plain HTTP REST with JSON bodies, served by the Axum backend on the port from your config - 3000 by default. It is the only protocol in the system: no WebSocket, gRPC or message queue was found in either repository. The desktop app and the player core are just clients of the same API you can call.

  • Logging in issues a pair of tokens: an access token signed HMAC-SHA256 with the [auth] secret from your config, and a refresh token that the server stores hashed (in the login_tokens table). Passwords themselves are stored as Argon2 hashes.
  • Requests carry the access token in an Authorization: Bearer <token> header; the middleware falls back to an access_token cookie when the header is absent.
  • The desktop client refreshes tokens automatically when a request comes back unauthorized - see the Troubleshooting entry on broken logins.
  • User creation is the one endpoint the source names here: POST /api/auth/create-user, gated by the configured master_password. The account-creation paths are covered in Create your account.

Changing auth.secret invalidates every token signed with the old one, so expect all sessions to break after a rotation.

The API is organized by resource, one handler module per resource under backend/src/api/ in the server repository:

Resource What the audited source confirms it does
health GET /api/health - the verification endpoint, called directly by Run the server
auth login and token issue/validate; user creation gated by the master password
albums album browsing, with filters by artist, genre, year and release type, and batch cover retrieval
artists artist listings and detail
tracks track data; lyrics are served from the file path stored on the track (tracks.lyrics_path)
search full-text search over the indexed library (an SQLite FTS5 table)
stream audio delivery with quality selection - detailed below
playlists create, read, update and delete; track reorder; cover photo upload
favorites favorited tracks and albums
history play history
users user management

Beyond the three endpoint paths the source states exactly - GET /api/health, POST /api/auth/create-user and GET /api/stream/{track_id} - it describes routes at this resource level, not path by path. For exact paths, methods and request bodies, use the Bruno collection in the server repository, under api/Audioland API/, organized by resource.

GET /api/stream/{track_id}?quality=source|low|medium|high
  • source returns the original music file untouched.
  • low, medium and high return Opus audio at 128k, 192k and 256k, transcoded from the original file by ffmpeg and cached on disk under scanner.cache_root - the first request at a quality does the work, later ones read the cache.

With a server running on its default address:

Terminal window
curl http://127.0.0.1:3000/api/health

That is the health check Run the server uses to verify a fresh install. From there, everything else needs a token - log in through the desktop app first, or explore the Bruno collection against your own server.