---
title: "List connections by SOCKS5 user"
method: GET
path: "/connect/users/{id}/connections"
tags: ["Users"]
---

# List connections by SOCKS5 user

`GET /connect/users/{id}/connections`

Returns the connection history recorded for this user, one item per connection (aggregated across the connection's lifetime). Supports filtering on every property plus ordering and pagination. Returns 503 when the connection-insights backend is disabled or unreachable.

## Query parameters

- `page` integer
- `pageSize` integer
- `sessionId` string, uuid
- `proxyId` string, uuid
- `dstHost` string
- `dstPort` integer
- `protocol` 'tcp' | 'udp' | 'unknown' — Transport protocol of a connection.
- `provider` string
- `country` string
- `closeReason` string
- `status` 'active' | 'closed' — `active` while the connection is still open (no terminal record yet); `closed` once it has ended.
- `startedAfter` string, date-time
- `startedBefore` string, date-time
- `endedAfter` string, date-time
- `endedBefore` string, date-time
- `minBytesIn` integer
- `maxBytesIn` integer
- `minBytesOut` integer
- `maxBytesOut` integer
- `minTotalBytes` integer
- `maxTotalBytes` integer
- `minDurationMs` integer
- `maxDurationMs` integer
- `orderBy` 'startedAt' | 'endedAt' | 'bytesIn' | 'bytesOut' | 'totalBytes' | 'durationMs'
- `order` 'asc' | 'desc'

## Response `200`

A page of connections.

- ConnectionList — A page of connections.
  - `items` Connection[], required
    - `bytesIn` integer, required — Total bytes received from upstream over the connection's lifetime.
    - `bytesOut` integer, required — Total bytes sent to upstream over the connection's lifetime.
    - `closeReason` string, nullable — Why the connection closed; null while still active.
    - `country` string, required — Upstream country code (ISO 3166-1 alpha-2), or empty if unknown.
    - `dstHost` string, required — Destination host the client connected to.
    - `dstPort` integer, required — Destination port the client connected to.
    - `durationMs` integer, required — Elapsed time between startedAt and endedAt, in milliseconds.
    - `endedAt` string, date-time, required — Time of the connection's last recorded activity (close time once closed).
    - `protocol` 'tcp' | 'udp' | 'unknown', required — Transport protocol of a connection.
    - `provider` string, required — Upstream provider that served the connection.
    - `proxyId` string, uuid, required — The proxy the connection was routed through. All-zero when the upstream was unresolved at capture time.
    - `sessionId` string, uuid, required — Unique id of this connection.
    - `srcIp` string, required — Client source IP address.
    - `startedAt` string, date-time, required — When the connection started.
    - `status` 'active' | 'closed', required — `active` while the connection is still open (no terminal record yet); `closed` once it has ended.
    - `totalBytes` integer, required — bytesIn + bytesOut.
    - `userId` string, uuid, required — The user that made the connection.
  - `pagination` PaginationMeta1, required — Pagination metadata for a list response.
    - `hasNext` boolean, required — Whether a next page exists.
    - `hasPrev` boolean, required — Whether a previous page exists.
    - `page` integer, required — Current page number (1-based).
    - `pageSize` integer, required — Number of items per page.
    - `pages` integer, required — Total number of pages.
    - `total` integer, required — Total number of items across all pages.

## Other responses

- `401` — The X-User-ID header was missing or invalid, or a present X-Owner-Id header was not a uuid.
- `404` — The resource was not found.
- `503` — The connection-insights backend is disabled or temporarily unavailable.

---

[API](https://skmtc.net/mobilerun/apis/workflows.md) · [All operations](https://skmtc.net/mobilerun/apis/workflows/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/mobilerun/workflows/revisions/1bc499aa8f99/schema)
