Install a WordPress plugin
POST /api/v2/shared-hosting/{accountId}/wordpress-plugins/{slug}/actions/install
Install a plugin from the wordpress.org directory on a WordPress site on a web hosting account. Use it to add a plugin the site is missing, for example WP Mail SMTP when WordPress cannot send email. The plugin is installed inactive unless you send activate: true. When the plugin’s folder is already there, nothing is installed and the response has alreadyInstalled: true. The site must be in the account’s WordPress list. Otherwise the call returns 409 not_supported. Run GET /api/v2/shared-hosting/{accountId}/wordpress/actions/scan to add it. The account must be active and on cPanel.
Authentication: An API key with the scopes write:hosting and console:services. About keys and scopes
Request
Path parameters
accountIdstringrequiredacct_…).slugstringrequiredBody (optional)
domainstringactivatebooleantrue activates the plugin after it is installed. Default false.Example
curl -X POST "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/wordpress-plugins/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/install" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json"Responses
200 The plugin’s state after the call.
{ "slug": "wp-mail-smtp", "alreadyInstalled": false, "active": false}Response fields
slugstringalreadyInstalledbooleanactivebooleanErrors
Errors are Problem Details with a stable code. Branch on the code, not on the text.
| 400 | slug, activate or domain is invalid (invalid_request). |
| 401 | Unauthorized. Authentication is required. |
| 403 | The key lacks a scope or the account is not active. domain_not_owned: the domain is not on this account. |
| 404 | The site has no wp-content/plugins folder (not_found). It is not a WordPress site. |
| 409 | not_supported: the site is not in the account’s WordPress list. account_not_eligible_cpanel: the account is not on cPanel. |
| 429 | Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers. |
| 500 | Internal error. Retry later or contact support if the issue persists. |
| 502 | The site could not be inspected or the plugin could not be installed right now (upstream_failed). |