Files
plexpy/docs/sdks/library/README.md
speakeasybot 5379e2aa2c ## Python SDK Changes Detected:
* `plex_api.butler.start_task()`: 
  *  `request` **Changed** **Breaking** ⚠️
  *  `error` **Changed** **Breaking** ⚠️
* `plex_api.butler.stop_task()`: 
  *  `request` **Changed** **Breaking** ⚠️
  *  `error` **Changed** **Breaking** ⚠️
* `plex_api.updater.apply_updates()`: 
  *  `request` **Changed** **Breaking** ⚠️
  *  `error` **Changed** **Breaking** ⚠️
* `plex_api.general.get_server_info()`: **Added**
* `plex_api.general.get_identity()`: **Added**
* `plex_api.general.get_source_connection_information()`: **Added**
* `plex_api.general.get_transient_token()`: **Added**
* `plex_api.events.get_notifications()`: **Added**
* `plex_api.events.connect_web_socket()`: **Added**
* `plex_api.preferences.get_all_preferences()`: **Added**
* `plex_api.preferences.set_preferences()`: **Added**
* `plex_api.preferences.get_preference()`: **Added**
* `plex_api.rate.set_rating()`: **Added**
* `plex_api.timeline.mark_played()`: **Added**
* `plex_api.timeline.report()`: **Added**
* `plex_api.timeline.unscrobble()`: **Added**
* `plex_api.activities.list_activities()`: **Added**
* `plex_api.activities.cancel_activity()`: **Added**
* `plex_api.butler.stop_tasks()`: **Added**
* `plex_api.butler.get_tasks()`: **Added**
* `plex_api.butler.start_tasks()`: **Added**
* `plex_api.download_queue.create_download_queue()`: **Added**
* `plex_api.download_queue.get_download_queue()`: **Added**
* `plex_api.download_queue.add_download_queue_items()`: **Added**
* `plex_api.download_queue.list_download_queue_items()`: **Added**
* `plex_api.download_queue.get_item_decision()`: **Added**
* `plex_api.download_queue.get_download_queue_media()`: **Added**
* `plex_api.download_queue.remove_download_queue_items()`: **Added**
* `plex_api.download_queue.get_download_queue_items()`: **Added**
* `plex_api.download_queue.restart_processing_download_queue_items()`: **Added**
* `plex_api.hubs.get_all_hubs()`: **Added**
* `plex_api.hubs.get_continue_watching()`: **Added**
* `plex_api.hubs.get_hub_items()`: **Added**
* `plex_api.hubs.get_promoted_hubs()`: **Added**
* `plex_api.hubs.get_metadata_hubs()`: **Added**
* `plex_api.hubs.get_postplay_hubs()`: **Added**
* `plex_api.hubs.get_related_hubs()`: **Added**
* `plex_api.hubs.get_section_hubs()`: **Added**
* `plex_api.hubs.reset_section_defaults()`: **Added**
* `plex_api.hubs.list_hubs()`: **Added**
* `plex_api.hubs.create_custom_hub()`: **Added**
* `plex_api.hubs.move_hub()`: **Added**
* `plex_api.hubs.delete_custom_hub()`: **Added**
* `plex_api.hubs.update_hub_visibility()`: **Added**
* `plex_api.search.search_hubs()`: **Added**
* `plex_api.search.voice_search_hubs()`: **Added**
* `plex_api.library.get_library_items()`: **Added**
* `plex_api.library.delete_caches()`: **Added**
* `plex_api.library.clean_bundles()`: **Added**
* `plex_api.library.ingest_transient_item()`: **Added**
* `plex_api.library.get_library_matches()`: **Added**
* `plex_api.library.optimize_database()`: **Added**
* `plex_api.library.get_random_artwork()`: **Added**
* `plex_api.library.get_sections()`: **Added**
* `plex_api.library.add_section()`: **Added**
* `plex_api.library.stop_all_refreshes()`: **Added**
* `plex_api.library.get_sections_prefs()`: **Added**
* `plex_api.library.refresh_sections_metadata()`: **Added**
* `plex_api.library.get_tags()`: **Added**
* `plex_api.library.delete_metadata_item()`: **Added**
* `plex_api.library.edit_metadata_item()`: **Added**
* `plex_api.library.detect_ads()`: **Added**
* `plex_api.library.get_all_item_leaves()`: **Added**
* `plex_api.library.analyze_metadata()`: **Added**
* `plex_api.library.generate_thumbs()`: **Added**
* `plex_api.library.detect_credits()`: **Added**
* `plex_api.library.get_extras()`: **Added**
* `plex_api.library.add_extras()`: **Added**
* `plex_api.library.get_file()`: **Added**
* `plex_api.library.start_bif_generation()`: **Added**
* `plex_api.library.detect_intros()`: **Added**
* `plex_api.library.create_marker()`: **Added**
* `plex_api.library.match_item()`: **Added**
* `plex_api.library.list_matches()`: **Added**
* `plex_api.library.merge_items()`: **Added**
* `plex_api.library.list_sonically_similar()`: **Added**
* `plex_api.library.set_item_preferences()`: **Added**
* `plex_api.library.refresh_items_metadata()`: **Added**
* `plex_api.library.get_related_items()`: **Added**
* `plex_api.library.list_similar()`: **Added**
* `plex_api.library.split_item()`: **Added**
* `plex_api.library.add_subtitles()`: **Added**
* `plex_api.library.get_item_tree()`: **Added**
* `plex_api.library.unmatch()`: **Added**
* `plex_api.library.list_top_users()`: **Added**
* `plex_api.library.detect_voice_activity()`: **Added**
* `plex_api.library.get_augmentation_status()`: **Added**
* `plex_api.library.set_stream_selection()`: **Added**
* `plex_api.library.get_person()`: **Added**
* `plex_api.library.list_person_media()`: **Added**
* `plex_api.library.delete_library_section()`: **Added**
* `plex_api.library.get_library_details()`: **Added**
* `plex_api.library.edit_section()`: **Added**
* `plex_api.library.update_items()`: **Added**
* `plex_api.library.start_analysis()`: **Added**
* `plex_api.library.autocomplete()`: **Added**
* `plex_api.library.get_collections()`: **Added**
* `plex_api.library.get_common()`: **Added**
* `plex_api.library.empty_trash()`: **Added**
* `plex_api.library.get_section_filters()`: **Added**
* `plex_api.library.get_first_characters()`: **Added**
* `plex_api.library.delete_indexes()`: **Added**
* `plex_api.library.delete_intros()`: **Added**
* `plex_api.library.get_section_preferences()`: **Added**
* `plex_api.library.set_section_preferences()`: **Added**
* `plex_api.library.cancel_refresh()`: **Added**
* `plex_api.library.refresh_section()`: **Added**
* `plex_api.library.get_available_sorts()`: **Added**
* `plex_api.library.get_stream_levels()`: **Added**
* `plex_api.library.get_stream_loudness()`: **Added**
* `plex_api.library.get_chapter_image()`: **Added**
* `plex_api.library.set_item_artwork()`: **Added**
* `plex_api.library.update_item_artwork()`: **Added**
* `plex_api.library.delete_marker()`: **Added**
* `plex_api.library.edit_marker()`: **Added**
* `plex_api.library.delete_media_item()`: **Added**
* `plex_api.library.get_part_index()`: **Added**
* `plex_api.library.delete_collection()`: **Added**
* `plex_api.library.get_section_image()`: **Added**
* `plex_api.library.delete_stream()`: **Added**
* `plex_api.library.get_stream()`: **Added**
* `plex_api.library.set_stream_offset()`: **Added**
* `plex_api.library.get_item_artwork()`: **Added**
* `plex_api.library.get_media_part()`: **Added**
* `plex_api.library.get_image_from_bif()`: **Added**
* `plex_api.collections.create_collection()`: **Added**
* `plex_api.dv_rs.list_dv_rs()`: **Added**
* `plex_api.dv_rs.create_dvr()`: **Added**
* `plex_api.dv_rs.delete_dvr()`: **Added**
* `plex_api.dv_rs.get_dvr()`: **Added**
* `plex_api.dv_rs.delete_lineup()`: **Added**
* `plex_api.dv_rs.add_lineup()`: **Added**
* `plex_api.dv_rs.set_dvr_preferences()`: **Added**
* `plex_api.dv_rs.stop_dvr_reload()`: **Added**
* `plex_api.dv_rs.reload_guide()`: **Added**
* `plex_api.dv_rs.tune_channel()`: **Added**
* `plex_api.dv_rs.remove_device_from_dvr()`: **Added**
* `plex_api.dv_rs.add_device_to_dvr()`: **Added**
* `plex_api.epg.compute_channel_map()`: **Added**
* `plex_api.epg.get_channels()`: **Added**
* `plex_api.epg.get_countries()`: **Added**
* `plex_api.epg.get_all_languages()`: **Added**
* `plex_api.epg.get_lineup()`: **Added**
* `plex_api.epg.get_lineup_channels()`: **Added**
* `plex_api.epg.get_countries_lineups()`: **Added**
* `plex_api.epg.get_country_regions()`: **Added**
* `plex_api.epg.list_lineups()`: **Added**
* `plex_api.live_tv.get_sessions()`: **Added**
* `plex_api.live_tv.get_live_tv_session()`: **Added**
* `plex_api.live_tv.get_session_playlist_index()`: **Added**
* `plex_api.live_tv.get_session_segment()`: **Added**
* `plex_api.log.write_log()`: **Added**
* `plex_api.log.write_message()`: **Added**
* `plex_api.log.enable_papertrail()`: **Added**
* `plex_api.devices.get_available_grabbers()`: **Added**
* `plex_api.devices.list_devices()`: **Added**
* `plex_api.devices.add_device()`: **Added**
* `plex_api.devices.discover_devices()`: **Added**
* `plex_api.devices.remove_device()`: **Added**
* `plex_api.devices.get_device_details()`: **Added**
* `plex_api.devices.modify_device()`: **Added**
* `plex_api.devices.set_channelmap()`: **Added**
* `plex_api.devices.get_devices_channels()`: **Added**
* `plex_api.devices.set_device_preferences()`: **Added**
* `plex_api.devices.stop_scan()`: **Added**
* `plex_api.devices.scan()`: **Added**
* `plex_api.devices.get_thumb()`: **Added**
* `plex_api.provider.list_providers()`: **Added**
* `plex_api.provider.add_provider()`: **Added**
* `plex_api.provider.refresh_providers()`: **Added**
* `plex_api.provider.delete_media_provider()`: **Added**
* `plex_api.subscriptions.get_all_subscriptions()`: **Added**
* `plex_api.subscriptions.create_subscription()`: **Added**
* `plex_api.subscriptions.process_subscriptions()`: **Added**
* `plex_api.subscriptions.get_scheduled_recordings()`: **Added**
* `plex_api.subscriptions.get_template()`: **Added**
* `plex_api.subscriptions.cancel_grab()`: **Added**
* `plex_api.subscriptions.delete_subscription()`: **Added**
* `plex_api.subscriptions.get_subscription()`: **Added**
* `plex_api.subscriptions.edit_subscription_preferences()`: **Added**
* `plex_api.subscriptions.reorder_subscription()`: **Added**
* `plex_api.transcoder.transcode_image()`: **Added**
* `plex_api.transcoder.make_decision()`: **Added**
* `plex_api.transcoder.trigger_fallback()`: **Added**
* `plex_api.transcoder.transcode_subtitles()`: **Added**
* `plex_api.transcoder.start_transcode_session()`: **Added**
* `plex_api.playlist.list_playlists()`: **Added**
* `plex_api.playlist.get_playlist()`: **Added**
* `plex_api.playlist.get_playlist_items()`: **Added**
* `plex_api.library_playlists.create_playlist()`: **Added**
* `plex_api.library_playlists.upload_playlist()`: **Added**
* `plex_api.library_playlists.delete_playlist()`: **Added**
* `plex_api.library_playlists.update_playlist()`: **Added**
* `plex_api.library_playlists.get_playlist_generators()`: **Added**
* `plex_api.library_playlists.clear_playlist_items()`: **Added**
* `plex_api.library_playlists.add_playlist_items()`: **Added**
* `plex_api.library_playlists.delete_playlist_item()`: **Added**
* `plex_api.library_playlists.get_playlist_generator()`: **Added**
* `plex_api.library_playlists.modify_playlist_generator()`: **Added**
* `plex_api.library_playlists.get_playlist_generator_items()`: **Added**
* `plex_api.library_playlists.move_playlist_item()`: **Added**
* `plex_api.library_playlists.refresh_playlist()`: **Added**
* `plex_api.play_queue.create_play_queue()`: **Added**
* `plex_api.play_queue.get_play_queue()`: **Added**
* `plex_api.play_queue.add_to_play_queue()`: **Added**
* `plex_api.play_queue.clear_play_queue()`: **Added**
* `plex_api.play_queue.reset_play_queue()`: **Added**
* `plex_api.play_queue.shuffle()`: **Added**
* `plex_api.play_queue.unshuffle()`: **Added**
* `plex_api.play_queue.delete_play_queue_item()`: **Added**
* `plex_api.play_queue.move_play_queue_item()`: **Added**
* `plex_api.ultra_blur.get_colors()`: **Added**
* `plex_api.ultra_blur.get_image()`: **Added**
* `plex_api.status.list_sessions()`: **Added**
* `plex_api.status.get_background_tasks()`: **Added**
* `plex_api.status.list_playback_history()`: **Added**
* `plex_api.status.terminate_session()`: **Added**
* `plex_api.status.delete_history()`: **Added**
* `plex_api.status.get_history_item()`: **Added**
* `plex_api.updater.check_updates()`: **Added**
* `plex_api.updater.get_updates_status()`: **Added**
* `plex_api.content.get_collection_items()`: **Added**
* `plex_api.content.get_metadata_item()`: **Added**
* `plex_api.content.get_albums()`: **Added**
* `plex_api.content.list_content()`: **Added**
* `plex_api.content.get_all_leaves()`: **Added**
* `plex_api.content.get_arts()`: **Added**
* `plex_api.content.get_categories()`: **Added**
* `plex_api.content.get_cluster()`: **Added**
* `plex_api.content.get_sonic_path()`: **Added**
* `plex_api.content.get_folders()`: **Added**
* `plex_api.content.list_moments()`: **Added**
* `plex_api.content.get_sonically_similar()`: **Added**
* `plex_api.content.get_collection_image()`: **Added**
* `plex_api.library_collections.add_collection_items()`: **Added**
* `plex_api.library_collections.delete_collection_item()`: **Added**
* `plex_api.library_collections.move_collection_item()`: **Added**
* `plex_api.server.get_server_capabilities()`: **Deleted** **Breaking** ⚠️
* `plex_api.server.get_server_preferences()`: **Deleted** **Breaking** ⚠️
* `plex_api.server.get_available_clients()`: **Deleted** **Breaking** ⚠️
* `plex_api.server.get_devices()`: **Deleted** **Breaking** ⚠️
* `plex_api.server.get-server-identity()`: **Deleted** **Breaking** ⚠️
* `plex_api.server.get_my_plex_account()`: **Deleted** **Breaking** ⚠️
* `plex_api.server.get_resized_photo()`: **Deleted** **Breaking** ⚠️
* `plex_api.server.get-media-providers()`: **Deleted** **Breaking** ⚠️
* `plex_api.server.get_server_list()`: **Deleted** **Breaking** ⚠️
* `plex_api.media.mark_played()`: **Deleted** **Breaking** ⚠️
* `plex_api.media.mark_unplayed()`: **Deleted** **Breaking** ⚠️
* `plex_api.media.update_play_progress()`: **Deleted** **Breaking** ⚠️
* `plex_api.media.get-banner-image()`: **Deleted** **Breaking** ⚠️
* `plex_api.media.get-thumb-image()`: **Deleted** **Breaking** ⚠️
* `plex_api.video.get_timeline()`: **Deleted** **Breaking** ⚠️
* `plex_api.video.start_universal_transcode()`: **Deleted** **Breaking** ⚠️
* `plex_api.activities.get_server_activities()`: **Deleted** **Breaking** ⚠️
* `plex_api.activities.cancel_server_activities()`: **Deleted** **Breaking** ⚠️
* `plex_api.butler.get_butler_tasks()`: **Deleted** **Breaking** ⚠️
* `plex_api.butler.start_all_tasks()`: **Deleted** **Breaking** ⚠️
* `plex_api.butler.stop_all_tasks()`: **Deleted** **Breaking** ⚠️
* `plex_api.plex.get_companions_data()`: **Deleted** **Breaking** ⚠️
* `plex_api.plex.get_user_friends()`: **Deleted** **Breaking** ⚠️
* `plex_api.plex.get_geo_data()`: **Deleted** **Breaking** ⚠️
* `plex_api.plex.get_home_data()`: **Deleted** **Breaking** ⚠️
* `plex_api.plex.get-server-resources()`: **Deleted** **Breaking** ⚠️
* `plex_api.plex.get_pin()`: **Deleted** **Breaking** ⚠️
* `plex_api.plex.get_token_by_pin_id()`: **Deleted** **Breaking** ⚠️
* `plex_api.hubs.get_global_hubs()`: **Deleted** **Breaking** ⚠️
* `plex_api.hubs.get-recently-added()`: **Deleted** **Breaking** ⚠️
* `plex_api.hubs.get_library_hubs()`: **Deleted** **Breaking** ⚠️
* `plex_api.search.perform_search()`: **Deleted** **Breaking** ⚠️
* `plex_api.search.perform_voice_search()`: **Deleted** **Breaking** ⚠️
* `plex_api.search.get_search_results()`: **Deleted** **Breaking** ⚠️
* `plex_api.library.get_file_hash()`: **Deleted** **Breaking** ⚠️
* `plex_api.library.get-recently-added-library()`: **Deleted** **Breaking** ⚠️
* `plex_api.library.get-all-libraries()`: **Deleted** **Breaking** ⚠️
* `plex_api.library.get-library-details()`: **Deleted** **Breaking** ⚠️
* `plex_api.library.delete_library()`: **Deleted** **Breaking** ⚠️
* `plex_api.library.get-library-items()`: **Deleted** **Breaking** ⚠️
* `plex_api.library.get-library-sections-all()`: **Deleted** **Breaking** ⚠️
* `plex_api.library.get-refresh-library-metadata()`: **Deleted** **Breaking** ⚠️
* `plex_api.library.get-search-library()`: **Deleted** **Breaking** ⚠️
* `plex_api.library.get-genres-library()`: **Deleted** **Breaking** ⚠️
* `plex_api.library.get-countries-library()`: **Deleted** **Breaking** ⚠️
* `plex_api.library.get-actors-library()`: **Deleted** **Breaking** ⚠️
* `plex_api.library.get-search-all-libraries()`: **Deleted** **Breaking** ⚠️
* `plex_api.library.get-media-meta-data()`: **Deleted** **Breaking** ⚠️
* `plex_api.library.get-media-arts()`: **Deleted** **Breaking** ⚠️
* `plex_api.library.post-media-arts()`: **Deleted** **Breaking** ⚠️
* `plex_api.library.get-media-posters()`: **Deleted** **Breaking** ⚠️
* `plex_api.library.post-media-poster()`: **Deleted** **Breaking** ⚠️
* `plex_api.library.get_metadata_children()`: **Deleted** **Breaking** ⚠️
* `plex_api.library.get_top_watched_content()`: **Deleted** **Breaking** ⚠️
* `plex_api.watchlist.get-watch-list()`: **Deleted** **Breaking** ⚠️
* `plex_api.log.log_line()`: **Deleted** **Breaking** ⚠️
* `plex_api.log.log_multi_line()`: **Deleted** **Breaking** ⚠️
* `plex_api.log.enable_paper_trail()`: **Deleted** **Breaking** ⚠️
* `plex_api.playlists.create_playlist()`: **Deleted** **Breaking** ⚠️
* `plex_api.playlists.get_playlists()`: **Deleted** **Breaking** ⚠️
* `plex_api.playlists.get_playlist()`: **Deleted** **Breaking** ⚠️
* `plex_api.playlists.delete_playlist()`: **Deleted** **Breaking** ⚠️
* `plex_api.playlists.update_playlist()`: **Deleted** **Breaking** ⚠️
* `plex_api.playlists.get_playlist_contents()`: **Deleted** **Breaking** ⚠️
* `plex_api.playlists.clear_playlist_contents()`: **Deleted** **Breaking** ⚠️
* `plex_api.playlists.add_playlist_contents()`: **Deleted** **Breaking** ⚠️
* `plex_api.playlists.upload_playlist()`: **Deleted** **Breaking** ⚠️
* `plex_api.authentication.get_transient_token()`: **Deleted** **Breaking** ⚠️
* `plex_api.authentication.get_source_connection_information()`: **Deleted** **Breaking** ⚠️
* `plex_api.authentication.get_token_details()`: **Deleted** **Breaking** ⚠️
* `plex_api.authentication.post-users-sign-in-data()`: **Deleted** **Breaking** ⚠️
* `plex_api.statistics.get_statistics()`: **Deleted** **Breaking** ⚠️
* `plex_api.statistics.get_resources_statistics()`: **Deleted** **Breaking** ⚠️
* `plex_api.statistics.get_bandwidth_statistics()`: **Deleted** **Breaking** ⚠️
* `plex_api.sessions.get_sessions()`: **Deleted** **Breaking** ⚠️
* `plex_api.sessions.get_session_history()`: **Deleted** **Breaking** ⚠️
* `plex_api.sessions.get_transcode_sessions()`: **Deleted** **Breaking** ⚠️
* `plex_api.sessions.stop_transcode_session()`: **Deleted** **Breaking** ⚠️
* `plex_api.updater.get_update_status()`: **Deleted** **Breaking** ⚠️
* `plex_api.updater.check_for_updates()`: **Deleted** **Breaking** ⚠️
* `plex_api.users.get-users()`: **Deleted** **Breaking** ⚠️
2025-10-12 06:48:43 +00:00

