Playlists
Adding to a Playlist
Server
Media
Butler
Plex
Library
- GETGet Hash Value
- GETGet Recently Added
- GETGet All Libraries
- GETGet library details
- DELDelete library section
- GETGet library items
- GETGet all media of library
- GETRefresh Metadata Of The Library
- GETSearch library
- GETGet Genres of library media
- GETGet Countries of library media
- GETGet Actors of library media
- GETSearch All Libraries
- GETGet Media Metadata
- GETGet Items Children
- GETGet Top Watched Content
- GETGet On Deck
Watchlist
Playlists
Authentication
Sessions
Playlists
Adding to a Playlist
Adds a generator to a playlist, same parameters as the POST to create. With a dumb playlist, this adds the specified items to the playlist.
With a smart playlist, passing a new uri
parameter replaces the rules for the playlist. Returns the playlist.
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
Plex Authentication Token
Path Parameters
the ID of the playlist
Query Parameters
the content URI for the playlist
Example:
"server://12345/com.plexapp.plugins.library/library/metadata/1"
the play queue to add to a playlist
Example:
123
Response
200
application/json
Playlist Updated
Example:
1
Example:
1
Example:
1
Example:
"94"
Example:
"/playlists/94/items"
Example:
"com.plexapp.agents.none://972e3047-83d6-4848-a000-261f0af26ba2"
Example:
"playlist"
Example:
"A great playlist"
Example:
"One of my great playlists"
Example:
false
Example:
"video"
Example:
"/playlists/94/composite/1705800070"
Example:
423000
Example:
3
Example:
1705716458
Example:
1705800070
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
}
]
}
}