playlists > loadPlaylist

The loadPlaylist command in the playlists namespace activates a playlist within the default playback session. This command interrupts any active private playback sessions. Sonos adds tracks from the playlist to the queue and activates the queue. This prevents your app from overwriting user-curated queues.


Endpoint

POST


Request parameters

This command requires a groupId to determine the target of the command. See the Control documentation for details.

See the table below for descriptions of parameters in the body.

Parameter Type Value
action queueAction (Optional) Controls how the the player inserts the playlist into the shared queue, such as append, insert, insert next, or replace. If omitted, defaults to append.
playlistId string The identifier of the playlist. You can find this in the playlistsList object in the getPlaylists response.
playOnCompletion boolean (Optional) If true, the player automatically starts playback. If false or not provided, the player remains in the PLAYBACK_IDLE state.
playModes playModes (Optional) Defines the functionality of one or more play modes. You can set these to customize shuffle, repeat, repeat-one and crossfade.

Response

Returns an empty body with a success value of true if successful.

In the event of a failure, returns a globalError.


Example

Request

Response