210 KiB
Raw Blame History

Library

(library)

Overview

Library endpoints which are outside of the Media Provider API. Typically this is manipulation of the library (adding/removing sections, modifying preferences, etc).

Available Operations

get_library_items

Request all metadata items according to a query.

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.get_library_items(request={})

    assert res.media_container_with_metadata is not None

    # Handle response
    print(res.media_container_with_metadata)

Parameters

Parameter Type Required Description
request operations.GetLibraryItemsRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetLibraryItemsResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

delete_caches

Delete the hub caches so they are recomputed on next request

Example Usage

from plex_api_client import PlexAPI


with PlexAPI(
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.delete_caches()

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.DeleteCachesResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

clean_bundles

Clean out any now unused bundles. Bundles can become unused when media is deleted

Example Usage

from plex_api_client import PlexAPI


with PlexAPI(
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.clean_bundles()

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.CleanBundlesResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

ingest_transient_item

This endpoint takes a file path specified in the url parameter, matches it using the scanner's match mechanism, downloads rich metadata, and then ingests the item as a transient item (without a library section). In the case where the file represents an episode, the entire tree (show, season, and episode) is added as transient items. At this time, movies and episodes are the only supported types, which are gleaned automatically from the file path. Note that any of the parameters passed to the metadata details endpoint (e.g. includeExtras=1) work here.

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components, operations


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.ingest_transient_item(request=operations.IngestTransientItemRequest(
        url="file:///storage%2Femulated%2F0%2FArcher-S01E01.mkv",
        virtual_file_path="/Avatar.mkv",
        compute_hashes=components.BoolInt.ONE,
        ingest_non_matches=components.BoolInt.ONE,
    ))

    assert res.media_container_with_metadata is not None

    # Handle response
    print(res.media_container_with_metadata)

Parameters

Parameter Type Required Description
request operations.IngestTransientItemRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.IngestTransientItemResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

get_library_matches

The matches endpoint is used to match content external to the library with content inside the library. This is done by passing a series of semantic "hints" about the content (its type, name, or release year). Each type (e.g. movie) has a canonical set of minimal required hints. This ability to match content is useful in a variety of scenarios. For example, in the DVR, the EPG uses the endpoint to match recording rules against airing content. And in the cloud, the UMP uses the endpoint to match up a piece of media with rich metadata. The endpoint response can including multiple matches, if there is ambiguity, each one containing a score from 0 to 100. For somewhat historical reasons, anything over 85 is considered a positive match (we prefer false negatives over false positives in general for matching). The guid hint is somewhat special, in that it generally represents a unique identity for a piece of media (e.g. the IMDB ttXXX) identifier, in contrast with other hints which can be much more ambiguous (e.g. a title of Jane Eyre, which could refer to the 1943 or the 2011 version). Episodes require either a season/episode pair, or an air date (or both). Either the path must be sent, or the show title

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components, operations


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.get_library_matches(request=operations.GetLibraryMatchesRequest(
        include_full_metadata=components.BoolInt.ONE,
        include_ancestor_metadata=components.BoolInt.ONE,
        include_alternate_metadata_sources=components.BoolInt.ONE,
    ))

    assert res.media_container_with_metadata is not None

    # Handle response
    print(res.media_container_with_metadata)

Parameters

Parameter Type Required Description
request operations.GetLibraryMatchesRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetLibraryMatchesResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

optimize_database

Initiate optimize on the database.

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.optimize_database(request={
        "async_": components.BoolInt.ONE,
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.OptimizeDatabaseRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.OptimizeDatabaseResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

get_random_artwork

Get random artwork across sections. This is commonly used for a screensaver.

This retrieves 100 random artwork paths in the specified sections and returns them. Restrictions are put in place to not return artwork for items the user is not allowed to access. Artwork will be for Movies, Shows, and Artists only.

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.get_random_artwork(request={
        "sections": [
            5,
            6,
        ],
    })

    assert res.media_container_with_artwork is not None

    # Handle response
    print(res.media_container_with_artwork)

Parameters

Parameter Type Required Description
request operations.GetRandomArtworkRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetRandomArtworkResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

get_sections

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).

Example Usage

from plex_api_client import PlexAPI


with PlexAPI(
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.get_sections()

    assert res.object is not None

    # Handle response
    print(res.object)

Parameters

Parameter Type Required Description
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetSectionsResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

add_section

Add a new library section to the server

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components, operations


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.add_section(request=operations.AddSectionRequest(
        name="<value>",
        type=39544,
        agent="<value>",
        language="<value>",
        locations=[
            "O:\fatboy\\Media\\Ripped\\Music",
            "O:\fatboy\\Media\\My Music",
        ],
        prefs=operations.QueryParamPrefs(),
        relative=components.BoolInt.ONE,
        import_fromi_tunes=components.BoolInt.ONE,
    ))

    assert res.slash_get_responses_200 is not None

    # Handle response
    print(res.slash_get_responses_200)

Parameters

Parameter Type Required Description
request operations.AddSectionRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.AddSectionResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

stop_all_refreshes

Stop all refreshes across all sections

Example Usage

from plex_api_client import PlexAPI


with PlexAPI(
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.stop_all_refreshes()

    assert res.request_handler_slash_get_responses_200 is not None

    # Handle response
    print(res.request_handler_slash_get_responses_200)

Parameters

Parameter Type Required Description
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.StopAllRefreshesResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

get_sections_prefs

Get a section's preferences for a metadata type

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.get_sections_prefs(request={
        "type": 460221,
    })

    assert res.request_handler_slash_get_responses_200 is not None

    # Handle response
    print(res.request_handler_slash_get_responses_200)

Parameters

Parameter Type Required Description
request operations.GetSectionsPrefsRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetSectionsPrefsResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

refresh_sections_metadata

Tell PMS to refresh all section metadata

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.refresh_sections_metadata(request={})

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.RefreshSectionsMetadataRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.RefreshSectionsMetadataResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

get_tags

Get all library tags of a type

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.get_tags(request={})

    assert res.object is not None

    # Handle response
    print(res.object)

Parameters

Parameter Type Required Description
request operations.GetTagsRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetTagsResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

delete_metadata_item

Delete a single metadata item from the library, deleting media as well

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.delete_metadata_item(request={
        "ids": "<value>",
        "proxy": components.BoolInt.ONE,
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.DeleteMetadataItemRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.DeleteMetadataItemResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

edit_metadata_item

Edit metadata items setting fields

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.edit_metadata_item(request={
        "ids": [
            "<value 1>",
            "<value 2>",
        ],
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.EditMetadataItemRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.EditMetadataItemResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

detect_ads

Start the detection of ads in a metadata item

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.detect_ads(request={
        "ids": "<value>",
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.DetectAdsRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.DetectAdsResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

get_all_item_leaves

Get the leaves for a metadata item such as the episodes in a show

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.get_all_item_leaves(request={
        "ids": "<value>",
    })

    assert res.media_container_with_metadata is not None

    # Handle response
    print(res.media_container_with_metadata)

Parameters

Parameter Type Required Description
request operations.GetAllItemLeavesRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetAllItemLeavesResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

analyze_metadata

Start the analysis of a metadata item

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.analyze_metadata(request={
        "ids": "<value>",
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.AnalyzeMetadataRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.AnalyzeMetadataResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

generate_thumbs

Start the chapter thumb generation for an item

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.generate_thumbs(request={
        "ids": "<value>",
        "force": components.BoolInt.ONE,
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.GenerateThumbsRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GenerateThumbsResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

detect_credits

Start credit detection on a metadata item

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components, operations


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.detect_credits(request=operations.DetectCreditsRequest(
        ids="<value>",
        force=components.BoolInt.ONE,
        manual=components.BoolInt.ONE,
    ))

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.DetectCreditsRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.DetectCreditsResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

get_extras

Get the extras for a metadata item

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.get_extras(request={
        "ids": "<value>",
    })

    assert res.media_container_with_metadata is not None

    # Handle response
    print(res.media_container_with_metadata)

Parameters

Parameter Type Required Description
request operations.GetExtrasRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetExtrasResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

add_extras

Add an extra to a metadata item

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.add_extras(request={
        "ids": "<value>",
        "url": "https://super-mortise.biz/",
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.AddExtrasRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.AddExtrasResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

get_file

Get a bundle file for a metadata or media item. This is either an image or a mp3 (for a show's theme)

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.get_file(request={
        "ids": "<value>",
    })

    assert res.two_hundred_audio_mpeg3_response_stream is not None

    # Handle response
    print(res.two_hundred_audio_mpeg3_response_stream)

Parameters

Parameter Type Required Description
request operations.GetFileRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetFileResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

start_bif_generation

Start the indexing (BIF generation) of an item

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.start_bif_generation(request={
        "ids": "<value>",
        "force": components.BoolInt.ONE,
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.StartBifGenerationRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.StartBifGenerationResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

detect_intros

Start the detection of intros in a metadata item

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.detect_intros(request={
        "ids": "<value>",
        "force": components.BoolInt.ONE,
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.DetectIntrosRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.DetectIntrosResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

create_marker

Create a marker for this user on the metadata item

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.create_marker(request={
        "ids": "<value>",
        "type": 248391,
        "start_time_offset": 535191,
        "attributes": {},
    })

    assert res.object is not None

    # Handle response
    print(res.object)

Parameters

Parameter Type Required Description
request operations.CreateMarkerRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.CreateMarkerResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

match_item

Match a metadata item to a guid

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.match_item(request={
        "ids": "<value>",
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.MatchItemRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.MatchItemResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

list_matches

Get the list of metadata matches for a metadata item

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.list_matches(request={
        "ids": "<value>",
        "manual": components.BoolInt.ONE,
    })

    assert res.media_container_with_metadata is not None

    # Handle response
    print(res.media_container_with_metadata)

Parameters

Parameter Type Required Description
request operations.ListMatchesRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.ListMatchesResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

merge_items

Merge a metadata item with other items

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.merge_items(request={
        "ids_path_parameter": "<value>",
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.MergeItemsRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.MergeItemsResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

list_sonically_similar

Get the nearest tracks, sonically, to the provided track

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.list_sonically_similar(request={
        "ids": "<value>",
    })

    assert res.media_container_with_metadata is not None

    # Handle response
    print(res.media_container_with_metadata)

Parameters

Parameter Type Required Description
request operations.ListSonicallySimilarRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.ListSonicallySimilarResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

set_item_preferences

Set the preferences on a metadata item

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.set_item_preferences(request={
        "ids": "<value>",
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.SetItemPreferencesRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.SetItemPreferencesResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

refresh_items_metadata

Refresh a metadata item from the agent

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.refresh_items_metadata(request={
        "ids": "<value>",
        "mark_updated": components.BoolInt.ONE,
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.RefreshItemsMetadataRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.RefreshItemsMetadataResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

Get a hub of related items to a metadata item

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.get_related_items(request={
        "ids": "<value>",
    })

    assert res.object is not None

    # Handle response
    print(res.object)

Parameters

Parameter Type Required Description
request operations.GetRelatedItemsRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetRelatedItemsResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

list_similar

Get a list of similar items to a metadata item

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.list_similar(request={
        "ids": "<value>",
    })

    assert res.media_container_with_metadata is not None

    # Handle response
    print(res.media_container_with_metadata)

Parameters

Parameter Type Required Description
request operations.ListSimilarRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.ListSimilarResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

split_item

Split a metadata item into multiple items

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.split_item(request={
        "ids": "<value>",
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.SplitItemRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.SplitItemResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

add_subtitles

Add a subtitle to a metadata item

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components, operations


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.add_subtitles(request=operations.AddSubtitlesRequest(
        ids="<value>",
        forced=components.BoolInt.ONE,
        hearing_impaired=components.BoolInt.ONE,
    ))

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.AddSubtitlesRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.AddSubtitlesResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

get_item_tree

Get a tree of metadata items, such as the seasons/episodes of a show

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.get_item_tree(request={
        "ids": "<value>",
    })

    assert res.media_container_with_nested_metadata is not None

    # Handle response
    print(res.media_container_with_nested_metadata)

Parameters

Parameter Type Required Description
request operations.GetItemTreeRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetItemTreeResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

unmatch

Unmatch a metadata item to info fetched from the agent

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.unmatch(request={
        "ids": "<value>",
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.UnmatchRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.UnmatchResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

list_top_users

Get the list of users which have played this item starting with the most

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.list_top_users(request={
        "ids": "<value>",
    })

    assert res.object is not None

    # Handle response
    print(res.object)

Parameters

Parameter Type Required Description
request operations.ListTopUsersRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.ListTopUsersResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

detect_voice_activity

Start the detection of voice in a metadata item

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components, operations


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.detect_voice_activity(request=operations.DetectVoiceActivityRequest(
        ids="<value>",
        force=components.BoolInt.ONE,
        manual=components.BoolInt.ONE,
    ))

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.DetectVoiceActivityRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.DetectVoiceActivityResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

get_augmentation_status

Get augmentation status and potentially wait for completion

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.get_augmentation_status(request={
        "augmentation_id": "<id>",
        "wait": components.BoolInt.ONE,
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.GetAugmentationStatusRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetAugmentationStatusResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

set_stream_selection

Set which streams (audio/subtitle) are selected by this user

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.set_stream_selection(request={
        "part_id": 360489,
        "all_parts": components.BoolInt.ONE,
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.SetStreamSelectionRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.SetStreamSelectionResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

get_person

Get details for a single actor.

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.get_person(request={
        "person_id": "<id>",
    })

    assert res.object is not None

    # Handle response
    print(res.object)

Parameters

Parameter Type Required Description
request operations.GetPersonRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetPersonResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

list_person_media

Get all the media for a single actor.

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.list_person_media(request={
        "person_id": "<id>",
    })

    assert res.media_container_with_metadata is not None

    # Handle response
    print(res.media_container_with_metadata)

Parameters

Parameter Type Required Description
request operations.ListPersonMediaRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.ListPersonMediaResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

delete_library_section

Delete a library section by id

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.delete_library_section(request={
        "section_id": "<id>",
        "async_": components.BoolInt.ONE,
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.DeleteLibrarySectionRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.DeleteLibrarySectionResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

get_library_details

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. It often contains a list of Directory metadata objects: These used to be used by clients to build a menuing system.

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.get_library_details(request={
        "section_id": "<id>",
        "include_details": components.BoolInt.ONE,
    })

    assert res.object is not None

    # Handle response
    print(res.object)

Parameters

Parameter Type Required Description
request operations.GetLibraryDetailsRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetLibraryDetailsResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

edit_section

Edit a library section by id setting parameters

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.edit_section(request={
        "section_id": "<id>",
        "agent": "<value>",
        "locations": [
            "O:\fatboy\\Media\\Ripped\\Music",
            "O:\fatboy\\Media\\My Music",
        ],
        "prefs": {},
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.EditSectionRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.EditSectionResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

update_items

This endpoint takes an large possible set of values. Here are some examples.

  • Parameters, extra documentation

    • artist.title.value
      • When used with track, both artist.title.value and album.title.value need to be specified
    • title.value usage
      • Summary
        • Tracks always rename and never merge
        • Albums and Artists
          • if single item and item without title does not exist, it is renamed.
          • if single item and item with title does exist they are merged.
          • if multiple they are always merged.
      • Tracks
        • Works as expected will update the track's title
        • Single track: /library/sections/{id}/all?type=10&id=42&title.value=NewName
        • Multiple tracks: /library/sections/{id}/all?type=10&id=42,43,44&title.value=NewName
        • All tracks: /library/sections/{id}/all?type=10&title.value=NewName
      • Albums
        • Functionality changes depending on the existence of an album with the same title
        • Album exists
          • Single album: /library/sections/{id}/all?type=9&id=42&title.value=Album 2
            • Album with id 42 is merged into album titled "Album 2"
          • Multiple/All albums: /library/sections/{id}/all?type=9&title.value=Moo Album
            • All albums are merged into the existing album titled "Moo Album"
        • Album does not exist
          • Single album: /library/sections/{id}/all?type=9&id=42&title.value=NewAlbumTitle
            • Album with id 42 has title modified to "NewAlbumTitle"
          • Multiple/All albums: /library/sections/{id}/all?type=9&title.value=NewAlbumTitle
            • All albums are merged into a new album with title="NewAlbumTitle"
      • Artists
        • Functionaly changes depending on the existence of an artist with the same title.
        • Artist exists
          • Single artist: /library/sections/{id}/all?type=8&id=42&title.value=Artist 2
            • Artist with id 42 is merged into existing artist titled "Artist 2"
          • Multiple/All artists: /library/sections/{id}/all?type=8&title.value=Artist 3
            • All artists are merged into the existing artist titled "Artist 3"
        • Artist does not exist
          • Single artist: /library/sections/{id}/all?type=8&id=42&title.value=NewArtistTitle
            • Artist with id 42 has title modified to "NewArtistTitle"
          • Multiple/All artists: /library/sections/{id}/all?type=8&title.value=NewArtistTitle
            • All artists are merged into a new artist with title="NewArtistTitle"
  • Notes

    • Technically square brackets are not allowed in an URI except the Internet Protocol Literal Address
    • RFC3513: A host identified by an Internet Protocol literal address, version 6 [RFC3513] or later, is distinguished by enclosing the IP literal within square brackets ("[" and "]"). This is the only place where square bracket characters are allowed in the URI syntax.
    • Escaped square brackets are allowed, but don't render well

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.update_items(request={
        "section_id": "<id>",
        "field_locked": components.BoolInt.ONE,
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.UpdateItemsRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.UpdateItemsResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

start_analysis

Start analysis of all items in a section. If BIF generation is enabled, this will also be started on this section

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.start_analysis(request={
        "section_id": 158829,
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.StartAnalysisRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.StartAnalysisResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

autocomplete

The field to autocomplete on is specified by the {field}.query parameter. For example genre.query or title.query. Returns a set of items from the filtered items whose {field} starts with {field}.query. In the results, a {field}.queryRange will be present to express the range of the match

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.autocomplete(request={
        "section_id": 942007,
    })

    assert res.media_container_with_metadata is not None

    # Handle response
    print(res.media_container_with_metadata)

Parameters

Parameter Type Required Description
request operations.AutocompleteRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.AutocompleteResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

get_collections

Get all collections in a section

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.get_collections(request={
        "section_id": 348838,
    })

    assert res.media_container_with_metadata is not None

    # Handle response
    print(res.media_container_with_metadata)

Parameters

Parameter Type Required Description
request operations.GetCollectionsRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetCollectionsResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

get_common

Represents a "Common" item. It contains only the common attributes of the items selected by the provided filter Fields which are not common will be expressed in the mixedFields field

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.get_common(request={
        "section_id": 298154,
    })

    assert res.media_container_with_metadata is not None

    # Handle response
    print(res.media_container_with_metadata)

Parameters

Parameter Type Required Description
request operations.GetCommonRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetCommonResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

empty_trash

Empty trash in the section, permanently deleting media/metadata for missing media

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.empty_trash(request={
        "section_id": 30052,
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.EmptyTrashRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.EmptyTrashResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

get_section_filters

Get common filters on a section

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.get_section_filters(request={
        "section_id": 380557,
    })

    assert res.object is not None

    # Handle response
    print(res.object)

Parameters

Parameter Type Required Description
request operations.GetSectionFiltersRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetSectionFiltersResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

get_first_characters

Get list of first characters in this section

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.get_first_characters(request={
        "section_id": 3947,
    })

    assert res.object is not None

    # Handle response
    print(res.object)

Parameters

Parameter Type Required Description
request operations.GetFirstCharactersRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetFirstCharactersResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

delete_indexes

Delete all the indexes in a section

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.delete_indexes(request={
        "section_id": 588437,
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.DeleteIndexesRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.DeleteIndexesResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

delete_intros

Delete all the intro markers in a section

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.delete_intros(request={
        "section_id": 498656,
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.DeleteIntrosRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.DeleteIntrosResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

get_section_preferences

Get the prefs for a section by id and potentially overriding the agent

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.get_section_preferences(request={
        "section_id": 754869,
    })

    assert res.media_container_with_settings is not None

    # Handle response
    print(res.media_container_with_settings)

Parameters

Parameter Type Required Description
request operations.GetSectionPreferencesRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetSectionPreferencesResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

set_section_preferences

Set the prefs for a section by id

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.set_section_preferences(request={
        "section_id": 349936,
        "prefs": {},
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.SetSectionPreferencesRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.SetSectionPreferencesResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

cancel_refresh

Cancel the refresh of a section

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.cancel_refresh(request={
        "section_id": 326852,
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.CancelRefreshRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.CancelRefreshResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

refresh_section

Start a refresh of this section

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.refresh_section(request={
        "section_id": 450300,
        "force": components.BoolInt.ONE,
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.RefreshSectionRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.RefreshSectionResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

get_available_sorts

Get the sort mechanisms available in a section

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.get_available_sorts(request={
        "section_id": 212498,
    })

    assert res.object is not None

    # Handle response
    print(res.object)

Parameters

Parameter Type Required Description
request operations.GetAvailableSortsRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetAvailableSortsResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

get_stream_levels

The the loudness of a stream in db, one entry per 100ms

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.get_stream_levels(request={
        "stream_id": 447611,
    })

    assert res.object is not None

    # Handle response
    print(res.object)

Parameters

Parameter Type Required Description
request operations.GetStreamLevelsRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetStreamLevelsResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

get_stream_loudness

The the loudness of a stream in db, one number per line, one entry per 100ms

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.get_stream_loudness(request={
        "stream_id": 277271,
    })

    assert res.res is not None

    # Handle response
    print(res.res)

Parameters

Parameter Type Required Description
request operations.GetStreamLoudnessRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetStreamLoudnessResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

get_chapter_image

Get a single chapter image for a piece of media

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.get_chapter_image(request={
        "media_id": 892563,
        "chapter": 48348,
    })

    assert res.response_stream is not None

    # Handle response
    print(res.response_stream)

Parameters

Parameter Type Required Description
request operations.GetChapterImageRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetChapterImageResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

set_item_artwork

Set the artwork, thumb, element for a metadata item Generally only the admin can perform this action. The exception is if the metadata is a playlist created by the user

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components, operations


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.set_item_artwork(request={
        "ids": "<value>",
        "element": operations.Element.BANNER,
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.SetItemArtworkRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.SetItemArtworkResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

update_item_artwork

Set the artwork, thumb, element for a metadata item Generally only the admin can perform this action. The exception is if the metadata is a playlist created by the user

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components, operations


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.update_item_artwork(request={
        "ids": "<value>",
        "element": operations.PathParamElement.CLEAR_LOGO,
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.UpdateItemArtworkRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.UpdateItemArtworkResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

delete_marker

Delete a marker for this user on the metadata item

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.delete_marker(request={
        "ids": "<value>",
        "marker": "<value>",
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.DeleteMarkerRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.DeleteMarkerResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

edit_marker

Edit a marker for this user on the metadata item

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.edit_marker(request={
        "ids": "<value>",
        "marker": "<value>",
        "type": 884347,
        "start_time_offset": 517251,
        "attributes": {},
    })

    assert res.post_responses_200 is not None

    # Handle response
    print(res.post_responses_200)

Parameters

Parameter Type Required Description
request operations.EditMarkerRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.EditMarkerResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

delete_media_item

Delete a single media from a metadata item in the library

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.delete_media_item(request={
        "ids": "<value>",
        "media_item": "<value>",
        "proxy": components.BoolInt.ONE,
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.DeleteMediaItemRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.DeleteMediaItemResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

get_part_index

Get BIF index for a part by index type

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components, operations


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.get_part_index(request={
        "part_id": 724750,
        "index": operations.Index.SD,
    })

    assert res.response_stream is not None

    # Handle response
    print(res.response_stream)

Parameters

Parameter Type Required Description
request operations.GetPartIndexRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetPartIndexResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

delete_collection

Delete a library collection from the PMS

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.delete_collection(request={
        "section_id": 283619,
        "collection_id": 680895,
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.DeleteCollectionRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.DeleteCollectionResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

get_section_image

Get a composite image of images in this section

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.get_section_image(request={
        "section_id": 925611,
        "updated_at": 117413,
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.GetSectionImageRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetSectionImageResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

delete_stream

Delete a stream. Only applies to downloaded subtitle streams or a sidecar subtitle when media deletion is enabled.

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.delete_stream(request={
        "stream_id": 841510,
        "ext": "<value>",
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.DeleteStreamRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.DeleteStreamResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

get_stream

Get a stream (such as a sidecar subtitle stream)

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.get_stream(request={
        "stream_id": 314506,
        "ext": "<value>",
        "auto_adjust_subtitle": components.BoolInt.ONE,
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.GetStreamRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetStreamResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

set_stream_offset

Set a stream offset in ms. This may not be respected by all clients

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.set_stream_offset(request={
        "stream_id": 606295,
        "ext": "<value>",
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.SetStreamOffsetRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.SetStreamOffsetResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

get_item_artwork

Get the artwork, thumb, element for a metadata item

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components, operations


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.get_item_artwork(request={
        "ids": "<value>",
        "element": operations.GetItemArtworkPathParamElement.POSTER,
        "timestamp": 999555,
    })

    assert res.two_hundred_audio_mpeg3_response_stream is not None

    # Handle response
    print(res.two_hundred_audio_mpeg3_response_stream)

Parameters

Parameter Type Required Description
request operations.GetItemArtworkRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetItemArtworkResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

get_media_part

Get a media part for streaming or download.

  • streaming: This is the default scenario. Bandwidth usage on this endpoint will be guaranteed (on the server's end) to be at least the bandwidth reservation given in the decision. If no decision exists, an ad-hoc decision will be created if sufficient bandwidth exists. Clients should not rely on ad-hoc decisions being made as this may be removed in the future.
  • download: Indicated if the query parameter indicates this is a download. Bandwidth will be prioritized behind playbacks and will get a fair share of what remains.

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.get_media_part(request={
        "part_id": 877105,
        "changestamp": 970622,
        "filename": "example.file",
        "download": components.BoolInt.ONE,
    })

    assert res is not None

    # Handle response
    print(res)

Parameters

Parameter Type Required Description
request operations.GetMediaPartRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetMediaPartResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*

get_image_from_bif

Extract an image from the BIF for a part at a particular offset

Example Usage

from plex_api_client import PlexAPI
from plex_api_client.models import components, operations


with PlexAPI(
    accepts=components.Accepts.APPLICATION_XML,
    client_identifier="abc123",
    product="Plex for Roku",
    version="2.4.1",
    platform="Roku",
    platform_version="4.3 build 1057",
    device="Roku 3",
    model="4200X",
    device_vendor="Roku",
    device_name="Living Room TV",
    marketplace="googlePlay",
    token="<YOUR_API_KEY_HERE>",
) as plex_api:

    res = plex_api.library.get_image_from_bif(request={
        "part_id": 304273,
        "index": operations.PathParamIndex.SD,
        "offset": 939569,
    })

    assert res.response_stream is not None

    # Handle response
    print(res.response_stream)

Parameters

Parameter Type Required Description
request operations.GetImageFromBifRequest ✔️ The request object to use for the request.
retries Optional[utils.RetryConfig] Configuration to override the default retry behavior of the client.

Response

operations.GetImageFromBifResponse

Errors

Error Type Status Code Content Type
errors.SDKError 4XX, 5XX */*