Is it possible to enable/disable a plugin with REST API?
Question:
Is it possible to enable/disable a plugin with REST API?
Answer:
Option 1
It is possible with the /api/plugins endpoint. Here is the script we use for a single enable/disable of a plugin;
For enabling set isEnabled to True
For disabling set isEnabled to False
import requests
url = "URL/api/v1/plugins"
payload = "[{ \"name\": \"metadata\", \"lastUpdate\": \"2019-08-11T15:21:36.491Z\", \"version\": \"0\", \"isEnabled\": false, \"folderName\": \"metadata\"}]"
headers = {
'accept': "application/json",
'Content-Type': "application/json",
'cache-control': "no-cache",
'Authorization': 'Bearer TOKEN'
}
headers = {
'accept': "application/json",
'Content-Type': "application/json",
'cache-control': "no-cache",
'Authorization': 'Bearer TOKEN'
}
response = requests.request("PATCH", url, data=payload, headers=headers)
print(response.text)
Updated 02-14-2024
intapiuser
Admin
Joined December 15, 2022