← API Reference

Playlist

POST
https://api.audioscape.ai/developer/v1/playlist

Endpoint

Fetch playlists configured in the Configure tab. Use this endpoint to list all playlists for your API key, or fetch a specific playlist with its ordered tracks for playback in your game.

Headers

NameTypeDescription
x-api-keyrequiredYour API key
Content-TyperequiredMust be application/json
X-Universe-IdoptionalRoblox Universe ID (sent automatically by SDK)
X-Place-IdoptionalRoblox Place ID
X-Player-IdoptionalPlayer ID for per-player analytics

Request Body

This endpoint supports two modes depending on the request body:

Get Playlist

Pass a playlist_id to fetch a specific playlist and its tracks.

FieldTypeDescription
playlist_idstring, requiredThe playlist ID (e.g. station-electronic-1712...)

List Playlists

Pass {"action": "list"} to list all playlists for your API key.

FieldTypeDescription
actionstring, requiredMust be "list"

Get Playlist Response

200 OK
{
  "playlist": {
    "id": "station-electronic-1712...",
    "name": "Electronic",
    "genre": "electronic",
    "playback_mode": "shuffle",
    "track_count": 25
  },
  "tracks": [
    {
      "asset_id": "123456789",
      "name": "Midnight Drive",
      "artist": "Neon Pulse",
      "album": "Synthwave Dreams",
      "genre": "electronic",
      "duration": 195,
      "bpm": 128,
      "position": 1,
      "created_at": "2024-01-15T...",
      "updated_at": "2024-01-15T..."
    }
  ],
  "meta": { "total": 25 }
}

List Playlists Response

200 OK
{
  "playlists": [
    {
      "id": "station-electronic-1712...",
      "name": "Electronic",
      "genre": "electronic",
      "track_count": 25,
      "playback_mode": "shuffle"
    }
  ],
  "meta": { "total": 1 }
}

Example

Using the Luau SDK to fetch and play a playlist:

Luau
-- List all playlists
local list, err = client:listPlaylists()

-- Fetch a specific playlist
local result, err = client:getPlaylist({
    playlist_id = "station-electronic-1712...",
})

if result then
    print(result.playlist.name, "—", #result.tracks, "tracks")

    for _, track in result.tracks do
        local sound = Instance.new("Sound")
        sound.SoundId = "rbxassetid://" .. track.asset_id
        sound:Play()
    end
end

Errors

StatusDescription
400Missing or invalid playlist_id
401Invalid or missing API key
404Playlist not found (wrong ID or belongs to a different API key)
429Rate limit exceeded
500Internal server error