# Plugins
Install, update, activate, deactivate, and uninstall WordPress plugins from WordPress.org.
Requires the WordPress Toolkit add-on.
Base path: .../wordpress-toolkit
# List Installed Plugins
# HTTP Request:
GET https://api.serveravatar.com/organizations/{organization}/servers/{server}/applications/{application}/wordpress-toolkit/plugins/list
# Curl Request Example:
curl --request GET \
--url "https://api.serveravatar.com/organizations/5/servers/15/applications/93/wordpress-toolkit/plugins/list" \
--header 'content-type: application/json' \
--header 'Authorization: <YOUR API TOKEN>'
# Response:
# Successful Response
- 200 (Ok)
{
"message": "WordPress plugins list fetched successfully.",
"plugins": [
{
"name": "redis-cache",
"title": "Redis Object Cache",
"status": "active",
"update": false,
"version": "2.8.0",
"update_version": ""
}
],
"status": "success"
}
# Server Error
- 500 (Internal Server Error)
# Install Plugin
# HTTP Request:
POST https://api.serveravatar.com/organizations/{organization}/servers/{server}/applications/{application}/wordpress-toolkit/plugins/install
# Parameter:
| Parameter | Required | Type | Description |
|---|---|---|---|
| plugin | Yes | String | WordPress.org plugin (e.g. redis-cache) |
# Curl Request Example:
curl --request POST \
--url "https://api.serveravatar.com/organizations/5/servers/15/applications/93/wordpress-toolkit/plugins/install" \
--header 'content-type: application/json' \
--header 'Authorization: <YOUR API TOKEN>' \
--data '{"plugin": "redis-cache"}'
# Response:
# Successful Response
- 200 (Ok)
{
"response": {
"status": "success",
"message": "Plugin 'redis-cache' installed successfully"
}
}
# Validation Error
- 422 (Unprocessable Entity)
{
"message": "The plugin field is required."
}
# Server Error
- 500 (Internal Server Error)
# Update Plugin
# HTTP Request:
PATCH https://api.serveravatar.com/organizations/{organization}/servers/{server}/applications/{application}/wordpress-toolkit/plugins/update
# Parameter:
| Parameter | Required | Type | Description |
|---|---|---|---|
| plugin | Yes | String | Plugin 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/plugins/update" \
--header 'content-type: application/json' \
--header 'Authorization: <YOUR API TOKEN>' \
--data '{"plugin": "redis-cache"}'
# Response:
# Successful Response
- 200 (Ok)
{
"response": {
"status": "success",
"message": "Plugin 'redis-cache' updated successfully"
}
}
# Validation Error
- 422 (Unprocessable Entity)
{
"message": "The plugin field is required."
}
# Server Error
- 500 (Internal Server Error)
# Update All Plugins
# HTTP Request:
PATCH https://api.serveravatar.com/organizations/{organization}/servers/{server}/applications/{application}/wordpress-toolkit/plugins/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/plugins/update-all" \
--header 'content-type: application/json' \
--header 'Authorization: <YOUR API TOKEN>'
# Response:
# Successful Response
- 200 (Ok)
{
"response": {
"message": "All plugins updated successfully",
"status": "success"
}
}
# Server Error
- 500 (Internal Server Error)
# Toggle Plugin (Activate / Deactivate)
# HTTP Request:
PATCH https://api.serveravatar.com/organizations/{organization}/servers/{server}/applications/{application}/wordpress-toolkit/plugins/toggle
# Parameter:
| Parameter | Required | Type | Description |
|---|---|---|---|
| plugin | Yes | String | Plugin name |
| action | Yes | String | activate or deactivate |
# Curl Request Example:
curl --request PATCH \
--url "https://api.serveravatar.com/organizations/5/servers/15/applications/93/wordpress-toolkit/plugins/toggle" \
--header 'content-type: application/json' \
--header 'Authorization: <YOUR API TOKEN>' \
--data '{
"plugin": "redis-cache",
"action": "activate"
}'
# Response:
# Successful Response
- 200 (Ok)
{
"response": {
"message": "Plugin 'redis-cache' activated successfully",
"status": "success"
}
}
# Validation Error
- 422 (Unprocessable Entity)
{
"message": "Invalid action. Must be 'activate' or 'deactivate'."
}
# Server Error
- 500 (Internal Server Error)
# Uninstall Plugin
# HTTP Request:
DELETE https://api.serveravatar.com/organizations/{organization}/servers/{server}/applications/{application}/wordpress-toolkit/plugins/uninstall
# Parameter:
| Parameter | Required | Type | Description |
|---|---|---|---|
| plugin | Yes | String | Plugin name to remove |
# Curl Request Example:
curl --request DELETE \
--url "https://api.serveravatar.com/organizations/5/servers/15/applications/93/wordpress-toolkit/plugins/uninstall" \
--header 'content-type: application/json' \
--header 'Authorization: <YOUR API TOKEN>' \
--data '{"plugin": "redis-cache"}'
# Response:
# Successful Response
- 200 (Ok)
{
"response": {
"status": "success",
"message": "Plugin 'redis-cache' uninstalled successfully"
}
}
# Validation Error
- 422 (Unprocessable Entity)
{
"message": "The plugin field is required."
}
# Server Error
- 500 (Internal Server Error)