Skip to content

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

GET /api/v2/me/actions/close-account
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
}
Response fields
availableboolean
true when the account can be closed right now.
reasonstring or null
Short summary of what must be resolved first. null when available is true.
blockersarray of string
What currently prevents the closure, in the order to resolve it. Empty when available is true.
activeServiceCountinteger
Services 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.
activeDomainCountinteger
Domains 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.
hasObjectStorageboolean
true when object storage is turned on. Closing is blocked while it is.
unpaidInvoiceCountinteger
Unpaid invoices. Closing is blocked while this is above 0. At least 0.
pendingOrderCountinteger
Orders that are not finished. Closing is blocked while this is above 0. At least 0.
creditBalancenumber
Unused account credit in currencyCode. Closing is blocked while this is above 0. Support refunds the credit first. At least 0.
currencyCodestring
The account’s billing currency as an ISO 4217 code.
openTicketCountinteger
Open 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.

400Invalid request. The response body is an RFC 7807 Problem Details document.
401Authentication is missing or invalid.
403A contact or delegated-access login cannot use this call.
404Not found. The resource does not exist or is not owned by the caller.
429Rate limited. Retry after the limit resets. 429 responses include Retry-After seconds plus X-RateLimit-* headers.
500Internal error. Retry later or contact support if the issue persists.
502The account could not be checked right now (upstream_failed). Try again later.