Overriding tracks of a playlist through Apple Music API

Hello, I have a question regarding the update of playlists through the API. I haven't found this documented, but I prefer asking just in case I missed something.

Is there an endpoint/parameter to add tracks to a playlist by overriding the tracks that are in it?

I only found an endpoint to append tracks to a playlist, which is not enough for how my app works

Thanks!

You can edit a playlist that was generated by your app using the new MusicKit edit API

https://developer.apple.com/documentation/musickit/musiclibrary/edit(_:name:description:authordisplayname:)

Hello Anemost,

Thanks for the question!

By “override the tracks that are in it”, I suppose you mean deleting tracks and adding your own? If that is the case, this functionality, as well as other destructive functionality, is currently unavailable as an endpoint in Apple Music API.

Playlist editing is only available on Apple platforms through the MusicKit framework, with the caveat that developers may only edit playlists that they have created themselves.

If you’d like to be able to edit playlists on other platforms, please consider filing an enhancement request in Feedback Assistant, and tell us a little bit more about the context of your use-case and how you intend to use such an API.

-David

Hello again David,

My app is web based (using PHP), I don't think MusicKit framework is an available for me, but tell me if I'm wrong.

Yes, I meant deleting tracks and adding new ones in the playlists I have created on my own account. But in the future I would also like to do the same on playlist I would have generated for users on their account (if they have granted permission to my app of course)

Hello, I'm just posting here to notify that I created requests in the Feedback Assistant for this feature : FB10150799

Thanks for your answers, and I hope my feedbacks will help to improve the Apple Music API.

Hello @Anemost,

You're correct, if you're building a web based app, using PHP and JavaScript, then you cannot use the MusicKit platform that is available on Apple platforms.

Thank you very much for taking the time to file this enhancement request in Feedback Assistant!

Best regards,

Overriding tracks of a playlist through Apple Music API
 
 
Q