Create a playlist for a Spotify user. The playlist will be empty until you add tracks.
create_playlist(
user_id,
name,
public = TRUE,
collaborative = FALSE,
description = NULL,
authorization = get_spotify_authorization_code()
)
The response from the Spotify Web API on the POST
request, with a meaningful
error message if the operation was not successful.
Required. The user's Spotify user ID.
Required. String containing the name for the new playlist, for example "Your Coolest Playlist"
. This name does not need to be unique; a user may have several playlists with the same name.
Optional. Boolean. Defaults to TRUE
. If TRUE
the playlist will be public. If FALSE
it will be private. To be able to create private playlists, the user must have granted the playlist-modify-private
scope
Optional. Boolean. Defaults to FALSE
. If TRUE
the playlist will be collaborative. Note that to create a collaborative playlist you must also set public
to FALES
. To create collaborative playlists you must have granted playlist-modify-private
and playlist-modify-public
scopes.
Optional. String containing the playlist description as displayed in Spotify Clients and in the Web API.
Required. A valid access token from the Spotify Accounts service. See the Web API authorization Guide for more details. Defaults to spotifyr::get_spotify_authorization_code()
. The access token must have been issued on behalf of the current user.
Creating a public playlist for a user requires authorization of the playlist-modify-public
scope; creating a private playlist requires the playlist-modify-private
scope. See Using Scopes.
Other playlist functions:
add_tracks_to_playlist()
,
change_playlist_details()
,
check_users_following()
,
get_my_playlists()
,
get_playlist()
,
get_user_playlists()
,
remove_tracks_from_playlist()
,
tidy()