Files
plexcsharp/docs/sdks/butler/README.md
speakeasybot c0836c3b34 ## Csharp SDK Changes:
* `PlexApi.LibraryPlaylists.AddPlaylistItems()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.LibraryPlaylists.ClearPlaylistItems()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.LibraryCollections.MoveCollectionItem()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.LibraryCollections.DeleteCollectionItem()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.LibraryCollections.AddCollectionItems()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Content.GetSonicallySimilar()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Butler.StopTask()`:  `request` **Changed** **Breaking** ⚠️
* `PlexApi.Butler.StartTask()`:  `request` **Changed** **Breaking** ⚠️
* `PlexApi.Content.GetSonicPath()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.DownloadQueue.GetItemDecision()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Hubs.GetAllHubs()`: 
  *  `request.OnlyTransient` **Changed**
  *  `response.mediaContainer.Hub.[].Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Hubs.GetContinueWatching()`:  `response.mediaContainer.Hub.[].Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Hubs.GetPromotedHubs()`:  `response.mediaContainer.Hub.[].Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Hubs.GetMetadataHubs()`: 
  *  `request.OnlyTransient` **Changed**
  *  `response.mediaContainer.Hub.[].Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Hubs.GetPostplayHubs()`: 
  *  `request.OnlyTransient` **Changed**
  *  `response.mediaContainer.Hub.[].Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Hubs.GetRelatedHubs()`: 
  *  `request.OnlyTransient` **Changed**
  *  `response.mediaContainer.Hub.[].Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Hubs.GetSectionHubs()`: 
  *  `request.OnlyTransient` **Changed**
  *  `response.mediaContainer.Hub.[].Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Content.GetAllLeaves()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Content.ListContent()`: 
  *  `request` **Changed**
  *  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Search.SearchHubs()`:  `response.mediaContainer.Hub.[].Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Content.GetAlbums()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.GetLibraryItems()`: 
  *  `request.MediaQuery` **Changed**
  *  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.IngestTransientItem()`: 
  *  `request` **Changed**
  *  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.GetLibraryMatches()`: 
  *  `request` **Changed** **Breaking** ⚠️
  *  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Content.GetMetadataItem()`: 
  *  `request` **Changed**
  *  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.GetSections()`:  `response.mediaContainer.Directory.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.AddSection()`: 
  *  `request` **Changed**
  *  `response.mediaContainer.Directory.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.GetTags()`: 
  *  `request.Type` **Changed** **Breaking** ⚠️
* `PlexApi.Content.GetCollectionItems()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.GetAllItemLeaves()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Status.ListSessions()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.PlayQueue.MovePlayQueueItem()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.GetExtras()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.PlayQueue.DeletePlayQueueItem()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.PlayQueue.Unshuffle()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.ListMatches()`: 
  *  `request.Manual` **Changed**
  *  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.ListSonicallySimilar()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.PlayQueue.Shuffle()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.GetRelatedItems()`:  `response.mediaContainer.Hub.[].Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.ListSimilar()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.PlayQueue.ResetPlayQueue()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.GetItemTree()`:  `response.mediaContainer.MetadataItem.[]` **Changed** **Breaking** ⚠️
