{"openapi":"3.1.0","info":{"title":"Music API","version":"1.0.0","description":"Jamendo catalogue behind a local SQLite mirror with response and on-disk audio caching."},"servers":[{"url":"https://music.cloudrx.cyou"}],"tags":[{"name":"Catalog","description":"Read-only browsing and search over the Jamendo catalogue, normalised to a single track shape."},{"name":"Media","description":"Audio, artwork and radio. Streaming supports Range, so the player can seek without downloading the whole file."},{"name":"Account","description":"Email accounts and device-bound guest sessions. Everything except register, login and guest needs a bearer token."},{"name":"Library","description":"Favourites, history and playlists stored in the local SQLite database. Every route here needs a bearer token."},{"name":"Operations","description":"Health, counters and maintenance."}],"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/v1/home":{"get":{"tags":["Catalog"],"summary":"Everything the home screen needs, in one call","description":"Trending this week, newest releases, a chillout shelf, the genre list and the radios, fetched in parallel. When one of the four upstream calls fails the answer is still 200 with partial: true, and that variant is cached for 2 minutes instead of 30.","operationId":"home","parameters":[],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}}},"/v1/genres":{"get":{"tags":["Catalog"],"summary":"Curated genre tags, optionally with artwork","operationId":"genres","parameters":[{"name":"covers","in":"query","required":false,"schema":{"type":"boolean","description":"1 or true also resolves a cover per genre (slower, cached 7 days)"}}],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}}},"/v1/tracks":{"get":{"tags":["Catalog"],"summary":"Browse and search tracks","description":"Every filter maps to a Jamendo parameter. Up to 4 tags combine with + or a comma. Tracks carry musicinfo tags, so genre chips render without a second call.","operationId":"tracks","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","description":"1-100, default 20"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","description":"default 0"}},{"name":"order","in":"query","required":false,"schema":{"type":"string","enum":["popularity_total","popularity_month","popularity_week","releasedate_desc","releasedate_asc","downloads_total","downloads_month","downloads_week","listens_total","listens_month","listens_week","name","random"],"description":"default popularity_week, or popularity_total when q is set"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","description":"name search, max 100 characters"}},{"name":"tag","in":"query","required":false,"schema":{"type":"string","description":"fuzzy tag filter, up to 4 joined with + (alias: tags)"}},{"name":"artistId","in":"query","required":false,"schema":{"type":"string","description":"tracks of one artist"}},{"name":"albumId","in":"query","required":false,"schema":{"type":"string","description":"tracks of one album"}},{"name":"ids","in":"query","required":false,"schema":{"type":"string","description":"comma separated track ids, max 50"}},{"name":"featured","in":"query","required":false,"schema":{"type":"boolean","description":"true keeps featured tracks, false excludes them"}},{"name":"vocalinstrumental","in":"query","required":false,"schema":{"type":"string","enum":["vocal","instrumental"]}},{"name":"speed","in":"query","required":false,"schema":{"type":"string","enum":["verylow","low","medium","high","veryhigh"]}},{"name":"gender","in":"query","required":false,"schema":{"type":"string","enum":["male","female"]}},{"name":"durationMin","in":"query","required":false,"schema":{"type":"integer","description":"seconds, needs durationMax too"}},{"name":"durationMax","in":"query","required":false,"schema":{"type":"integer","description":"seconds, must exceed durationMin"}}],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}}},"/v1/tracks/{id}":{"get":{"tags":["Catalog"],"summary":"Track detail","description":"Answered from the local SQLite mirror when that row already carries tags, otherwise refreshed from Jamendo and cached for 6 hours.","operationId":"track","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"waveform","in":"query","required":false,"schema":{"type":"boolean","description":"1 or true adds the waveform peaks array"}}],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}}},"/v1/tracks/{id}/similar":{"get":{"tags":["Catalog"],"summary":"Related tracks","description":"Seeds on the track genres, tops up from the same artists, then from the weekly chart, so the list is rarely empty.","operationId":"similar","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","description":"1-50, default 20"}}],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}}},"/v1/albums":{"get":{"tags":["Catalog"],"summary":"Browse albums","operationId":"albums","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","description":"1-100, default 20"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","description":"default 0"}},{"name":"order","in":"query","required":false,"schema":{"type":"string","enum":["popularity_total","popularity_month","popularity_week","releasedate_desc","releasedate_asc","downloads_total","downloads_month","downloads_week","listens_total","listens_month","listens_week","name","random"],"description":"default popularity_month"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","description":"name search"}},{"name":"artistId","in":"query","required":false,"schema":{"type":"string","description":"albums of one artist"}},{"name":"ids","in":"query","required":false,"schema":{"type":"string","description":"comma separated album ids, max 50"}}],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}}},"/v1/albums/{id}":{"get":{"tags":["Catalog"],"summary":"Album with its track list","operationId":"album","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"tracks","in":"query","required":false,"schema":{"type":"boolean","description":"0 or false skips the track list"}}],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}}},"/v1/artists":{"get":{"tags":["Catalog"],"summary":"Browse artists","operationId":"artists","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","description":"1-100, default 20"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","description":"default 0"}},{"name":"order","in":"query","required":false,"schema":{"type":"string","enum":["popularity_total","popularity_month","popularity_week","releasedate_desc","releasedate_asc","downloads_total","downloads_month","downloads_week","listens_total","listens_month","listens_week","name","random"],"description":"default popularity_month"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","description":"name search"}}],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}}},"/v1/artists/{id}":{"get":{"tags":["Catalog"],"summary":"Artist detail","operationId":"artist","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}}},"/v1/artists/{id}/tracks":{"get":{"tags":["Catalog"],"summary":"Tracks of one artist","description":"Jamendo ignores limit and offset here and returns an empty page for any non-zero offset, so the whole collection is fetched once, cached, and paged locally.","operationId":"artist-tracks","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","description":"1-100, default 20"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","description":"default 0"}}],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}}},"/v1/artists/{id}/albums":{"get":{"tags":["Catalog"],"summary":"Albums of one artist","description":"Same local paging as artist tracks.","operationId":"artist-albums","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","description":"1-100, default 20"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","description":"default 0"}}],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}}},"/v1/playlists":{"get":{"tags":["Catalog"],"summary":"Jamendo curated playlists","operationId":"playlists","parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","description":"1-100, default 20"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","description":"default 0"}},{"name":"order","in":"query","required":false,"schema":{"type":"string","enum":["name","id","creationdate"],"description":"default creationdate; anything else is rejected upstream"}},{"name":"q","in":"query","required":false,"schema":{"type":"string","description":"name search"}},{"name":"userId","in":"query","required":false,"schema":{"type":"string","description":"playlists of one Jamendo user"}}],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}}},"/v1/playlists/{id}":{"get":{"tags":["Catalog"],"summary":"Playlist with its tracks","operationId":"playlist","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","description":"1-100, default 100"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","description":"default 0"}}],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}}},"/v1/radios":{"get":{"tags":["Catalog"],"summary":"Jamendo radios","operationId":"radios","parameters":[],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}}},"/v1/radios/{id}":{"get":{"tags":["Catalog"],"summary":"Radio detail with the upstream stream URL","operationId":"radio","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}}},"/v1/feeds":{"get":{"tags":["Catalog"],"summary":"Jamendo news feed","operationId":"feeds","parameters":[],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}}},"/v1/autocomplete":{"get":{"tags":["Catalog"],"summary":"Search suggestions while typing","description":"Jamendo answers with an object of four arrays; they are passed through unchanged.","operationId":"autocomplete","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","description":"required, max 60"}}],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}}},"/v1/search":{"get":{"tags":["Catalog"],"summary":"Search tracks, albums and artists at once","operationId":"search","parameters":[{"name":"q","in":"query","required":false,"schema":{"type":"string","description":"required, max 100"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","description":"per section, 1-50, default 10"}},{"name":"type","in":"query","required":false,"schema":{"type":"string","enum":["all","tracks","albums","artists"],"description":"default all"}}],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}}},"/v1/stream/{id}":{"get":{"tags":["Media"],"summary":"Audio stream with Range support","description":"Proxied on the first play, then served from disk. Send a Range header to seek: the answer is 206 with Content-Range. X-Cache is MISS on the first hit and HIT once the file is stored, X-Audio-Format names the format actually served. Jamendo signed URLs expire and some tracks lack the requested format, so the server walks mp32 to mp31 to ogg before giving up; a track with no playable file answers 502 upstream_error.","operationId":"stream","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"quality","in":"query","required":false,"schema":{"type":"string","enum":["mp32","mp31","ogg","flac"],"description":"default mp32 (128k mp3)"}},{"name":"Range","in":"header","required":true,"description":"optional, single range only","schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}}},"/v1/download/{id}":{"get":{"tags":["Media"],"summary":"Download the file as an attachment","description":"Honours the track licence: when downloads are not allowed the answer is 404. The filename is \"Artist - Title.mp3\".","operationId":"download","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"quality","in":"query","required":false,"schema":{"type":"string","enum":["mp32","mp31","ogg","flac"],"description":"default mp32"}}],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}}},"/v1/radios/{id}/stream":{"get":{"tags":["Media"],"summary":"Live radio passthrough","description":"Streams the upstream ICY feed unchanged with Cache-Control: no-store.","operationId":"radio-stream","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}}},"/v1/img":{"get":{"tags":["Media"],"summary":"Cached artwork proxy","description":"Only the Jamendo artwork hosts are allowed (usercontent.jamendo.com, images.jamendo.com, img.jamendo.com), https only, no credentials in the URL. Files live on disk for 60 days and are answered with a strong ETag, so repeat requests get 304.","operationId":"img","parameters":[{"name":"u","in":"query","required":false,"schema":{"type":"string","description":"required, the source image URL, URL-encoded"}}],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}}},"/v1/cover/{albumId}":{"get":{"tags":["Media"],"summary":"Album cover shortcut","description":"Same cache as /v1/img, without having to build the artwork URL.","operationId":"cover","parameters":[{"name":"albumId","in":"path","required":true,"schema":{"type":"string"}},{"name":"size","in":"query","required":false,"schema":{"type":"string","enum":[50,100,200,300,400,500,600,700,800,1000,1500,2000],"description":"width in pixels, default 300"}}],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}}},"/v1/auth/register":{"post":{"tags":["Account"],"summary":"Create an email account","operationId":"register","parameters":[],"responses":{"201":{"description":"Success"},"default":{"description":"Error envelope"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","description":"a valid address"},"password":{"type":"string","description":"at least 8 characters"},"name":{"type":"string","description":"defaults to the email local part, max 60"}},"required":["email","password"]}}}}}},"/v1/auth/login":{"post":{"tags":["Account"],"summary":"Sign in","operationId":"login","parameters":[],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"password":{"type":"string"}},"required":["email","password"]}}}}}},"/v1/auth/guest":{"post":{"tags":["Account"],"summary":"Guest session bound to a device id","description":"Call it on first launch with a stable device id: the same id always returns the same guest account, so the library survives app restarts. Letters, digits, dot, underscore, colon and dash are allowed, 8 to 128 characters.","operationId":"guest","parameters":[],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"deviceId":{"type":"string","description":"stable per install"},"name":{"type":"string","description":"defaults to Guest"}},"required":["deviceId"]}}}}}},"/v1/auth/me":{"get":{"tags":["Account"],"summary":"The signed-in user","operationId":"auth-me","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}},"patch":{"tags":["Account"],"summary":"Rename the account","operationId":"auth-me-patch","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"max 60"}},"required":["name"]}}}}}},"/v1/auth/logout":{"post":{"tags":["Account"],"summary":"Log out everywhere","description":"Bumps the token version, so every token issued before this call stops working. Local caches should be cleared on the client.","operationId":"logout","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}}},"/v1/me/":{"get":{"tags":["Library"],"summary":"Profile plus library counts","operationId":"me","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}}},"/v1/me/favorites":{"get":{"tags":["Library"],"summary":"Favourite tracks, newest first","operationId":"favorites","security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","description":"1-100, default 20"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","description":"default 0"}}],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}},"post":{"tags":["Library"],"summary":"Add a favourite","operationId":"favorite-add","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"201":{"description":"Success"},"default":{"description":"Error envelope"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"trackId":{"type":"string"}},"required":["trackId"]}}}}}},"/v1/me/favorites/{trackId}":{"put":{"tags":["Library"],"summary":"Idempotent favourite","description":"Same effect as POST but safe to repeat, which suits optimistic UI.","operationId":"favorite-put","security":[{"bearerAuth":[]}],"parameters":[{"name":"trackId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}},"delete":{"tags":["Library"],"summary":"Remove a favourite","operationId":"favorite-delete","security":[{"bearerAuth":[]}],"parameters":[{"name":"trackId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}}},"/v1/me/history":{"get":{"tags":["Library"],"summary":"Listening history grouped by track","operationId":"history","security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","description":"1-100, default 20"}},{"name":"offset","in":"query","required":false,"schema":{"type":"integer","description":"default 0"}}],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}},"delete":{"tags":["Library"],"summary":"Clear the history","operationId":"history-clear","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}}},"/v1/me/plays":{"post":{"tags":["Library"],"summary":"Record a play","description":"Send it when playback ends or passes 30 seconds, whichever policy you pick. Rows older than 180 days are pruned automatically.","operationId":"plays","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"201":{"description":"Success"},"default":{"description":"Error envelope"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"trackId":{"type":"string"},"ms":{"type":"integer","description":"played milliseconds, 0 to 86400000"}},"required":["trackId"]}}}}}},"/v1/me/playlists":{"get":{"tags":["Library"],"summary":"Your playlists","operationId":"my-playlists","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}},"post":{"tags":["Library"],"summary":"Create a playlist","operationId":"my-playlist-create","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"201":{"description":"Success"},"default":{"description":"Error envelope"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"max 80"}},"required":["name"]}}}}}},"/v1/me/playlists/{id}":{"get":{"tags":["Library"],"summary":"Playlist with tracks in order","operationId":"my-playlist","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}},"patch":{"tags":["Library"],"summary":"Rename a playlist","operationId":"my-playlist-rename","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","description":"max 80"}},"required":["name"]}}}}},"delete":{"tags":["Library"],"summary":"Delete a playlist","operationId":"my-playlist-delete","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}}},"/v1/me/playlists/{id}/tracks":{"post":{"tags":["Library"],"summary":"Append a track","operationId":"my-playlist-add","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"201":{"description":"Success"},"default":{"description":"Error envelope"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"trackId":{"type":"string"}},"required":["trackId"]}}}}},"put":{"tags":["Library"],"summary":"Replace the track order","description":"Send the whole list: positions become 1..n in the order given. Up to 500 tracks.","operationId":"my-playlist-reorder","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"trackIds":{"type":"array","items":{"type":"string"},"description":"array of track ids"}},"required":["trackIds"]}}}}}},"/v1/me/playlists/{id}/tracks/{trackId}":{"delete":{"tags":["Library"],"summary":"Remove a track","operationId":"my-playlist-remove","security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"trackId","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}}},"/v1/me/recommendations":{"get":{"tags":["Library"],"summary":"Personal shelf","description":"Builds a tag profile from favourites and recent plays, pulls matching tracks, tops up from the same artists, then from the weekly chart. Cached 20 minutes per user.","operationId":"recommendations","security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"schema":{"type":"integer","description":"1-50, default 20"}}],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}}},"/health":{"get":{"tags":["Operations"],"summary":"Liveness plus cache and upstream state","description":"Also served at /v1/health. The upstream is probed at most once a minute, so this stays cheap enough for a monitor.","operationId":"health","parameters":[],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}}},"/v1/stats":{"get":{"tags":["Operations"],"summary":"Cache, disk and catalog counters","operationId":"stats","parameters":[],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}}},"/v1/admin/prune":{"post":{"tags":["Operations"],"summary":"Force cache and disk eviction","description":"Requires the X-Admin-Token header to match ADMIN_TOKEN. Answers 403 when the variable is unset.","operationId":"prune","security":[{"bearerAuth":[]}],"parameters":[{"name":"X-Admin-Token","in":"header","required":true,"description":"required","schema":{"type":"string"}}],"responses":{"200":{"description":"Success"},"default":{"description":"Error envelope"}}}}}}