Announcements

Help Wizard

Step 1

NEXT STEP

FAQs

Please see below the most popular frequently asked questions.

Loading article...

Loading faqs...

VIEW ALL

Ongoing Issues

Please see below the current ongoing issues which are under investigation.

Loading issue...

Loading ongoing issues...

VIEW ALL

Api to create a private playlist doesn't work

Solved!

Api to create a private playlist doesn't work

Plan

Premium

Country

US

 

Device

iPhone 13

Operating System

iOS 15

 

My Question or Issue

I'm hitting the API to create a playlist 

 

POST: "/users/\(userId)/playlists"

 

with isPublic=false and isCollaborative=false in the body. The playlist is created successfully but is public instead of private. The scopes I have authorized are [playlistModifyPublic and playlistModifyPrivate]

Reply
33 Replies

Same issue here, public=false creates a playlist that's not added to the user's profile, so it's not truly private just yet. public=true works as public+added to profile. Hope it either gets fixed or the docs get updated soon

This doc seems up to date: https://developer.spotify.com/documentation/web-api/concepts/playlists#public-private-and-collaborat...
Note the bold part:

Public, Private, and Collaborative Status

When creating or updating a playlist through the Spotify Web API, setting the attribute “public” to true will publish the playlist on the user’s profile, which means it will appear under “public playlists”. This will also make the playlist visible in search results.

A playlist created through the WebAPI will have the “public” attribute set to true by default and setting it to false does the opposite, it won’t be displayed on the user’s profile and won’t be visible through search results

Requests to these endpoints require different scopes depending on the status of this attribute, playlist-modify-public is required when setting it to true and playlist-modify-private when setting it to false. When creating a new playlist, the default value of the public attribute is true, which means unless this attribute is explicitly set to false, creating a playlist requires the playlist-modify-public scope.

Note that the public attribute does not refer to access control, modifying access is currently not possible through the WebAPI, so anyone with the link to the playlist can access it unless it’s made private through for instance the desktop client.

A playlist can also be made collaborative through the WebAPI, by setting the “collaborative” attribute to true. This means that anyone with the link can add to or remove a track from it. When creating a new playlist, the default value of the collaborative attribute is false

Note that this is slightly different from adding/removing collaborators, which is currently not possible through the WebAPI. You can read more about adding/removing collaborators here.

Furthermore, a playlist cannot have both the “collaborative” attribute and the “public” attribute set to true at the same time, so in order to set one of them to true the other must be set to false. Basically, a playlist cannot be both collaborative and published at the same time.


 

Same issue here. Just trying to bump this up so it gets fixed sometime soon

Hello everyone, 

is there any change or still a bug (I guess)? I am trying also to create private playlist, but I still got a public one.

Just stumbled upon this problem myself.

 

I am trying to create a private playlist and setting public to false seems to work when creating the playlist.

The playlist is not displayed on the profile in the Web App or the Desktop Client. However, it is still accessible using a direct link, so it's not actually a private playlist, just one that's not displayed on the profile, as described in the documentation .

 

So far so good.

 

However when getting the user's playlists using https://api.spotify.com/v1/me/playlists it lists the playlist as public.

Furthermore, after setting a playlist to public, setting them back to private has no effect at all. I've tried setting public to false using the https://api.spotify.com/v1/playlists/{playlist_id} endpoint but the playlist still stays displayed on the profile and the api still says public is true.

 

So it seems as though it is not even possible to hide a playlist from the user's profile once it's been made public, which to my understanding should be possible using the Web API.

 

would be nice to get some sort of feedback whether spotify even knows about this problem or are working on a fix

I'm seeing the same issue - strange behaviour when trying to switch a playlist from private to public and vice versa through the desktop app, and my private playlists are showing up with "public: true" via the "/me/playlists" endpoint, both through the API tester in the documentation and through my own app's requests.

However, through the "/playlists/{playlist_id}" endpoint, it correctly identifies a private playlist as private with "public: false".

Can I see your sample POST  to create a new playlist. I am following the documentation from Spotify documentation (https://developer.spotify.com/documentation/web-api/reference/create-playlist) and no playlist is being created.


POST  api.spotify.com/v1/users/{{user}}/playlists

 

With the following JSON in the Body:

 

 

{
"name": "Spotify List",
"description": "Post Create. Playlist",
"public": false
}

 

 

Hi Lugico,

 

Thanks for providing a clear explanation of the problem. We were able to reproduce the issue, and have now deployed a fix. It should now be possible to toggle the "added to profile" / "removed from profile" by passing public true / false in the request.

 

Also thanks to thomas-ngrlt for helping explain the difference between private/public in Web API, and private/public in the app. When public was introduced in the Web API, it was using the same language as the app. Since then the app moved to calling it "add to profile" / "remove from profile", and repurposed public to mean something else for playlists (public/private). This is obviously creating a lot of confusion about what it means now. There is some additional information in the /get-playlist documentation for the field, but not in the /change-playlist-details. We will see about adding it there as well to help clear up some confusion.

 

LambertSpot_0-1718104662624.png

 

Would it be possible to have the option to toggle the real public/private flag of a playlist with the API ? Same as in the app, private being a playlist only accessible by it’s owner.

@thomas-ngrlt, not at the moment.

XimzendSpotify Star
Help others find this answer and click "Accept as Solution".
If you appreciate my answer, maybe give me a Like.
Note: I'm not a Spotify employee.

Same issue, any plan to fix it?

Hello everyone,

I can confirm the described issue. In my Python project, I’m using spotipy (version 2.24.0) and encountered similar behavior when attempting to create a private playlist (public=False) via the user_playlist_create method.

 

While debugging, I observed that the data payload is being passed correctly:

 

 

{'name': 'API Bug', 'public': False, 'collaborative': False, 'description': ''}

 

 

Within user_playlist_create, the following statement is used:

 

 

return self._post(f"users/{user}/playlists", payload=data)

 

 

However, in all cases, the playlist does not seem to be created as private. This might suggest that Spotify still has an issue processing this specific API request or that the API isn’t reliably respecting the public parameter.

 

I also have the playlist-modify-private scope, so missing permissions don’t appear to be the cause.

I can confirm I still have this issue too with my app.

Marked as solution

Let's recap once more.

Before, Spotify playlists could be private or publicPublic meant it was published to your user profile, private meant that it was not published to your user profile, however it could still be accessed via the URI/URL.

A few years ago, Spotify improved this for their applications, and introduced the possibility for a playlist to be truly private, which would mean that even if others had the URI/URL, they could not access your playlist.  They decided that this was a better representation of what public/private meant, so in the applications, the public/private toggle would toggle this state instead.

The previous public/private states, which was more accurately a reflection of whether the playlist was published on your profile, was renamed in the apps to "Publish on profile".

While Spotify made this change in the applications, they have not (yet) moved this into the Web API functionality, so in the Web API, the public/private boolean represents whether it is published on a users page, and there is no functionality to allow users to toggle the new (true) public/private state.

Suggested posts