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

**Check whether the account can be closed**

Report whether the authenticated 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, and the counts next to it say how much. Closing itself is done from the account settings page in a browser session; see `POST /api/v2/me/actions/close-account`. Contacts and delegated sessions cannot use this operation.

### Related Endpoints

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

### Headers

- `Accept`: application/json
- `Authorization`: Bearer YOUR_API_KEY
- Required API scope: `read:account`

### Request Example

```bash
curl -X GET "https://cloud.hostup.se/api/v2/me/actions/close-account" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
```

### Response Schema

- `available` (boolean, required): `true` when the account can be closed right now. Example: `false`
- `reason` (string, required, nullable): Plain-English 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 a service and is not counted. 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 enabled on the account. Closing is blocked while it is. Example: `false`
- `unpaidInvoiceCount` (integer, required): Number of currently unpaid invoices on the account. Closing is blocked while this is above 0. Example: `1`
- `pendingOrderCount` (integer, required): Number of pending orders on the account. 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): ISO-4217 code of the account's billing currency. Example: `SEK`
- `openTicketCount` (integer, required): Open support tickets that are closed together with the account. Abuse cases are not counted and stay open. Never a blocker. Example: `0`

### Responses

#### 200 - Closure eligibility for the account.
```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 body failed validation.",
  "code": "invalid_request",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z",
  "errors": [
    {
      "pointer": "/items/0/domainName",
      "detail": "`domainName` is required.",
      "code": "invalid_request"
    }
  ]
}
```

#### 401 - Authentication is missing or invalid.

#### 403 - The authenticated identity is not the account owner (contact or delegated session), or the key lacks `read:account`.

#### 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": "Too many requests. Retry after the limit resets.",
  "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`). Retry later.
