--- id: start-a-butler-tasks sidebar_label: Start a single Butler task hide_title: true hide_table_of_contents: true api: {"tags":["Butler"],"description":"This endpoint will attempt to start a single Butler task that is enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria:\n1. Any tasks not scheduled to run on the current day will be skipped.\n2. 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.\n3. 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.\n4. If we are outside the configured window, the task will start immediately.\n","operationId":"startAButlerTasks","parameters":[{"name":"taskName","description":"the name of the task to be started.","in":"path","schema":{"type":"string","enum":["BackupDatabase","BuildGracenoteCollections","CheckForUpdates","CleanOldBundles","CleanOldCacheFiles","DeepMediaAnalysis","GenerateAutoTags","GenerateChapterThumbs","GenerateMediaIndexFiles","OptimizeDatabase","RefreshLibraries","RefreshLocalMedia","RefreshPeriodicMetadata","UpgradeMediaAnalysis"]},"required":true}],"responses":{"200":{"description":"The task was started successfully"},"202":{"description":"The task was already running."},"401":{"description":"Unauthorized - Returned if the X-Plex-Token is missing from the header or query."}},"method":"post","path":"/butler/{taskName}","servers":[{"url":"{Protocol}://{Local IP}:{Port}","variables":{"Protocol":{"enum":["http","https"],"default":"http","description":"The protocl to use with your plex server"},"Local IP":{"default":"10.10.10.47","description":"The Local IP Address of your plex server"},"Port":{"default":"32400","description":"The port to access your plex server"}}},{"url":"https://plex.tv/api/v2"}],"security":[{"PlexToken":[]}],"securitySchemes":{"PlexToken":{"type":"apiKey","in":"header","name":"X-Plex-Token"}},"info":{"title":"Plex-API","description":"An Open API Spec for interacting with Plex.tv and Plex Servers","version":"0.0.1","contact":{"name":"Luke Hagar","email":"Lukeslakemail@gmail.com","url":"https://www.LukeHagar.com"}},"postman":{"name":"Start a single Butler task","description":{"content":"This endpoint will attempt to start a single Butler task that is enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria:\n1. Any tasks not scheduled to run on the current day will be skipped.\n2. 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.\n3. 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.\n4. If we are outside the configured window, the task will start immediately.\n","type":"text/plain"},"url":{"path":["butler",":taskName"],"host":["{{baseUrl}}"],"query":[],"variable":[{"disabled":false,"description":{"content":"(Required) the name of the task to be started.","type":"text/plain"},"type":"any","value":"","key":"taskName"}]},"method":"POST"}} sidebar_class_name: "post api-method" info_path: docs/plex/plex-api --- import ApiTabs from "@theme/ApiTabs"; import DiscriminatorTabs from "@theme/DiscriminatorTabs"; import MethodEndpoint from "@theme/ApiDemoPanel/MethodEndpoint"; import MimeTabs from "@theme/MimeTabs"; import ParamsItem from "@theme/ParamsItem"; import ResponseSamples from "@theme/ResponseSamples"; import SchemaItem from "@theme/SchemaItem"; import SchemaTabs from "@theme/SchemaTabs"; import TabItem from "@theme/TabItem";

Start a single Butler task

This endpoint will attempt to start a single Butler task that is enabled in the settings. Butler tasks normally run automatically during a time window configured on the server's Settings page but can be manually started using this endpoint. Tasks will run with the following criteria: 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.
Path Parameters
The task was started successfully
The task was already running.
Unauthorized - Returned if the X-Plex-Token is missing from the header or query.