reorderClientPlaylistPlayables

suspend fun reorderClientPlaylistPlayables(playlist: String, reorderRangeStart: Int, reorderRangeLength: Int? = null, insertionPoint: Int, snapshotId: String? = null): PlaylistSnapshot(source)

Reorder a playable or a group of playables in a playlist.

When reordering playables, the timestamp indicating when they were added and the user who added them will be kept untouched. In addition, the users following the playlists won’t be notified about changes in the playlists when the playables are reordered.

Reordering playables in the current user’s public playlists requires authorization of the SpotifyScope.PlaylistModifyPublic scope; reordering playables in the current user’s private playlist (including collaborative playlists) requires the SpotifyScope.PlaylistModifyPrivate scope.

Api Reference

Parameters

playlist

The id or uri for the playlist.

reorderRangeStart

The position of the first playable to be reordered.

reorderRangeLength

The amount of playables to be reordered. Defaults to 1 if not set. The range of playables to be reordered begins from the range_start position, and includes the range_length subsequent playables. Example: To move the playables at index 9-10 to the start of the playlist, range_start is set to 9, and range_length is set to 2.

insertionPoint

The position where the playables should be inserted. To reorder the playables to the end of the playlist, simply set insert_before to the position after the last track.

snapshotId

the playlist snapshot against which to apply this action. recommended to have

Throws

if the playlist is not found or illegal filters are applied