PlexPHP
declare(strict_types=1);
require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
$response = $sdk->butler->stopAllTasks(
);
if ($response->statusCode === 200) {
// handle response
}require 'plex_ruby_sdk'
s = ::PlexRubySDK::PlexAPI.new(
security: Models::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
),
)
res = s.butler.stop_all_tasks()
if res.status_code == 200
# handle response
endpackage main
import(
"context"
"github.com/LukeHagar/plexgo"
"log"
)
func main() {
ctx := context.Background()
s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Butler.StopTasks(ctx)
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.StopTasksResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
StopTasksResponse res = sdk.butler().stopTasks()
.call();
// handle response
}
}import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.butler.stopTasks();
}
run();curl --request DELETE \
--url https://{IP-description}.{identifier}.plex.direct:{port}/butler \
--header 'X-Plex-Token: <api-key>'import requests
url = "https://{IP-description}.{identifier}.plex.direct:{port}/butler"
headers = {"X-Plex-Token": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'X-Plex-Token': '<api-key>'}};
fetch('https://{IP-description}.{identifier}.plex.direct:{port}/butler', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));Butler
Stop all Butler tasks
This endpoint will stop all currently running tasks and remove any scheduled tasks from the queue.
DELETE
/
butler
PlexPHP
declare(strict_types=1);
require 'vendor/autoload.php';
use LukeHagar\Plex_API;
$sdk = Plex_API\PlexAPI::builder()
->setSecurity(
'<YOUR_API_KEY_HERE>'
)
->build();
$response = $sdk->butler->stopAllTasks(
);
if ($response->statusCode === 200) {
// handle response
}require 'plex_ruby_sdk'
s = ::PlexRubySDK::PlexAPI.new(
security: Models::Shared::Security.new(
access_token: "<YOUR_API_KEY_HERE>",
),
)
res = s.butler.stop_all_tasks()
if res.status_code == 200
# handle response
endpackage main
import(
"context"
"github.com/LukeHagar/plexgo"
"log"
)
func main() {
ctx := context.Background()
s := plexgo.New(
plexgo.WithSecurity("<YOUR_API_KEY_HERE>"),
)
res, err := s.Butler.StopTasks(ctx)
if err != nil {
log.Fatal(err)
}
if res != nil {
// handle response
}
}package hello.world;
import dev.plexapi.sdk.PlexAPI;
import dev.plexapi.sdk.models.operations.StopTasksResponse;
import java.lang.Exception;
public class Application {
public static void main(String[] args) throws Exception {
PlexAPI sdk = PlexAPI.builder()
.token(System.getenv().getOrDefault("TOKEN", ""))
.build();
StopTasksResponse res = sdk.butler().stopTasks()
.call();
// handle response
}
}import { PlexAPI } from "@lukehagar/plexjs";
const plexAPI = new PlexAPI({
token: "<YOUR_API_KEY_HERE>",
});
async function run() {
await plexAPI.butler.stopTasks();
}
run();curl --request DELETE \
--url https://{IP-description}.{identifier}.plex.direct:{port}/butler \
--header 'X-Plex-Token: <api-key>'import requests
url = "https://{IP-description}.{identifier}.plex.direct:{port}/butler"
headers = {"X-Plex-Token": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'X-Plex-Token': '<api-key>'}};
fetch('https://{IP-description}.{identifier}.plex.direct:{port}/butler', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));Authorizations
The token which identifies the user accessing the PMS. This can be either:
- A traditional access token obtained from plex.tv
- A JWT token obtained through the JWT authentication flow
JWT tokens provide better security with:
- Short-lived tokens (7 days expiration)
- Public-key cryptography (ED25519)
- Better clock synchronization
- Individual device revocation capability
Response
200 - text/html
OK
Was this page helpful?
⌘I