# Themes
Install, update, activate, and uninstall WordPress themes from WordPress.org.
Requires the WordPress Toolkit add-on.
Base path: .../wordpress-toolkit
# List Installed Themes
# HTTP Request:
GET https://api.serveravatar.com/organizations/{organization}/servers/{server}/applications/{application}/wordpress-toolkit/themes/list
# Curl Request Example:
curl --request GET \
--url "https://api.serveravatar.com/organizations/5/servers/15/applications/93/wordpress-toolkit/themes/list" \
--header 'content-type: application/json' \
--header 'Authorization: <YOUR API TOKEN>'
# Response:
# Successful Response
- 200 (Ok)
{
"message": "WordPress themes list fetched successfully.",
"themes": [
{
"name": "classic-ecommerce",
"status": "inactive",
"update": "none",
"update_version": "",
"version": "1.5.5"
}
],
"status": "success"
}
# Server Error
- 500 (Internal Server Error)
# Install Theme
# HTTP Request:
POST https://api.serveravatar.com/organizations/{organization}/servers/{server}/applications/{application}/wordpress-toolkit/themes/install
# Parameter:
| Parameter | Required | Type | Description |
|---|---|---|---|
| theme | Yes | String | WordPress.org theme (e.g. classic-ecommerce) |
# Curl Request Example:
curl --request POST \
--url "https://api.serveravatar.com/organizations/5/servers/15/applications/93/wordpress-toolkit/themes/install" \
--header 'content-type: application/json' \
--header 'Authorization: <YOUR API TOKEN>' \
--data '{"theme": "classic-ecommerce"}'
# Response:
# Successful Response
- 200 (Ok)
{
"response": {
"status": "success",
"message": "Theme 'classic-ecommerce' installed successfully"
}
}
# Validation Error
- 422 (Unprocessable Entity)
{
"message": "The theme field is required."
}
# Server Error
- 500 (Internal Server Error)
# Update Theme
# HTTP Request:
PATCH https://api.serveravatar.com/organizations/{organization}/servers/{server}/applications/{application}/wordpress-toolkit/themes/update
# Parameter:
| Parameter | Required | Type | Description |
|---|---|---|---|
| theme | Yes | String | Theme name to update |
| version | No | String | Specific version to install |
# Curl Request Example:
curl --request PATCH \
--url "https://api.serveravatar.com/organizations/5/servers/15/applications/93/wordpress-toolkit/themes/update" \
--header 'content-type: application/json' \
--header 'Authorization: <YOUR API TOKEN>' \
--data '{"theme": "classic-ecommerce"}'
# Response:
# Successful Response
- 200 (Ok)
{
"response": {
"status": "success",
"message": "Theme 'classic-ecommerce' updated successfully",
}
}
# Validation Error
- 422 (Unprocessable Entity)
{
"message": "The theme field is required."
}
# Server Error
- 500 (Internal Server Error)
# Update All Themes
# HTTP Request:
PATCH https://api.serveravatar.com/organizations/{organization}/servers/{server}/applications/{application}/wordpress-toolkit/themes/update-all
No request body required.
# Curl Request Example:
curl --request PATCH \
--url "https://api.serveravatar.com/organizations/5/servers/15/applications/93/wordpress-toolkit/themes/update-all" \
--header 'content-type: application/json' \
--header 'Authorization: <YOUR API TOKEN>'
# Response:
# Successful Response
- 200 (Ok)
{
"response": {
"status": "success",
"message": "All themes updated successfully"
}
}
# Server Error
- 500 (Internal Server Error)
# Activate Theme
# HTTP Request:
PATCH https://api.serveravatar.com/organizations/{organization}/servers/{server}/applications/{application}/wordpress-toolkit/themes/activate
# Parameter:
| Parameter | Required | Type | Description |
|---|---|---|---|
| theme | Yes | String | Theme name to activate |
# Curl Request Example:
curl --request PATCH \
--url "https://api.serveravatar.com/organizations/5/servers/15/applications/93/wordpress-toolkit/themes/activate" \
--header 'content-type: application/json' \
--header 'Authorization: <YOUR API TOKEN>' \
--data '{"theme": "classic-ecommerce"}'
# Response:
# Successful Response
- 200 (Ok)
{
"response": {
"status": "success",
"message": "Theme 'classic-ecommerce' activated successfully"
}
}
# Validation Error
- 422 (Unprocessable Entity)
{
"message": "The theme field is required."
}
# Server Error
- 500 (Internal Server Error)
# Uninstall Theme
# HTTP Request:
DELETE https://api.serveravatar.com/organizations/{organization}/servers/{server}/applications/{application}/wordpress-toolkit/themes/uninstall
# Parameter:
| Parameter | Required | Type | Description |
|---|---|---|---|
| theme | Yes | String | Theme name to remove |
# Curl Request Example:
curl --request DELETE \
--url "https://api.serveravatar.com/organizations/5/servers/15/applications/93/wordpress-toolkit/themes/uninstall" \
--header 'content-type: application/json' \
--header 'Authorization: <YOUR API TOKEN>' \
--data '{"theme": "classic-ecommerce"}'
# Response:
# Successful Response
- 200 (Ok)
{
"response": {
"status": "success",
"message": "Theme 'classic-ecommerce' uninstalled successfully"
}
}
The active theme cannot be uninstalled. Activate another theme first; otherwise the request returns 500 with a message such as Cannot uninstall active theme 'classic-ecommerce'. Please activate another theme first.
# Validation Error
- 422 (Unprocessable Entity)
{
"message": "The theme field is required."
}
# Server Error
- 500 (Internal Server Error)