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

**Remove a database access host**

Stop allowing TCP connections to the account's MySQL databases from one host. Use the exact `host` from [`GET /api/v2/shared-hosting/{accountId}/database-access-hosts`](/endpoints/webhosting-services/get-v2-shared-hosting-accountid-database-access-hosts/). URL-encode it in the path. `%` is `%25`. The any-host wildcard is `/database-access-hosts/%25`. The call answers `204` whether or not the host was listed. `localhost` cannot be removed because the local socket is always allowed. The account must be active and on cPanel.

### Related Endpoints

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

### Headers

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

### Parameters

- `accountId` (path, string, required): The web hosting account ID (`acct_…`). Example: `acct_01hxa3b4c5d6e7f8g9h0j1k2m3`
- `host` (path, string, required): The host from `databaseAccessHosts[].host`, URL-encoded (`%` is `%25`). Example: `acct_01hxa3b4c5d6e7f8g9h0j1k2m3`

### Request Example

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

### Responses

#### 204 - Host removed. Also returned when the host was not listed.

#### 400 - The host is malformed or `localhost`.
```json
{
  "type": "https://developer.hostup.se/errors/invalid_request",
  "title": "Invalid request",
  "status": 400,
  "detail": "localhost (the Unix socket) is always allowed and cannot be added or removed.",
  "instance": "/api/v2/shared-hosting/acct_01hxa3b4c5d6e7f8g9h0j1k2m3/database-access-hosts/localhost",
  "code": "invalid_request",
  "errors": [
    {
      "pointer": "/path/host",
      "detail": "localhost (the Unix socket) is always allowed and cannot be added or removed.",
      "code": "invalid_request"
    }
  ]
}
```

#### 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`, or a route-specific blocker with its own recovery fields.
```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"
}
```
