These endpoints are in Beta. While we encourage you to build with them, a situation may arise where we need to disable some or all of the functionality and/or change how they work without prior notice. Please report any issues via our GitHub issue tracker.

Endpoint

PUT https://api.spotify.com/v1/me/player

Request Parameters

Header Fields

Header Field Value
Authorization Required. A valid access token from the Spotify Accounts service: see the Web API Authorization Guide for details.
The access token must have been issued on behalf of a user.
The access token must have the user-modify-playback-state scope authorized in order to control playback.

Body Parameters

Request Body Data Value Type Value
device_ids Array of Spotify Device IDs Required. 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 boolean Optional.
true: ensure playback happens on new device.
false or not provided: keep the current playback state.

Note that a value of false for the play parameter when also transferring to another device_id will not pause playback. To ensure that playback is paused on the new device you should send a pause command to the currently active device before transferring to the new device_id.

Response Format

A successful request will return a 204 NO CONTENT response code. When the device is temporarily unavailable the request will return a 202 ACCEPTED response code and the client should retry the request after 5 seconds, but no more than at most 5 retries. If the device is not found, the request will return 404 NOT FOUND response code. If the user making the request is non-premium, a 403 FORBIDDEN response code will be returned.

Example

Note that cURL requires quotation marks within the JSON data to be escaped, for example. device_ids:[\"74ASZWbe4lXaubB36ztrGX\"].

curl -X PUT "https://api.spotify.com/v1/me/player" -H "Authorization: Bearer {your access token}" -H "Content-Type: application/json" --data "{device_ids:[\"74ASZWbe4lXaubB36ztrGX\"]}"

Try it