Edit Theme
POST
/installs/{id}/themes/{slug}
Edit a theme's activation and automatic update status for the specified instance of WordPress.
Parameters
API
/installs/{id}/themes/{slug}
API endpoint. {id} is the internal ID of the install to edit the theme of. {slug} is the internal ID of the theme to edit.
POST
Optional parameters
State of the theme.
true
= Theme is activated.
false
= Theme is deactivated.
default is to not change the current state
Automatic update configuration for the theme.
none
= Never update.
all
= All updates will be performed.
default is to not change the current state
The system or control panel username the task is to be performed on or for.default is the owner of the installation identified by {id} in the API request
Special parameters
Perform a
test run of this API call: run the tests, check connections to the database server and remote locations, but
don't actually perform this task itself . This is just a test-run to make sure that when it is run
for real that there is nothing to stop it from working.
none
= No dry run.all
= Check all input values and test all connections.input
= Check only the input values.default is none
Response
Response
HTTP status code describing the result of the request.
200
for
Success .
All other numbers represent errors which are described in the
errcode output below.
true
= Success.
false
= Failure.
status code 200
complete_dryrun
dryrun was enabled and finished without error.
status code 403
invalid_argument_user
User specified is not authorized to access this data.
status code 404
install_not_found
The app ID was not found or it was found by is owned by a user who does not have access to it.
theme_not_found
The specified theme was not found on the specified install.
user_not_found
The specified user could not be found in the system control panel.
If the cause of an error was an incorrect
field value then this will show the ID of the field.
(eg.
login
,
passwd
,
email
)
Message describing the result of the request. Do not rely on this to determine the success or failure of the request.
↳
The "slug" (aka. internal ID) of the theme.
(eg.
twentytwentyfour
,
twentytwentyfive
)
↳
State of the theme.
true
= Theme is activated.
false
= Theme is deactivated.
↳
Automatic update configuration for the theme.
none
= Never update.
all
= All updates will be performed.
↳
Current version of the theme.
(eg.
5.4.3
)
↳
Full name of the theme.
(eg.
Twenty Twenty-Five
)
↳
Author's long description of the theme.
↳
Author's name.
(eg.
the WordPress team
)
↳
Newest version available of the theme.
(eg.
5.4.4
)
PHP
CURL
CLI
Full Examples
Example: Deactivate a theme of the WordPress install with ID 1234567890abcdefghij12345 Method: curl
$cpapi=https://{USER}:{PASS}@{SERVER_IP}:2083/3rdparty/installatron/index.cgi? # cpanel
#$cpapi=https://{USER}:{PASS}@{SERVER_IP}:2087/3rdparty/installatron/index.cgi? # whm
#$cpapi=https://{USER}:{PASS}@{SERVER_IP}:2222/CMD_PLUGINS/installatron/index.raw? # directadmin
curl -X POST $cpapi/installs/1234567890abcdefghij12345/themes/twentytwentyfour \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '
{
"activated": false
}
'
Response: json
{
"status": 200,
"result": true,
"message": "The task is complete.\n",
"data": {
"id": "twentytwentyfour",
"activated": false,
"autoup": "none",
"version": "3.4",
"name": "Twenty Twenty-Four",
"description": null,
"author": "the WordPress team",
"version_available": null
},
}
Example: Enable automatic-update for a theme of the WordPress install with ID 1234567890abcdefghij12345 Method: curl
$cpapi=https://{USER}:{PASS}@{SERVER_IP}:2083/3rdparty/installatron/index.cgi? # cpanel
#$cpapi=https://{USER}:{PASS}@{SERVER_IP}:2087/3rdparty/installatron/index.cgi? # whm
#$cpapi=https://{USER}:{PASS}@{SERVER_IP}:2222/CMD_PLUGINS/installatron/index.raw? # directadmin
curl -X POST $cpapi/installs/1234567890abcdefghij12345/plugins/twentytwentyfive \
-H 'Accept: application/json' \
-H 'Content-Type: application/json' \
-d '
{
"autoup": "all"
}
'
Response: json
{
"status": 200,
"result": true,
"message": "The task is complete.\n",
"data": {
"id": "twentytwentyfive",
"activated": true,
"autoup": "true",
"version": "1.2",
"name": "Twenty Twenty-Five",
"description": null,
"author": "the WordPress team",
"version_available": null
},
}
Full Examples
Example: Deactivate a theme of the WordPress install with ID 1234567890abcdefghij12345 Method: json payload to curl
Response: json
{
"status": 200,
"result": true,
"message": "The task is complete.\n",
"data": {
"id": "twentytwentyfour",
"activated": false,
"autoup": "none",
"version": "3.4",
"name": "Twenty Twenty-Four",
"description": null,
"author": "the WordPress team",
"version_available": null
},
}
Example: Enable automatic-update for a theme of the WordPress install with ID 1234567890abcdefghij12345 Method: json payload to curl
Response: json
{
"status": 200,
"result": true,
"message": "The task is complete.\n",
"data": {
"id": "twentytwentyfive",
"activated": true,
"autoup": "true",
"version": "1.2",
"name": "Twenty Twenty-Five",
"description": null,
"author": "the WordPress team",
"version_available": null
},
}
Full Examples
Example: Deactivate a theme of the WordPress install with ID 1234567890abcdefghij12345 Method: curl, php, and a user's login
<?php
$cpapi = 'https://{USER}:{PASS}@{SERVER_IP}:2083/3rdparty/installatron/index.cgi?'; // cpanel
//$cpapi = 'https://{USER}:{PASS}@{SERVER_IP}:2087/3rdparty/installatron/index.cgi?'; // whm
//$cpapi = 'https://{USER}:{PASS}@{SERVER_IP}:2222/CMD_PLUGINS/installatron/index.raw?'; // directadmin
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_URL => "$cpapi/installs/1234567890abcdefghij12345/themes/twentytwentyfour",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Content-Type: application/json"
],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => json_encode(
[
'activated' => false
]
)
]);
if (( $response = curl_exec($ch) )=== false )
{
trigger_error(curl_error($ch));
}
curl_close($ch);
var_export(json_decode($response, true));
?>
Response: json
{
"status": 200,
"result": true,
"message": "The task is complete.\n",
"data": {
"id": "twentytwentyfour",
"activated": false,
"autoup": "none",
"version": "3.4",
"name": "Twenty Twenty-Four",
"description": null,
"author": "the WordPress team",
"version_available": null
},
}
Example: Enable automatic-update for a theme of the WordPress install with ID 1234567890abcdefghij12345 Method: curl, php, and a user's login
<?php
$cpapi = 'https://{USER}:{PASS}@{SERVER_IP}:2083/3rdparty/installatron/index.cgi?'; // cpanel
//$cpapi = 'https://{USER}:{PASS}@{SERVER_IP}:2087/3rdparty/installatron/index.cgi?'; // whm
//$cpapi = 'https://{USER}:{PASS}@{SERVER_IP}:2222/CMD_PLUGINS/installatron/index.raw?'; // directadmin
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_URL => "$cpapi/installs/1234567890abcdefghij12345/plugins/twentytwentyfive",
CURLOPT_HTTPHEADER => [
"Accept: application/json",
"Content-Type: application/json"
],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POSTFIELDS => json_encode(
[
'autoup' => 'all'
]
)
]);
if (( $response = curl_exec($ch) )=== false )
{
trigger_error(curl_error($ch));
}
curl_close($ch);
var_export(json_decode($response, true));
?>
Response: json
{
"status": 200,
"result": true,
"message": "The task is complete.\n",
"data": {
"id": "twentytwentyfive",
"activated": true,
"autoup": "true",
"version": "1.2",
"name": "Twenty Twenty-Five",
"description": null,
"author": "the WordPress team",
"version_available": null
},
}
Full Examples
Example: Deactivate a theme of the WordPress install with ID 1234567890abcdefghij12345 Method: cli
/usr/local/installatron/installatron \
--POST /installs/1234567890abcdefghij12345/themes/twentytwentyfour \
--activated 0
Response: json
{
"status": 200,
"result": true,
"message": "The task is complete.\n",
"data": {
"id": "twentytwentyfour",
"activated": false,
"autoup": "none",
"version": "3.4",
"name": "Twenty Twenty-Four",
"description": null,
"author": "the WordPress team",
"version_available": null
},
}
Example: Enable automatic-update for a theme of the WordPress install with ID 1234567890abcdefghij12345 Method: cli
/usr/local/installatron/installatron \
--POST /installs/1234567890abcdefghij12345/plugins/twentytwentyfive \
--autoup all
Response: json
{
"status": 200,
"result": true,
"message": "The task is complete.\n",
"data": {
"id": "twentytwentyfive",
"activated": true,
"autoup": "true",
"version": "1.2",
"name": "Twenty Twenty-Five",
"description": null,
"author": "the WordPress team",
"version_available": null
},
}
Full Examples
Example: Deactivate a theme of the WordPress install with ID 1234567890abcdefghij12345 Method: json payload from cli
Response: json
{
"status": 200,
"result": true,
"message": "The task is complete.\n",
"data": {
"id": "twentytwentyfour",
"activated": false,
"autoup": "none",
"version": "3.4",
"name": "Twenty Twenty-Four",
"description": null,
"author": "the WordPress team",
"version_available": null
},
}
Example: Enable automatic-update for a theme of the WordPress install with ID 1234567890abcdefghij12345 Method: json payload from cli
Response: json
{
"status": 200,
"result": true,
"message": "The task is complete.\n",
"data": {
"id": "twentytwentyfive",
"activated": true,
"autoup": "true",
"version": "1.2",
"name": "Twenty Twenty-Five",
"description": null,
"author": "the WordPress team",
"version_available": null
},
}