PUT
/
playlists
/
{playlistID}
/
items
using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Components;

var sdk = new PlexAPI(accessToken: "<YOUR_API_KEY_HERE>");

var res = await sdk.Playlists.AddPlaylistContentsAsync(
    playlistID: 8502.01D,
    uri: "server://12345/com.plexapp.plugins.library/library/metadata/1",
    playQueueID: 123D
);

// handle response
{
  "MediaContainer": {
    "size": 1,
    "leafCountAdded": 1,
    "leafCountRequested": 1,
    "Metadata": [
      {
        "ratingKey": "94",
        "key": "/playlists/94/items",
        "guid": "com.plexapp.agents.none://972e3047-83d6-4848-a000-261f0af26ba2",
        "type": "playlist",
        "title": "A great playlist",
        "summary": "One of my great playlists",
        "smart": false,
        "playlistType": "video",
        "composite": "/playlists/94/composite/1705800070",
        "duration": 423000,
        "leafCount": 3,
        "addedAt": 1705716458,
        "updatedAt": 1705800070
      }
    ]
  }
}

Authorizations

X-Plex-Token
string
header
required

Plex Authentication Token

Path Parameters

playlistID
number
required

the ID of the playlist

Query Parameters

uri
string
required

the content URI for the playlist

Example:

"server://12345/com.plexapp.plugins.library/library/metadata/1"

playQueueID
number

the play queue to add to a playlist

Example:

123

Response

200
application/json
Playlist Updated
MediaContainer
object