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/play

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.

Query Parameters

Query Parameter Value
device_id Optional. The id of the device this command is targeting. If not supplied, the user’s currently active device is the target.

Body Parameters

Request Body Data Value Type Value
context_uri string Optional. Spotify URI of the context to play. Valid contexts are albums, artists, playlists. Example: {"context_uri": "spotify:album:1Je1IMUlBXcx1Fz0WE7oPT"}
uris Array of URIs Optional. A JSON array of the Spotify track URIs to play. For example: {"uris": ["spotify:track:4iV5W9uYEdYUVa79Axb7Rh", "spotify:track:1301WleyT98MSxVHPZCA6M"]}
offset Object Optional. Indicates from where in the context playback should start. Only available when context_uri corresponds to an album or playlist object, or when the uris parameter is used.
“position” is zero based and can’t be negative. Example: "offset": {"position": 5}
“uri” is a string representing the uri of the item to start at. Example: "offset": {"uri": "spotify:track:1301WleyT98MSxVHPZCA6M"}
position_ms integer Optional. Indicates from what position to start playback. Must be a positive number. Passing in a position that is greater than the length of the track will cause the player to start playing the next song.

Only one of either context_uri or uris can be specified. If neither is present, calling /play will resume playback. If both are present the request will return 400 BAD REQUEST.

If context_uri is a Playlist or Album, or when uris is provided, then offset can be added to specify starting track in the context.

If the provided context_uri corresponds to an album or playlist object, an offset can be specified either by track uri OR position. If both are present the request will return 400 BAD REQUEST. If incorrect values are provided for position or uri, the request may be accepted but with an unpredictable resulting action on playback.

Response Format

A completed request will return a 204 NO CONTENT response code, and then issue the command to the player. Due to the asynchronous nature of the issuance of the command, you should use the Get Information About The User’s Current Playback endpoint to check that your issued command was handled correctly by the player. 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

curl -X PUT "https://api.spotify.com/v1/me/player/play" -H "Authorization: Bearer {your access token}"

Try it