Skip to content
DocumentationAPI Reference

Add Custom Playlist Cover Image

client.Playlists.Images.Update(ctx, playlistID, body) (*Response, error)
PUT/playlists/{playlist_id}/images

Replace the image used to represent a specific playlist.

ParametersExpand Collapse
playlistID string

The Spotify ID of the playlist.

body Reader

Base64 encoded JPEG image data, maximum payload size is 256 KB.

formatbinary
ReturnsExpand Collapse
type PlaylistImageUpdateResponse interface{…}

Add Custom Playlist Cover Image

package main

import (
  "bytes"
  "context"
  "fmt"
  "io"

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

func main() {
  client := spotted.NewClient(
    option.WithAccessToken("My Access Token"),
  )
  image, err := client.Playlists.Images.Update(
    context.TODO(),
    "3cEYpjA9oz9GiPac4AsH4n",
    io.Reader(bytes.NewBuffer([]byte("some file contents"))),
  )
  if err != nil {
    panic(err.Error())
  }
  fmt.Printf("%+v\n", image)
}
Returns Examples