# Add playlists with core API JSON-RPC

**URL:** <https://discourse.mopidy.com/t/add-playlists-with-core-api-json-rpc/4857>\
**Category:** Misc\
**Created:** [April 3, 2021, 7:58am UTC](https://discourse.mopidy.com/t/add-playlists-with-core-api-json-rpc/4857 "2021-04-03T07:58:03Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fmarzocca](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/fmarzocca/32/1095_2.png) [@fmarzocca](https://discourse.mopidy.com/u/fmarzocca)\
**Post date:** [April 3, 2021, 7:58am UTC](https://discourse.mopidy.com/t/add-playlists-with-core-api-json-rpc/4857/1 "2021-04-03T07:58:03Z")

</div>

Hi,  
I am using core API to manage my mopidy server through NodeRed, but I have noted that I can’t add playlists with uris starting with “m3u”.

This command works:  
` {"jsonrpc": "2.0", "id": 1, "method": "core.tracklist.add", "params": {"uris":"spotify:playlist:7gyIPHbKqrNNnMCWjp2cbt","spotify:playlist:8gyIPHbKqrNNnMCWht7tsd"}}`

But this one doesn’t:  
` {"jsonrpc": "2.0", "id": 1, "method": "core.tracklist.add", "params": {"uris":"m3u:random.m3u8","m3u:Kitty%20Margolis%20Playlist.m3u8"}}`

I got the uris from the command:  
`{"jsonrpc": "2.0", "id": 1, "method": "core.playlists.as_list"}`

---

<div class="post-metadata">

**Author:** ![kingosticks](https://avatars.discourse-cdn.com/v4/letter/k/858c86/32.png) [@kingosticks](https://discourse.mopidy.com/u/kingosticks)\
**Post date:** [April 3, 2021, 8:50am UTC](https://discourse.mopidy.com/t/add-playlists-with-core-api-json-rpc/4857/2 "2021-04-03T08:50:51Z")

</div>

First get the items from the playlist(s). Then add those track ref uris to the tracklist. That method should work for all backends.

The shortcut method you tried works for only some backends.

---

<div class="post-metadata">

**Author:** ![fmarzocca](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/fmarzocca/32/1095_2.png) [@fmarzocca](https://discourse.mopidy.com/u/fmarzocca)\
**Post date:** [April 3, 2021, 8:58am UTC](https://discourse.mopidy.com/t/add-playlists-with-core-api-json-rpc/4857/3 "2021-04-03T08:58:08Z")

</div>

So I need a function to loop through items before adding them?

---

<div class="post-metadata">

**Author:** ![system](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.mopidy.com/system/32/1_2.png) [@system](https://discourse.mopidy.com/u/system)\
**Post date:** [April 6, 2021, 9:03am UTC](https://discourse.mopidy.com/t/add-playlists-with-core-api-json-rpc/4857/6 "2021-04-06T09:03:12Z")

</div>

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.
