## GET /api/v2/me/actions/close-account

**Check whether the account can be closed**

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.

### Related Endpoints

- `POST /api/v2/me/actions/close-account`: Close the account
- `GET /api/v2/me`: Get your account
- `PATCH /api/v2/me`: Update your account profile

### Headers

- `Authorization`: Bearer $HOSTUP_API_KEY
- Scope: `read:account`

### Request Example

```bash
curl "https://cloud.hostup.se/api/v2/me/actions/close-account" \
  -H "Authorization: Bearer $HOSTUP_API_KEY"
```

### Response Schema

- `available` (boolean, required): `true` when the account can be closed right now. Example: `false`
- `reason` (string, required, nullable): Short summary of what must be resolved first. `null` when `available` is `true`. Example: `Before the account can be closed: cancel the active services, pay the open invoices.`
- `blockers` (array<string>, required): What currently prevents the closure, in the order to resolve it. Empty when `available` is `true`. Example: `["active_services","unpaid_invoices"]`
- `activeServiceCount` (integer, required): 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. Example: `2`
- `activeDomainCount` (integer, required): 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. Example: `0`
- `hasObjectStorage` (boolean, required): `true` when object storage is turned on. Closing is blocked while it is. Example: `false`
- `unpaidInvoiceCount` (integer, required): Unpaid invoices. Closing is blocked while this is above 0. Example: `1`
- `pendingOrderCount` (integer, required): Orders that are not finished. Closing is blocked while this is above 0. Example: `0`
- `creditBalance` (number, required): Unused account credit in `currencyCode`. Closing is blocked while this is above 0. Support refunds the credit first. Example: `0`
- `currencyCode` (string, required): The account's billing currency as an ISO 4217 code. Example: `SEK`
- `openTicketCount` (integer, required): Open support tickets. They are closed together with the account. Abuse cases are not counted and stay open. Never a blocker. Example: `0`

### Responses

#### 200 - Whether the account can be closed and what is in the way.
```json
{
  "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
}
```

#### 400 - Invalid request. The response body is an RFC 7807 Problem Details document.
```json
{
  "type": "https://developer.hostup.se/errors/invalid_request",
  "title": "Invalid request",
  "status": 400,
  "detail": "The request is invalid.",
  "code": "invalid_request",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```

#### 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.
```json
{
  "type": "https://developer.hostup.se/errors/not_found",
  "title": "Not found",
  "status": 404,
  "detail": "The requested resource could not be found.",
  "code": "not_found",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```

#### 429 - Rate limited. Retry after the limit resets. 429 responses include `Retry-After` seconds plus `X-RateLimit-*` headers.
```json
{
  "type": "https://developer.hostup.se/errors/rate_limit_exceeded",
  "title": "Too many requests",
  "status": 429,
  "detail": "Rate limit exceeded. Please try again later.",
  "code": "rate_limit_exceeded",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```

#### 500 - Internal error. Retry later or contact support if the issue persists.
```json
{
  "type": "https://developer.hostup.se/errors/internal_error",
  "title": "Internal server error",
  "status": 500,
  "detail": "An unexpected error occurred. Retry later or contact support if the issue persists.",
  "code": "internal_error",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```

#### 502 - The account could not be checked right now (`upstream_failed`). Try again later.
