Skip to content
DocumentationAPI Reference

Remove Playlist Items

client.Playlists.Tracks.Remove(ctx, playlistID, body) (*PlaylistTrackRemoveResponse, error)
DELETE/playlists/{playlist_id}/tracks

Remove one or more items from a user's playlist.

ParametersExpand Collapse
playlistID string

The Spotify ID of the playlist.

body PlaylistTrackRemoveParams
Tracks param.Field[[]PlaylistTrackRemoveParamsTrack]

An array of objects containing Spotify URIs of the tracks or episodes to remove. For example: { "tracks": [{ "uri": "spotify:track:4iV5W9uYEdYUVa79Axb7Rh" },{ "uri": "spotify:track:1301WleyT98MSxVHPZCA6M" }] }. A maximum of 100 objects can be sent at once.

Uri stringoptional

Spotify URI

Published param.Field[bool]optional

The playlist's public/private status (if it should be added to the user's profile or not): true the playlist will be public, false the playlist will be private, null the playlist status is not relevant. For more about public/private status, see Working with Playlists

SnapshotID param.Field[string]optional

The playlist's snapshot ID against which you want to make the changes. The API will validate that the specified items exist and in the specified positions and make the changes, even if more recent changes have been made to the playlist.

ReturnsExpand Collapse
type PlaylistTrackRemoveResponse struct{…}
SnapshotID stringoptional

Remove Playlist Items

package main

import (
  "context"
  "fmt"

  "github.com/cjavdev/spotted-go"
  "github.com/cjavdev/spotted-go/option"
)

func main() {
  client := spotted.NewClient(
    option.WithAccessToken("My Access Token"),
  )
  track, err := client.Playlists.Tracks.Remove(
    context.TODO(),
    "3cEYpjA9oz9GiPac4AsH4n",
    spotted.PlaylistTrackRemoveParams{
      Tracks: []spotted.PlaylistTrackRemoveParamsTrack{spotted.PlaylistTrackRemoveParamsTrack{

      }},
    },
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", track.SnapshotID)
}
{
  "snapshot_id": "abc"
}
Returns Examples
{
  "snapshot_id": "abc"
}