Announcements

Help Wizard

Step 1

NEXT STEP

Remove Playlist Items API fails for recently added tracks

Remove Playlist Items API fails for recently added tracks

Hi Spotify Developer Community, I'm experiencing an issue with the Remove Playlist Items API endpoint (DELETE /v1/playlists/{playlist_id}/tracks) where removing tracks fails when the tracks have been added recently to the playlist.

Problem Description:

  • When I try to delete tracks that were recently added to a playlist, the API request fails
  • This happens regardless of whether I include the snapshot_id parameter or not
  • Older tracks in the same playlist can be deleted without issues
  • The error occurs specifically with tracks that were added after I initially loaded the playlist

Code Example:

// This fails for recently added tracks
const response = await spotifyApi.delete(`playlists/${playlistId}/tracks`, {
data: {
tracks: [{ uri: "spotify:track:trackId" }],
snapshot_id: currentSnapshotId
}
});
 
What I've Tried:
  • Including/excluding the snapshot_id parameter
  • Refreshing the playlist data before attempting deletion
  • Different timing approaches (waiting before deletion)

Expected Behavior:

  • Should be able to remove any track from a playlist, regardless of when it was added
  • The API should work consistently for all tracks in a playlist

Environment:

  • Using Spotify Web API v1
  • Authorization: Authorization Code with PKCE
  • Scopes: playlist-modify-publicplaylist-modify-private

Has anyone else encountered this issue? Any suggestions or workarounds would be greatly appreciated! Thanks!

Reply
0 Replies

Suggested posts

Let's introduce ourselves!

Hey there you,   Yeah, you! 😁   Welcome - we're glad you joined the Spotify Community!   While you here, let's have a fun game and get…

ModeratorStaff / Moderator/ 4 years ago  in Social & Random