API and SDK reference
Installation
_10pip install git+<UNSET>.git
Server
Operations against the Plex Media Server System.
Available Operations
- Get Server Capabilities - Server Capabilities
- Get Server Preferences - Get Server Preferences
- Get Available Clients - Get Available Clients
- Get Devices - Get Devices
- Get Server Identity - Get Server Identity
- Get My Plex Account - Get MyPlex Account
- Get Resized Photo - Get a Resized Photo
- Get Server List - Get Server List
Server
Get Server Capabilities
Server Capabilities
Parameters
Response
operations.GetServerCapabilitiesResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
object
Optional[operations.GetServerCapabilitiesResponseBody]
The Server Capabilities
Show child properties
Server
Get Server Preferences
Get Server Preferences
Parameters
Response
operations.GetServerPreferencesResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Server
Get Available Clients
Get Available Clients
Parameters
Response
operations.GetAvailableClientsResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
classes
List[operations.ResponseBody]
Available Clients
Show child properties
Server
Get Devices
Get Devices
Parameters
Response
operations.GetDevicesResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
object
Optional[operations.GetDevicesResponseBody]
Devices
Show child properties
Server
Get Server Identity
Get Server Identity
Parameters
Response
operations.GetServerIdentityResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
object
Optional[operations.GetServerIdentityResponseBody]
The Transcode Sessions
Show child properties
Server
Get My Plex Account
Returns MyPlex Account Information
Parameters
Response
operations.GetMyPlexAccountResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
object
Optional[operations.GetMyPlexAccountResponseBody]
MyPlex Account
Show child properties
Server
Get Resized Photo
Plex's Photo transcoder is used throughout the service to serve images at specified sizes.
Parameters
request
operations.GetResizedPhotoRequest
The request object to use for the request.
Show child properties
width
float
The width for the resized photo
Example: 110
height
float
The height for the resized photo
Example: 165
opacity
int
The opacity for the resized photo
blur
float
The width for the resized photo
Example: 0
min_size
float
images are always scaled proportionally. A value of '1' in minSize will make the smaller native dimension the dimension resized against.
upscale
float
allow images to be resized beyond native dimensions.
url
str
path to image within Plex
Example: /library/metadata/49564/thumb/1654258204
Response
operations.GetResizedPhotoResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Server
Get Server List
Get Server List
Parameters
Response
operations.GetServerListResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
object
Optional[operations.GetServerListResponseBody]
List of Servers
Show child properties
Media
API Calls interacting with Plex Media Server Media
Available Operations
- Mark Played - Mark Media Played
- Mark Unplayed - Mark Media Unplayed
- Update Play Progress - Update Media Play Progress
Media
Mark Played
This will mark the provided media key as Played.
Parameters
key
float
The media key to mark as played
Example: 59398
Response
operations.MarkPlayedResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Media
Mark Unplayed
This will mark the provided media key as Unplayed.
Parameters
key
float
The media key to mark as Unplayed
Example: 59398
Response
operations.MarkUnplayedResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Media
Update Play Progress
This API command can be used to update the play progress of a media item.
Parameters
key
str
the media key
time
float
The time, in milliseconds, used to set the media playback progress.
state
str
The playback state of the media item.
Response
operations.UpdatePlayProgressResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Activities
Activities are awesome. They provide a way to monitor and control asynchronous operations on the server. In order to receive real-time updates for activities, a client would normally subscribe via either EventSource or Websocket endpoints.
Activities are associated with HTTP replies via a special X\-Plex\-Activity
header which contains the UUID of the activity.
Activities are optional cancellable. If cancellable, they may be cancelled via the DELETE
endpoint. Other details:
- They can contain a progress
(from 0 to 100) marking the percent completion of the activity.
- They must contain an type
which is used by clients to distinguish the specific activity.
- They may contain a Context
object with attributes which associate the activity with various specific entities (items, libraries, etc.)
- The may contain a Response
object which attributes which represent the result of the asynchronous operation.
Available Operations
- Get Server Activities - Get Server Activities
- Cancel Server Activities - Cancel Server Activities
Activities
Get Server Activities
Get Server Activities
Parameters
Response
operations.GetServerActivitiesResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
object
Optional[operations.GetServerActivitiesResponseBody]
The Server Activities
Show child properties
Activities
Cancel Server Activities
Cancel Server Activities
Parameters
activity_uuid
str
The UUID of the activity to cancel.
Response
operations.CancelServerActivitiesResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Butler
Butler is the task manager of the Plex Media Server Ecosystem.
Available Operations
- Stop All Tasks - Stop all Butler tasks
- Get Butler Tasks - Get Butler tasks
- Start All Tasks - Start all Butler tasks
- Stop Task - Stop a single Butler task
- Start Task - Start a single Butler task
Butler
Stop All Tasks
This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue.
Parameters
Response
operations.StopAllTasksResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Butler
Get Butler Tasks
Returns a list of butler tasks
Parameters
Response
operations.GetButlerTasksResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
object
Optional[operations.GetButlerTasksResponseBody]
All butler tasks
Show child properties
Butler
Start All Tasks
This endpoint will attempt to start all Butler tasks that are enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria:
- Any tasks not scheduled to run on the current day will be skipped.
- If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately.
- If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window.
- If we are outside the configured window, the task will start immediately.
Parameters
Response
operations.StartAllTasksResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Butler
Stop Task
This endpoint will stop a currently running task by name, or remove it from the list of scheduled tasks if it exists. See the section above for a list of task names for this endpoint.
Parameters
task_name
operations.TaskName
The name of the task to be started.
Show child properties
Name | Value |
---|---|
BACKUP_DATABASE | BackupDatabase |
BUILD_GRACENOTE_COLLECTIONS | BuildGracenoteCollections |
CHECK_FOR_UPDATES | CheckForUpdates |
CLEAN_OLD_BUNDLES | CleanOldBundles |
CLEAN_OLD_CACHE_FILES | CleanOldCacheFiles |
DEEP_MEDIA_ANALYSIS | DeepMediaAnalysis |
GENERATE_AUTO_TAGS | GenerateAutoTags |
GENERATE_CHAPTER_THUMBS | GenerateChapterThumbs |
GENERATE_MEDIA_INDEX_FILES | GenerateMediaIndexFiles |
OPTIMIZE_DATABASE | OptimizeDatabase |
REFRESH_LIBRARIES | RefreshLibraries |
REFRESH_LOCAL_MEDIA | RefreshLocalMedia |
REFRESH_PERIODIC_METADATA | RefreshPeriodicMetadata |
UPGRADE_MEDIA_ANALYSIS | UpgradeMediaAnalysis |
Response
operations.StopTaskResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Butler
Start Task
This endpoint will attempt to start a single Butler task that is enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria:
- Any tasks not scheduled to run on the current day will be skipped.
- If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately.
- If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window.
- If we are outside the configured window, the task will start immediately.
Parameters
task_name
operations.PathParamTaskName
the name of the task to be started.
Show child properties
Name | Value |
---|---|
BACKUP_DATABASE | BackupDatabase |
BUILD_GRACENOTE_COLLECTIONS | BuildGracenoteCollections |
CHECK_FOR_UPDATES | CheckForUpdates |
CLEAN_OLD_BUNDLES | CleanOldBundles |
CLEAN_OLD_CACHE_FILES | CleanOldCacheFiles |
DEEP_MEDIA_ANALYSIS | DeepMediaAnalysis |
GENERATE_AUTO_TAGS | GenerateAutoTags |
GENERATE_CHAPTER_THUMBS | GenerateChapterThumbs |
GENERATE_MEDIA_INDEX_FILES | GenerateMediaIndexFiles |
OPTIMIZE_DATABASE | OptimizeDatabase |
REFRESH_LIBRARIES | RefreshLibraries |
REFRESH_LOCAL_MEDIA | RefreshLocalMedia |
REFRESH_PERIODIC_METADATA | RefreshPeriodicMetadata |
UPGRADE_MEDIA_ANALYSIS | UpgradeMediaAnalysis |
Response
operations.StartTaskResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Hubs
Hubs are a structured two-dimensional container for media, generally represented by multiple horizontal rows.
Available Operations
- Get Global Hubs - Get Global Hubs
- Get Library Hubs - Get library specific hubs
Hubs
Get Global Hubs
Get Global Hubs filtered by the parameters provided.
Parameters
count
Optional[float]
The number of items to return with each hub.
only_transient
Optional[float]
Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added).
Response
operations.GetGlobalHubsResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Hubs
Get Library Hubs
This endpoint will return a list of library specific hubs
Parameters
section_id
float
the Id of the library to query
count
Optional[float]
The number of items to return with each hub.
only_transient
Optional[float]
Only return hubs which are "transient", meaning those which are prone to changing after media playback or addition (e.g. On Deck, or Recently Added).
Response
operations.GetLibraryHubsResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Search
API Calls that perform search operations with Plex Media Server
Available Operations
- Perform Search - Perform a search
- Perform Voice Search - Perform a voice search
- Get Search Results - Get Search Results
Search
Perform Search
This endpoint performs a search across all library sections, or a single section, and returns matches as hubs, split up by type. It performs spell checking, looks for partial matches, and orders the hubs based on quality of results. In addition, based on matches, it will return other related matches (e.g. for a genre match, it may return movies in that genre, or for an actor match, movies with that actor).
In the response's items, the following extra attributes are returned to further describe or disambiguate the result:
reason
: The reason for the result, if not because of a direct search term match; can be either:section
: There are multiple identical results from different sections.originalTitle
: There was a search term match from the original title field (sometimes those can be very different or in a foreign language).<hub identifier>
: If the reason for the result is due to a result in another hub, the source hub identifier is returned. For example, if the search is for "dylan" then Bob Dylan may be returned as an artist result, an a few of his albums returned as album results with a reason code ofartist
(the identifier of that particular hub). Or if the search is for "arnold", there might be movie results returned with a reason ofactor
reasonTitle
: The string associated with the reason code. For a section reason, it'll be the section name; For a hub identifier, it'll be a string associated with the match (e.g.Arnold Schwarzenegger
for movies which were returned because the search was for "arnold").reasonID
: The ID of the item associated with the reason for the result. This might be a section ID, a tag ID, an artist ID, or a show ID.
This request is intended to be very fast, and called as the user types.
Parameters
query
str
The query term
Example: arnold
section_id
Optional[float]
This gives context to the search, and can result in re-ordering of search result hubs
limit
Optional[float]
The number of items to return per hub
Example: 5
Response
operations.PerformSearchResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Search
Perform Voice Search
This endpoint performs a search specifically tailored towards voice or other imprecise input which may work badly with the substring and spell-checking heuristics used by the /hubs/search
endpoint.
It uses a Levenshtein distance heuristic to search titles, and as such is much slower than the other search endpoint.
Whenever possible, clients should limit the search to the appropriate type.
Results, as well as their containing per-type hubs, contain a distance
attribute which can be used to judge result quality.
Parameters
query
str
The query term
Example: dead+poop
section_id
Optional[float]
This gives context to the search, and can result in re-ordering of search result hubs
limit
Optional[float]
The number of items to return per hub
Example: 5
Response
operations.PerformVoiceSearchResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Search
Get Search Results
This will search the database for the string provided.
Parameters
query
str
The search query string to use
Example: 110
Response
operations.GetSearchResultsResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
object
Optional[operations.GetSearchResultsResponseBody]
Search Results
Show child properties
Library
API Calls interacting with Plex Media Server Libraries
Available Operations
- Get File Hash - Get Hash Value
- Get Recently Added - Get Recently Added
- Get Libraries - Get All Libraries
- Delete Library - Delete Library Section
- Get Library - Get Library Details
- Get Library Items - Get Library Items
- Refresh Library - Refresh Library
- Get Latest Library Items - Get Latest Library Items
- Get Common Library Items - Get Common Library Items
- Get Metadata - Get Items Metadata
- Get Metadata Children - Get Items Children
- Get On Deck - Get On Deck
Library
Get File Hash
This resource returns hash values for local files
Parameters
url
str
This is the path to the local file, must be prefixed by file://
Example: file://C:\Image.png&type=13
type
Optional[float]
Item type
Response
operations.GetFileHashResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Library
Get Recently Added
This endpoint will return the recently added content.
Parameters
Response
operations.GetRecentlyAddedResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
object
Optional[operations.GetRecentlyAddedResponseBody]
The recently added content
Show child properties
Library
Get Libraries
A library section (commonly referred to as just a library) is a collection of media. Libraries are typed, and depending on their type provide either a flat or a hierarchical view of the media. For example, a music library has an artist > albums > tracks structure, whereas a movie library is flat.
Libraries have features beyond just being a collection of media; for starters, they include information about supported types, filters and sorts. This allows a client to provide a rich interface around the media (e.g. allow sorting movies by release year).
Parameters
Response
operations.GetLibrariesResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Library
Delete Library
Delate a library using a specific section
Parameters
section_id
float
the Id of the library to query
Example: 1000
Response
operations.DeleteLibraryResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Library
Get Library
Returns details for the library. This can be thought of as an interstitial endpoint because it contains information about the library, rather than content itself. These details are:
- A list of
Directory
objects: These used to be used by clients to build a menuing system. There are four flavors of directory found here:- Primary: (e.g. all, On Deck) These are still used in some clients to provide "shortcuts" to subsets of media. However, with the exception of On Deck, all of them can be created by media queries, and the desire is to allow these to be customized by users.
- Secondary: These are marked with
secondary="1"
and were used by old clients to provide nested menus allowing for primative (but structured) navigation. - Special: There is a By Folder entry which allows browsing the media by the underlying filesystem structure, and there's a completely obsolete entry marked
search="1"
which used to be used to allow clients to build search dialogs on the fly.
- A list of
Type
objects: These represent the types of things found in this library, and for each one, a list ofFilter
andSort
objects. These can be used to build rich controls around a grid of media to allow filtering and organizing. Note that these filters and sorts are optional, and without them, the client won't render any filtering controls. TheType
object contains:key
: This provides the root endpoint returning the actual media list for the type.type
: This is the metadata type for the type (if a standard Plex type).title
: The title for for the content of this type (e.g. "Movies").
- Each
Filter
object contains a description of the filter. Note that it is not an exhaustive list of the full media query language, but an inportant subset useful for top-level API.filter
: This represents the filter name used for the filter, which can be used to construct complex media queries with.filterType
: This is eitherstring
,integer
, orboolean
, and describes the type of values used for the filter.key
: This provides the endpoint where the possible range of values for the filter can be retrieved (e.g. for a "Genre" filter, it returns a list of all the genres in the library). This will include atype
argument that matches the metadata type of the Type element.title
: The title for the filter.
- Each
Sort
object contains a description of the sort field.defaultDirection
: Can be eitherasc
ordesc
, and specifies the default direction for the sort field (e.g. titles default to alphabetically ascending).descKey
andkey
: Contains the parameters passed to thesort=...
media query for each direction of the sort.title
: The title of the field.
Parameters
section_id
float
the Id of the library to query
Example: 1000
include_details
Optional[float]
Whether or not to include details for a section (types, filters, and sorts). Only exists for backwards compatibility, media providers other than the server libraries have it on always.
Response
operations.GetLibraryResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Library
Get Library Items
This endpoint will return a list of library items filtered by the filter and type provided
Parameters
section_id
float
the Id of the library to query
type
Optional[float]
item type
filter
Optional[str]
the filter parameter
Response
operations.GetLibraryItemsResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Library
Refresh Library
This endpoint Refreshes the library.
Parameters
section_id
float
the Id of the library to refresh
Response
operations.RefreshLibraryResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Library
Get Latest Library Items
This endpoint will return a list of the latest library items filtered by the filter and type provided
Parameters
section_id
float
the Id of the library to query
type
float
item type
filter
Optional[str]
the filter parameter
Response
operations.GetLatestLibraryItemsResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Library
Get Common Library Items
Represents a "Common" item. It contains only the common attributes of the items selected by the provided filter
Parameters
section_id
float
the Id of the library to query
type
float
item type
filter
Optional[str]
the filter parameter
Response
operations.GetCommonLibraryItemsResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Library
Get Metadata
This endpoint will return the metadata of a library item specified with the ratingKey.
Parameters
rating_key
float
the id of the library item to return the children of.
Response
operations.GetMetadataResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Library
Get Metadata Children
This endpoint will return the children of of a library item specified with the ratingKey.
Parameters
rating_key
float
the id of the library item to return the children of.
Response
operations.GetMetadataChildrenResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Library
Get On Deck
This endpoint will return the on deck content.
Parameters
Response
operations.GetOnDeckResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
object
Optional[operations.GetOnDeckResponseBody]
The on Deck content
Show child properties
Log
Submit logs to the Log Handler for Plex Media Server
Available Operations
- Log Line - Logging a single line message.
- Log Multi Line - Logging a multi-line message
- Enable Paper Trail - Enabling Papertrail
Log
Log Line
This endpoint will write a single-line log message, including a level and source to the main Plex Media Server log.
Parameters
level
float
An integer log level to write to the PMS log with.
0: Error
1: Warning
2: Info
3: Debug
4: Verbose
message
str
The text of the message to write to the log.
source
str
a string indicating the source of the message.
Response
operations.LogLineResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Log
Log Multi Line
This endpoint will write multiple lines to the main Plex Media Server log in a single request. It takes a set of query strings as would normally sent to the above GET endpoint as a linefeed-separated block of POST data. The parameters for each query string match as above.
Parameters
Response
operations.LogMultiLineResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Log
Enable Paper Trail
This endpoint will enable all Plex Media Serverlogs to be sent to the Papertrail networked logging site for a period of time.
Parameters
Response
operations.EnablePaperTrailResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Playlists
Playlists are ordered collections of media. They can be dumb (just a list of media) or smart (based on a media query, such as "all albums from 2017"). They can be organized in (optionally nesting) folders. Retrieving a playlist, or its items, will trigger a refresh of its metadata. This may cause the duration and number of items to change.
Available Operations
- Create Playlist - Create a Playlist
- Get Playlists - Get All Playlists
- Delete Playlist - Deletes a Playlist
- Get Playlist - Retrieve Playlist
- Update Playlist - Update a Playlist
- Clear Playlist Contents - Delete Playlist Contents
- Get Playlist Contents - Retrieve Playlist Contents
- Add Playlist Contents - Adding to a Playlist
- Upload Playlist - Upload Playlist
Playlists
Create Playlist
Create a new playlist. By default the playlist is blank. To create a playlist along with a first item, pass:
uri
- The content URI for what we're playing (e.g.library://...
).playQueueID
- To create a playlist from an existing play queue.
Parameters
request
operations.CreatePlaylistRequest
The request object to use for the request.
Show child properties
title
str
name of the playlist
type
operations.Type
type of playlist to create
Show child properties
smart
float
whether the playlist is smart or not
uri
Optional[str]
the content URI for the playlist
play_queue_id
Optional[float]
the play queue to copy to a playlist
Response
operations.CreatePlaylistResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Playlists
Get Playlists
Get All Playlists given the specified filters.
Parameters
playlist_type
Optional[operations.PlaylistType]
limit to a type of playlist.
Show child properties
Name | Value |
---|---|
AUDIO | audio |
VIDEO | video |
PHOTO | photo |
smart
Optional[float]
type of playlists to return (default is all).
Response
operations.GetPlaylistsResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Playlists
Delete Playlist
This endpoint will delete a playlist
Parameters
playlist_id
float
the ID of the playlist
Response
operations.DeletePlaylistResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Playlists
Get Playlist
Gets detailed metadata for a playlist. A playlist for many purposes (rating, editing metadata, tagging), can be treated like a regular metadata item:
Smart playlist details contain the content
attribute. This is the content URI for the generator. This can then be parsed by a client to provide smart playlist editing.
Parameters
playlist_id
float
the ID of the playlist
Response
operations.GetPlaylistResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Playlists
Update Playlist
From PMS version 1.9.1 clients can also edit playlist metadata using this endpoint as they would via PUT /library/metadata/\{playlistID\}
Parameters
playlist_id
float
the ID of the playlist
Response
operations.UpdatePlaylistResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Playlists
Clear Playlist Contents
Clears a playlist, only works with dumb playlists. Returns the playlist.
Parameters
playlist_id
float
the ID of the playlist
Response
operations.ClearPlaylistContentsResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Playlists
Get Playlist Contents
Gets the contents of a playlist. Should be paged by clients via standard mechanisms.
By default leaves are returned (e.g. episodes, movies). In order to return other types you can use the type
parameter.
For example, you could use this to display a list of recently added albums vis a smart playlist.
Note that for dumb playlists, items have a playlistItemID
attribute which is used for deleting or moving items.
Parameters
playlist_id
float
the ID of the playlist
type
float
the metadata type of the item to return
Response
operations.GetPlaylistContentsResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Playlists
Add Playlist Contents
Adds a generator to a playlist, same parameters as the POST above. 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.
Parameters
playlist_id
float
the ID of the playlist
uri
str
the content URI for the playlist
Example: library://..
play_queue_id
float
the play queue to add to a playlist
Example: 123
Response
operations.AddPlaylistContentsResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Playlists
Upload Playlist
Imports m3u playlists by passing a path on the server to scan for m3u-formatted playlist files, or a path to a single playlist file.
Parameters
path
str
absolute path to a directory on the server where m3u files are stored, or the absolute path to a playlist file on the server.
If the path
argument is a directory, that path will be scanned for playlist files to be processed.
Each file in that directory creates a separate playlist, with a name based on the filename of the file that created it.
The GUID of each playlist is based on the filename.
If the path
argument is a file, that file will be used to create a new playlist, with the name based on the filename of the file that created it.
The GUID of each playlist is based on the filename.
Example: /home/barkley/playlist.m3u
force
float
force overwriting of duplicate playlists. By default, a playlist file uploaded with the same path will overwrite the existing playlist.
The force
argument is used to disable overwriting. If the force
argument is set to 0, a new playlist will be created suffixed with the date and time that the duplicate was uploaded.
Response
operations.UploadPlaylistResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Security
API Calls against Security for Plex Media Server
Available Operations
- Get Transient Token - Get a Transient Token.
- Get Source Connection Information - Get Source Connection Information
Security
Get Transient Token
This endpoint provides the caller with a temporary token with the same access level as the caller's token. These tokens are valid for up to 48 hours and are destroyed if the server instance is restarted.
Parameters
type
operations.QueryParamType
delegation
- This is the only supported type
parameter.
Show child properties
Name | Value |
---|---|
DELEGATION | delegation |
scope
operations.Scope
all
- This is the only supported scope
parameter.
Show child properties
Name | Value |
---|---|
ALL | all |
Response
operations.GetTransientTokenResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Security
Get Source Connection Information
If a caller requires connection details and a transient token for a source that is known to the server, for example a cloud media provider or shared PMS, then this endpoint can be called. This endpoint is only accessible with either an admin token or a valid transient token generated from an admin token. Note: requires Plex Media Server >= 1.15.4.
Parameters
source
str
The source identifier with an included prefix.
Example: server://client-identifier
Response
operations.GetSourceConnectionInformationResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Sessions
API Calls that perform search operations with Plex Media Server Sessions
Available Operations
- Get Sessions - Get Active Sessions
- Get Session History - Get Session History
- Get Transcode Sessions - Get Transcode Sessions
- Stop Transcode Session - Stop a Transcode Session
Sessions
Get Sessions
This will retrieve the "Now Playing" Information of the PMS.
Parameters
Response
operations.GetSessionsResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Sessions
Get Session History
This will Retrieve a listing of all history views.
Parameters
Response
operations.GetSessionHistoryResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Sessions
Get Transcode Sessions
Get Transcode Sessions
Parameters
Response
operations.GetTranscodeSessionsResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
object
Optional[operations.GetTranscodeSessionsResponseBody]
The Transcode Sessions
Show child properties
Sessions
Stop Transcode Session
Stop a Transcode Session
Parameters
session_key
str
the Key of the transcode session to stop
Example: zz7llzqlx8w9vnrsbnwhbmep
Response
operations.StopTranscodeSessionResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Updater
This describes the API for searching and applying updates to the Plex Media Server. Updates to the status can be observed via the Event API.
Available Operations
- Get Update Status - Querying status of updates
- Check For Updates - Checking for updates
- Apply Updates - Apply Updates
Updater
Get Update Status
Querying status of updates
Parameters
Response
operations.GetUpdateStatusResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Updater
Check For Updates
Checking for updates
Parameters
download
Optional[operations.Download]
Indicate that you want to start download any updates found.
Show child properties
Name | Value |
---|---|
ZERO | 0 |
ONE | 1 |
Response
operations.CheckForUpdatesResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Updater
Apply Updates
Note that these two parameters are effectively mutually exclusive. The tonight
parameter takes precedence and skip
will be ignored if tonight
is also passed
Parameters
tonight
Optional[operations.Tonight]
Indicate that you want the update to run during the next Butler execution. Omitting this or setting it to false indicates that the update should install
Show child properties
Name | Value |
---|---|
ZERO | 0 |
ONE | 1 |
skip
Optional[operations.Skip]
Indicate that the latest version should be marked as skipped. The <Release> entry for this version will have the state
set to skipped
.
Show child properties
Name | Value |
---|---|
ZERO | 0 |
ONE | 1 |
Response
operations.ApplyUpdatesResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Video
API Calls that perform operations with Plex Media Server Videos
Available Operations
- Start Universal Transcode - Start Universal Transcode
- Get Timeline - Get the timeline for a media item
Video
Start Universal Transcode
Begin a Universal Transcode Session
Parameters
request
operations.StartUniversalTranscodeRequest
The request object to use for the request.
Show child properties
has_mde
float
Whether the media item has MDE
path
str
The path to the media item to transcode
media_index
float
The index of the media item to transcode
part_index
float
The index of the part to transcode
protocol
str
The protocol to use for the transcode session
fast_seek
Optional[float]
Whether to use fast seek or not
direct_play
Optional[float]
Whether to use direct play or not
direct_stream
Optional[float]
Whether to use direct stream or not
subtitle_size
Optional[float]
The size of the subtitles
subtites
Optional[str]
The subtitles
audio_boost
Optional[float]
The audio boost
location
Optional[str]
The location of the transcode session
media_buffer_size
Optional[float]
The size of the media buffer
session
Optional[str]
The session ID
add_debug_overlay
Optional[float]
Whether to add a debug overlay or not
auto_adjust_quality
Optional[float]
Whether to auto adjust quality or not
Response
operations.StartUniversalTranscodeResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing
Video
Get Timeline
Get the timeline for a media item
Parameters
request
operations.GetTimelineRequest
The request object to use for the request.
Show child properties
rating_key
float
The rating key of the media item
key
str
The key of the media item to get the timeline for
state
operations.State
The state of the media item
Show child properties
has_mde
float
Whether the media item has MDE
time
float
The time of the media item
duration
float
The duration of the media item
context
str
The context of the media item
play_queue_item_id
float
The play queue item ID of the media item
play_back_time
float
The playback time of the media item
row
float
The row of the media item
Response
operations.GetTimelineResponse
Hide child properties
content_type
str
HTTP response content type for this operation
status_code
int
HTTP response status code for this operation
raw_response
requests.Response
Raw HTTP response; suitable for custom response parsing