## GET /api/v2/vps/{id}/diagnostics/connectivity

**Run the VPS connectivity doctor**

Read-only reachability check of the VPS's own primary IP: TCP probes of common ports (default 22, 80, 443, 3389 — override with `?ports=22,443`, max 6) from HostUp's diagnostics egress, synthesized into one verdict. `verdict` is one of `all_clear` (every probed port responds), `host_up_some_services_down` (network path works; non-responding ports are stopped/blocked inside the guest), `host_up_no_services` (host answers with resets but no service accepted), `network_unreachable` (nothing answered — powered off, boot failure, or a guest firewall dropping everything), or `no_public_ip`. Each `ports[]` row carries `port`, `verdict` (`open`/`closed`/`no_response`), a human `label` (for example `"RDP (Windows remote desktop)"`), and `latencyMs` for open ports. Probes target only the VPS's own assigned addresses — the caller cannot supply a host. Get `{id}` from `GET /api/v2/vps` `data[].id`.

### Related Endpoints

- `GET /api/v2/vps/{id}`: Get VPS details
- `GET /api/v2/vps/{id}/iso`: List VPS ISO media
- `GET /api/v2/vps/{id}/disks`: List VPS disks

### Headers

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

### Parameters

- `id` (path, string, required): Public VPS ID. Get it from `GET /api/v2/vps` `data[].id`. Do not invent this value; use the exact ID returned by the referenced API response. Example: `vps_01hxa3b4c5d6e7f8g9h0j1k2m3`

### Request Example

```bash
curl -X GET "https://cloud.hostup.se/api/v2/vps/vps_01hxa3b4c5d6e7f8g9h0j1k2m3/diagnostics/connectivity" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Accept: application/json"
```

### Response Schema

- `verdict` (string, required) Example: `host_up_some_services_down`
  Allowed values: all_clear, host_up_some_services_down, host_up_no_services, network_unreachable, no_public_ip
- `host` (string, required, nullable): The VPS's own primary IP that was probed. `null` only for the `no_public_ip` verdict. Example: `192.0.2.10`
- `ports` (array<object>, required)
- `ports[].port` (integer, required) Example: `22`
- `ports[].verdict` (string, required) Example: `open`
  Allowed values: open, closed, no_response
- `ports[].detail` (string, required, nullable): Short failure detail for non-open verdicts (for example `timeout`). Example: `null`
- `ports[].latencyMs` (number, required, nullable): Connect latency for `open` ports; `null` otherwise. Example: `12`
- `ports[].label` (string, required, nullable): Human label for well-known ports (for example `SSH`); `null` for uncommon ports. Example: `SSH`
- `checkedAt` (string, required) Example: `2026-08-02T15:04:05.000Z`

### Responses

#### 200 - Connectivity verdict with per-port probe results.
```json
{
  "verdict": "host_up_some_services_down",
  "host": "192.0.2.10",
  "ports": [
    {
      "port": 3389,
      "verdict": "open",
      "detail": null,
      "latencyMs": 12,
      "label": "RDP (Windows remote desktop)"
    },
    {
      "port": 22,
      "verdict": "no_response",
      "detail": "timeout",
      "latencyMs": null,
      "label": "SSH"
    }
  ],
  "checkedAt": "2026-08-02T15:04:05.000Z"
}
```

#### 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 - 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 - The VPS does not exist or is not owned by the authenticated account.

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