List plans a web hosting account can move to
GET /api/v2/shared-hosting/{accountId}/actions/upgrade
List the plans a web hosting account can upgrade or downgrade to, with the yearly price of each. Send an option’s productSlug to POST /api/v2/shared-hosting/{accountId}/actions/upgrade. scheduledChange shows a plan change already scheduled for the next billing period. While it is there, no other change can be chosen. Cancel it with DELETE /api/v2/shared-hosting/{accountId}/actions/upgrade. A downgrade option carries capacityWarning when the account uses more disk than that plan includes. It can still be chosen. The account must be active. A contact needs permission to place orders.
Authentication: An API key with the scope read:services. About keys and scopes
Request
Path parameters
accountIdstringrequiredacct_…).Example
curl "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/actions/upgrade" \ -H "Authorization: Bearer $HOSTUP_API_KEY"Responses
200 The plans the account can move to.
{ "accountId": "acct_01hxa3b4c5d6e7f8g9h0j1k2m3", "domain": "example.com", "currencyCode": "SEK", "actions": { "canUpgrade": { "allowed": true, "reason": null } }, "currentPackage": { "productSlug": "webbhotell-start", "name": "Start", "storage": "50 GB", "ram": "2 GB", "cpu": "1 vCPU", "features": [ "Free SSL Certificate", "Daily Backups" ] }, "availableOptions": [ { "productSlug": "webbhotell-business", "name": "Business", "type": "upgrade", "storage": "100 GB", "ram": "4 GB", "cpu": "2 vCPU", "annualPrice": 199, "currencyCode": "SEK", "billing": { "amount": 199, "currencyCode": "SEK", "billingCycle": "annually" }, "features": [ "SSH Access", "Daily Backups" ], "order": 2, "available": true, "reason": null, "capacityWarning": null } ], "scheduledChange": null}Response fields
accountIdstringdomainstring or nullcurrencyCodestringactionsobjectcanUpgradeobjectallowedbooleanreasonstring or nullcodestring or nullcurrentPackageobject or nullavailableOptionsarray of objectproductSlugstring or nullproductSlug to POST.namestring or nulltypestring or nullupgrade for a bigger plan. downgrade for a smaller one. One of upgrade, downgrade.billingobjectamountnumber or nullcurrencyCode.currencyCodestringbillingCyclestringannually.availablebooleanreasonstring or nullavailable is true.capacityWarningnullscheduledChangenullErrors
Errors are Problem Details with a stable code. Branch on the code, not on the text.
| 400 | Invalid request. The response body is an RFC 7807 Problem Details document. |
| 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; code names the missing resource: shared_hosting_not_found, scheduled_change_not_found. |
| 409 | Conflict. code is account_suspended. |
| 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. |