Install WordPress
POST /api/v2/shared-hosting/{accountId}/wordpress
Install WordPress on a domain of a web hosting account. Leave out directory to install at the domain’s root. Send it to install in a sub-folder, such as blog. The site is set up for HTTPS. Automatic updates of WordPress, plugins and themes are on unless you send false. The call returns 201 with the new site’s ID when the install is confirmed. When the install was sent but could not be confirmed yet, it returns 202 with state: unconfirmed. Do not retry then. List the sites with GET /api/v2/shared-hosting/{accountId}/wordpress until it appears. 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_…).Body
domainstringrequireddirectorystring_, ., / and -, up to 200 characters. Leave it out for the root.siteNamestringrequiredsiteDescriptionstringadminUsernamestringrequired., _ and -, up to 64 characters.adminPasswordstringrequiredadminEmailstringrequiredlanguagestringen or sv_SE. Default en.autoUpgradebooleantrue.autoUpgradePluginsbooleantrue.autoUpgradeThemesbooleantrue.Example
curl -X POST "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/wordpress" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "domain": "example.com", "siteName": "Example Store", "adminUsername": "admin", "adminPassword": "YOUR_WORDPRESS_ADMIN_PASSWORD", "adminEmail": "admin@example.com", "language": "en", "autoUpgrade": true, "autoUpgradePlugins": true, "autoUpgradeThemes": true }'curl -X POST "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/wordpress" \ -H "Authorization: Bearer $HOSTUP_API_KEY" \ -H "Content-Type: application/json" \ -d '{ "domain": "shop.example.com", "directory": "blogg", "siteName": "Example Blogg", "adminUsername": "admin", "adminPassword": "YOUR_WORDPRESS_ADMIN_PASSWORD", "adminEmail": "alex@example.se", "language": "sv_SE" }'Responses
201 WordPress was installed.
{ "id": "wp_01hxa3b4c5d6e7f8g9h0j1k2m3", "url": "https://example.com"}Response fields
idstringwp_…).urlstring202 The install was sent but could not be confirmed yet. Do not retry. List the sites until it appears.
{ "state": "unconfirmed", "url": "https://example.com", "message": "WordPress installation was submitted, but confirmation is not ready yet. Refresh WordPress installations or scan for existing installations before trying again.", "actions": { "canList": true, "canScan": true, "canRetry": false }}Response fields
statestringunconfirmed. One of unconfirmed.urlstringmessagestringactionsobjectcanListbooleancanScanbooleancanRetrybooleanErrors
Errors are Problem Details with a stable code. Branch on the code, not on the text.
| 400 | The body is invalid (invalid_request). |
| 401 | Unauthorized. Authentication is required. |
| 403 | Forbidden. The caller lacks a required scope or does not own the resource. |
| 404 | Not found. The resource does not exist or is not owned by the caller. |
| 409 | account_suspended: the hosting account is suspended. 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 | WordPress could not be installed (upstream_failed). |