Skip to content
DocumentationAPI Reference

Transfer Playback

me().player().transfer(PlayerTransferParamsparams, RequestOptionsrequestOptions = RequestOptions.none())
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
params: PlayerTransferParams
deviceIds: List<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: Optional<Boolean>

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

published: Optional<Boolean>

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 dev.cjav.spotted.example

import dev.cjav.spotted.client.SpottedClient
import dev.cjav.spotted.client.okhttp.SpottedOkHttpClient
import dev.cjav.spotted.models.me.player.PlayerTransferParams

fun main() {
    val client: SpottedClient = SpottedOkHttpClient.fromEnv()

    val params: PlayerTransferParams = PlayerTransferParams.builder()
        .addDeviceId("74ASZWbe4lXaubB36ztrGX")
        .build()
    client.me().player().transfer(params)
}
Returns Examples