Reorder or Replace a Playlist's Items
Developing
PUT
/playlists/{playlist_id}/tracks
category-playlists
To reorder items, include
range_start
, insert_before
, range_length
and snapshot_id
in the request's body.To replace items, include
uris
as either a query parameter or in the request's body.Replacing items in a playlist will overwrite its existing items. This operation can be used for replacing or clearing items in a playlist.
These operations can't be applied together in a single request.
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request PUT 'https://api.spotify.com/v1/playlists//tracks' \
--header 'Authorization;' \
--header 'Content-Type: application/json' \
--data-raw '{
"insert_before": 0,
"range_length": 0,
"range_start": 0,
"snapshot_id": "string",
"uris": [
"string"
]
}'
Response Response Example
200 - Example 1
{
"snapshot_id": "string"
}
Request
Path Params
playlist_id
string
required
Query Params
uris
string
optional
uris=spotify:track:4iV5W9uYEdYUVa79Axb7Rh,spotify:track:1301WleyT98MSxVHPZCA6M,spotify:episode:512ojhOuo1ktJprKbVcKyQ
A maximum of 100 items can be set in one request.
Header Params
Authorization
string
required
Reordering or replacing items in the current user's public playlists requires authorization of the
playlist-modify-public
scope; reordering or replacing items in the current user's private playlist (including collaborative playlists) requires the playlist-modify-private
scope. See Using Scopes.Content-Type
string
optional
application/json
Body Params application/json
Responses
Modified at 2022-09-12 10:04:50