## GET /api/v2/shared-hosting/{accountId}/database-access-hosts

**List database access hosts**

List the hosts that may connect to the account's MySQL databases over TCP. The list is account-wide. Every database user may connect from every listed host with its own password. `localhost` (the local socket) is always allowed and never listed. An app on the hosting that connects over TCP is seen as `127.0.0.1` (`::1` over IPv6). That address must be on the list. The account must be active. An account on Hostup's previous hosting platform returns an empty list. Add a host with [`POST /api/v2/shared-hosting/{accountId}/database-access-hosts`](/endpoints/webhosting-services/post-v2-shared-hosting-accountid-database-access-hosts/). Remove one with [`DELETE /api/v2/shared-hosting/{accountId}/database-access-hosts/{host}`](/endpoints/webhosting-services/delete-v2-shared-hosting-accountid-database-access-hosts-host/).

### Related Endpoints

- `POST /api/v2/shared-hosting/{accountId}/database-access-hosts`: Allow a database access host
- `DELETE /api/v2/shared-hosting/{accountId}/database-access-hosts/{host}`: Remove a database access host
- `GET /api/v2/shared-hosting/{accountId}`: Get a web hosting account

### Headers

- `Authorization`: Bearer $HOSTUP_API_KEY
- Scopes: `read:hosting`, `console:services`

### Parameters

- `accountId` (path, string, required): The web hosting account ID (`acct_…`). Example: `acct_01hxa3b4c5d6e7f8g9h0j1k2m3`

### Request Example

```bash
curl "https://cloud.hostup.se/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/database-access-hosts" \
  -H "Authorization: Bearer $HOSTUP_API_KEY"
```

### Response Schema

- `databaseAccessHosts` (array<object>, required): The allowed hosts. Empty when only the local socket is allowed.
- `databaseAccessHosts[].host` (string, required): An IP address, an IP range with `%` as the wildcard (`203.0.113.%`), a hostname or `%` for every host. Use this value as `{host}` to remove it. Example: `203.0.113.7`
- `databaseAccessHosts[].note` (string, required, nullable): The comment saved next to the host in the control panel. Example: `Office`

### Responses

#### 200 - Allowed database access hosts.
```json
{
  "databaseAccessHosts": [
    {
      "host": "127.0.0.1",
      "note": "Node app on the hosting"
    },
    {
      "host": "203.0.113.7",
      "note": "Office"
    }
  ]
}
```

#### 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 - Unauthorized. Authentication is required.
```json
{
  "type": "https://developer.hostup.se/errors/unauthorized",
  "title": "Unauthorized",
  "status": 401,
  "detail": "Authentication is required.",
  "code": "unauthorized",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```

#### 403 - Forbidden. The caller lacks a required scope or does not own the resource.
```json
{
  "type": "https://developer.hostup.se/errors/forbidden",
  "title": "Forbidden",
  "status": 403,
  "detail": "The caller lacks a required scope or does not own the resource.",
  "code": "forbidden",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```

#### 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"
}
```

#### 409 - Conflict. `code` is `account_suspended`, `account_not_eligible_cpanel`.
```json
{
  "type": "https://developer.hostup.se/errors/account_suspended",
  "title": "Hosting account suspended",
  "status": 409,
  "detail": "The hosting account is suspended, so this action is unavailable until the account is reactivated.",
  "code": "account_suspended",
  "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 - Upstream failure. A dependent provider request failed; the Problem Details `code` is `upstream_failed`. Retry later or contact support if the issue persists.
```json
{
  "type": "https://developer.hostup.se/errors/upstream_failed",
  "title": "Upstream failure",
  "status": 502,
  "detail": "An upstream provider request failed. Retry later or contact support if the issue persists.",
  "code": "upstream_failed",
  "instance": "/api/v2/resource",
  "requestId": "req_01hxa3b4c5d6e7f8g9h0j1k2m3",
  "timestamp": "2026-04-27T12:34:56.000Z"
}
```
