Check whether the account can be closed
GET /api/v2/me/actions/close-account
Check whether your account can be closed right now and what is in the way. An account can be closed only when it holds nothing: no active or suspended service, no active domain, no object storage, no unpaid invoice, no pending order and no unused credit. blockers lists what remains, in the order to resolve it. The counts next to it say how much.
The closure itself is done with POST /api/v2/me/actions/close-account from a signed-in client-area session. A contact or delegated-access login gets 403 here.
Authentication: An API key with the scope read:account. About keys and scopes
Example
curl "https://cloud.hostup.se/api/v2/me/actions/close-account" \ -H "Authorization: Bearer $HOSTUP_API_KEY"Responses
200 Whether the account can be closed and what is in the way.
{ "available": false, "reason": "Before the account can be closed: cancel the active services, pay the open invoices.", "blockers": [ "active_services", "unpaid_invoices" ], "activeServiceCount": 2, "activeDomainCount": 0, "hasObjectStorage": false, "unpaidInvoiceCount": 1, "pendingOrderCount": 0, "creditBalance": 0, "currencyCode": "SEK", "openTicketCount": 0}{ "available": true, "reason": null, "blockers": [], "activeServiceCount": 0, "activeDomainCount": 0, "hasObjectStorage": false, "unpaidInvoiceCount": 0, "pendingOrderCount": 0, "creditBalance": 0, "currencyCode": "SEK", "openTicketCount": 1}Response fields
availablebooleantrue when the account can be closed right now.reasonstring or nullShort summary of what must be resolved first.
null when available is true.blockersarray of stringWhat currently prevents the closure, in the order to resolve it. Empty when
available is true.activeServiceCountintegerServices that are active or suspended. DNS zone management is not counted. The Cloud VPS billing account is not counted when it has nothing left to bill: no usage this period and no reserved floating IP. Closing is blocked while this is above 0. At least 0.
activeDomainCountintegerDomains that are active or have a registration or transfer in progress. Expired and transferred-out domains are not counted. Closing is blocked while this is above 0. At least 0.
hasObjectStoragebooleantrue when object storage is turned on. Closing is blocked while it is.unpaidInvoiceCountintegerUnpaid invoices. Closing is blocked while this is above 0. At least 0.
pendingOrderCountintegerOrders that are not finished. Closing is blocked while this is above 0. At least 0.
creditBalancenumberUnused account credit in
currencyCode. Closing is blocked while this is above 0. Support refunds the credit first. At least 0.currencyCodestringThe account’s billing currency as an ISO 4217 code.
openTicketCountintegerOpen support tickets. They are closed together with the account. Abuse cases are not counted and stay open. Never a blocker. At least 0.
Errors
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 | Authentication is missing or invalid. |
| 403 | A contact or delegated-access login cannot use this call. |
| 404 | Not found. The resource does not exist or is not owned by the caller. |
| 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 account could not be checked right now (upstream_failed). Try again later. |