Skip to content
DocumentationAPI Reference

Transfer Playback

client.Me.Player.Transfer(ctx, body) error
PUT/me/player

Transfer playback to a new device and optionally begin playback. This API only works for users who have Spotify Premium. The order of execution is not guaranteed when you use this API with other Player API endpoints.

ParametersExpand Collapse
body MePlayerTransferParams
DeviceIDs param.Field[[]string]

A JSON array containing the ID of the device on which playback should be started/transferred.
For example:{device_ids:["74ASZWbe4lXaubB36ztrGX"]}
Note: Although an array is accepted, only a single device_id is currently supported. Supplying more than one will return 400 Bad Request

Play param.Field[bool]optional

true: ensure playback happens on new device.
false or not provided: keep the current playback state.

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

Transfer Playback

package main

import (
  "context"

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

func main() {
  client := spotted.NewClient(
    option.WithAccessToken("My Access Token"),
  )
  err := client.Me.Player.Transfer(context.TODO(), spotted.MePlayerTransferParams{
    DeviceIDs: []string{"74ASZWbe4lXaubB36ztrGX"},
  })
  if err != nil {
    panic(err.Error())
  }
}
Returns Examples