* `PlexApi.PlayQueue.ClearPlayQueue()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.PlayQueue.AddToPlayQueue()`: 
  *  `request.Next` **Changed**
  *  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.GetCommon()`: 
  *  `request.MediaQuery` **Changed**
  *  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.GetPerson()`:  `response.mediaContainer.Directory.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.ListPersonMedia()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.PlayQueue.GetPlayQueue()`: 
  *  `request` **Changed**
  *  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.GetLibraryDetails()`: 
  *  `request.IncludeDetails` **Changed**
  *  `response.mediaContainer.Directory.[]` **Changed** **Breaking** ⚠️
* `PlexApi.LibraryPlaylists.MovePlaylistItem()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.Autocomplete()`: 
  *  `request.MediaQuery` **Changed**
  *  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Library.GetCollections()`: 
  *  `request.MediaQuery` **Changed**
  *  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.LibraryPlaylists.GetPlaylistGeneratorItems()`:  `response.mediaContainer.Metadata` **Changed** **Breaking** ⚠️
* `PlexApi.LibraryPlaylists.DeletePlaylistItem()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Search.VoiceSearchHubs()`: 
  *  `request.Type` **Changed** **Breaking** ⚠️
  *  `response.mediaContainer.Hub.[].Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.LibraryPlaylists.CreatePlaylist()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Playlist.GetPlaylistItems()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Playlist.GetPlaylist()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Playlist.ListPlaylists()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Collections.CreateCollection()`: 
  *  `request.Type` **Changed** **Breaking** ⚠️
  *  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.DvRs.TuneChannel()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.LiveTv.GetSessions()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.LiveTv.GetLiveTvSession()`:  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Transcoder.MakeDecision()`: 
  *  `request` **Changed**
  *  `response.mediaContainer.Metadata.[]` **Changed** **Breaking** ⚠️
* `PlexApi.Subscriptions.GetAllSubscriptions()`: 
  *  `request` **Changed**
  *  `response.mediaContainer.MediaSubscription.[].MediaGrabOperation.[].Metadata` **Changed** **Breaking** ⚠️
* `PlexApi.Subscriptions.CreateSubscription()`:  `response.mediaContainer.MediaSubscription.[].MediaGrabOperation.[].Metadata` **Changed** **Breaking** ⚠️
* `PlexApi.Subscriptions.GetScheduledRecordings()`:  `response.mediaContainer.MediaGrabOperation.[].Metadata` **Changed** **Breaking** ⚠️
* `PlexApi.Subscriptions.GetTemplate()`:  `response.mediaContainer.SubscriptionTemplate.[].MediaSubscription.[].MediaGrabOperation.[].Metadata` **Changed** **Breaking** ⚠️
* `PlexApi.Subscriptions.GetSubscription()`: 
  *  `request` **Changed**
  *  `response.mediaContainer.MediaSubscription.[].MediaGrabOperation.[].Metadata` **Changed** **Breaking** ⚠️
* `PlexApi.Subscriptions.EditSubscriptionPreferences()`:  `response.mediaContainer.MediaSubscription.[].MediaGrabOperation.[].Metadata` **Changed** **Breaking** ⚠️
* `PlexApi.Subscriptions.ReorderSubscription()`:  `response.mediaContainer.MediaSubscription.[].MediaGrabOperation.[].Metadata` **Changed** **Breaking** ⚠️
* `PlexApi.Library.AddSubtitles()`:  `request` **Changed**
* `PlexApi.LibraryPlaylists.UploadPlaylist()`: 
  *  `request.Force` **Changed**
* `PlexApi.Transcoder.TranscodeSubtitles()`:  `request` **Changed**
* `PlexApi.Transcoder.StartTranscodeSession()`:  `request` **Changed**
* `PlexApi.Library.GetMediaPart()`: 
  *  `request.Download` **Changed**
* `PlexApi.Library.DetectIntros()`: 
  *  `request.Force` **Changed**
* `PlexApi.Library.GetSectionImage()`: 
  *  `request.MediaQuery` **Changed**
* `PlexApi.Library.DeleteMediaItem()`: 
  *  `request.Proxy` **Changed**
* `PlexApi.Library.RefreshItemsMetadata()`: 
  *  `request.MarkUpdated` **Changed**
* `PlexApi.Authentication.Post-Users-Sign-In-Data()`: **Added**
* `PlexApi.Authentication.GetTokenDetails()`: **Added**
* `PlexApi.Library.DetectCredits()`:  `request` **Changed**
* `PlexApi.Library.SetStreamSelection()`: 
  *  `request.AllParts` **Changed**
* `PlexApi.Library.UpdateItems()`: 
  *  `request.Field.locked` **Changed**
* `PlexApi.PlayQueue.CreatePlayQueue()`:  `request` **Changed**
* `PlexApi.Library.DeleteLibrarySection()`: 
  *  `request.Async` **Changed**
* `PlexApi.Library.GetAugmentationStatus()`: 
  *  `request.Wait` **Changed**
* `PlexApi.Transcoder.TranscodeImage()`:  `request` **Changed**
* `PlexApi.Devices.ModifyDevice()`: 
  *  `request.Enabled` **Changed**
* `PlexApi.Library.DetectVoiceActivity()`:  `request` **Changed**
* `PlexApi.Library.GetStream()`: 
  *  `request.AutoAdjustSubtitle` **Changed**
* `PlexApi.Library.StartBifGeneration()`: 
  *  `request.Force` **Changed**
* `PlexApi.Library.GetFirstCharacters()`: 
  *  `request.MediaQuery` **Changed**
* `PlexApi.UltraBlur.GetImage()`: 
  *  `request.Noise` **Changed**
* `PlexApi.Library.GenerateThumbs()`: 
  *  `request.Force` **Changed**
* `PlexApi.Updater.ApplyUpdates()`:  `request` **Changed**
* `PlexApi.Updater.CheckUpdates()`: 
  *  `request.Download` **Changed**
* `PlexApi.Library.DeleteMetadataItem()`: 
  *  `request.Proxy` **Changed**
* `PlexApi.Library.OptimizeDatabase()`: 
  *  `request.Async` **Changed**
* `PlexApi.Library.RefreshSection()`: 
  *  `request.Force` **Changed**
* `PlexApi.Hubs.UpdateHubVisibility()`:  `request` **Changed**
* `PlexApi.Hubs.CreateCustomHub()`:  `request` **Changed**
* `PlexApi.DownloadQueue.AddDownloadQueueItems()`:  `request` **Changed**
* `PlexApi.Timeline.Report()`:  `request` **Changed**
* `PlexApi.General.GetSourceConnectionInformation()`: 
  *  `request.Refresh` **Changed**
* `PlexApi.Plex.Get-Server-Resources()`: **Added**
* `PlexApi.Users.Get-Users()`: **Added**
2025-12-01 00:32:52 +00:00

8.5 KiB

Butler

(Butler)

Overview

The butler is responsible for running periodic tasks. Some tasks run daily, others every few days, and some weekly. These includes database maintenance, metadata updating, thumbnail generation, media analysis, and other tasks.

Available Operations

StopTasks

This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue.

Example Usage

using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Components;

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

var res = await sdk.Butler.StopTasksAsync();

// handle response

Response

StopTasksResponse

Errors

Error Type Status Code Content Type
LukeHagar.PlexAPI.SDK.Models.Errors.SDKException 4XX, 5XX */*

GetTasks

Get the list of butler tasks and their scheduling

Example Usage

using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Components;

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

var res = await sdk.Butler.GetTasksAsync();

// handle response

Response

GetTasksResponse

Errors

Error Type Status Code Content Type
LukeHagar.PlexAPI.SDK.Models.Errors.SDKException 4XX, 5XX */*

StartTasks

This endpoint will attempt to start all Butler tasks that are enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria:

  1. Any tasks not scheduled to run on the current day will be skipped.
  2. If a task is configured to run at a random time during the configured window and we are outside that window, the task will start immediately.
  3. If a task is configured to run at a random time during the configured window and we are within that window, the task will be scheduled at a random time within the window.
  4. If we are outside the configured window, the task will start immediately.

Example Usage

using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Components;

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

var res = await sdk.Butler.StartTasksAsync();

// handle response

Response

StartTasksResponse

Errors

Error Type Status Code Content Type
LukeHagar.PlexAPI.SDK.Models.Errors.SDKException 4XX, 5XX */*

StopTask

This endpoint will stop a currently running task by name, or remove it from the list of scheduled tasks if it exists

Example Usage

using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Requests;

var sdk = new PlexAPI(
    accepts: LukeHagar.PlexAPI.SDK.Models.Components.Accepts.ApplicationXml,
    clientIdentifier: "abc123",
    product: "Plex for Roku",
    version: "2.4.1",
    platform: "Roku",
    platformVersion: "4.3 build 1057",
    device: "Roku 3",
    model: "4200X",
    deviceVendor: "Roku",
    deviceName: "Living Room TV",
    marketplace: "googlePlay",
    token: "<YOUR_API_KEY_HERE>"
);

StopTaskRequest req = new StopTaskRequest() {
    ButlerTask = ButlerTask.CleanOldBundles,
};

var res = await sdk.Butler.StopTaskAsync(req);

// handle response

Parameters

Parameter Type Required Description
request StopTaskRequest ✔️ The request object to use for the request.

Response

StopTaskResponse

Errors

Error Type Status Code Content Type
LukeHagar.PlexAPI.SDK.Models.Errors.SDKException 4XX, 5XX */*

StartTask

This endpoint will attempt to start a specific Butler task by name.

Example Usage

using LukeHagar.PlexAPI.SDK;
using LukeHagar.PlexAPI.SDK.Models.Components;
using LukeHagar.PlexAPI.SDK.Models.Requests;

var sdk = new PlexAPI(
    accepts: LukeHagar.PlexAPI.SDK.Models.Components.Accepts.ApplicationXml,
    clientIdentifier: "abc123",
    product: "Plex for Roku",
    version: "2.4.1",
    platform: "Roku",
    platformVersion: "4.3 build 1057",
    device: "Roku 3",
    model: "4200X",
    deviceVendor: "Roku",
    deviceName: "Living Room TV",
    marketplace: "googlePlay",
    token: "<YOUR_API_KEY_HERE>"
);

StartTaskRequest req = new StartTaskRequest() {
    ButlerTask = PathParamButlerTask.RefreshLocalMedia,
};

var res = await sdk.Butler.StartTaskAsync(req);

// handle response

Parameters

Parameter Type Required Description
request StartTaskRequest ✔️ The request object to use for the request.

Response

StartTaskResponse

Errors

Error Type Status Code Content Type
LukeHagar.PlexAPI.SDK.Models.Errors.SDKException 4XX, 5XX */*