Skip to main content
GET
/
connect
/
users
/
{id}
/
connections
JavaScript
import Mobilerun from '@mobilerun/sdk';

const client = new Mobilerun();

const response = await client.connect.users.listConnections('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');

console.log(response.items);
{
  "items": [
    {
      "bytesIn": 123,
      "bytesOut": 123,
      "country": "<string>",
      "dstHost": "<string>",
      "dstPort": 123,
      "durationMs": 123,
      "endedAt": "2023-11-07T05:31:56Z",
      "provider": "<string>",
      "proxyId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "sessionId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "srcIp": "<string>",
      "startedAt": "2023-11-07T05:31:56Z",
      "totalBytes": 123,
      "userId": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "closeReason": "<string>"
    }
  ],
  "pagination": {
    "hasNext": true,
    "hasPrev": true,
    "page": 123,
    "pageSize": 123,
    "pages": 123,
    "total": 123
  }
}

Query Parameters

page
integer
default:1

Page number (1-based).

Required range: x >= 1
pageSize
integer
default:20

Number of items per page.

Required range: 1 <= x <= 100
sessionId
string<uuid>

Filter to a single connection by its session id.

proxyId
string<uuid>

Filter to connections routed through this proxy.

dstHost
string

Filter to connections to this destination host (exact match).

dstPort
integer

Filter to connections to this destination port.

Required range: 0 <= x <= 65535
protocol
enum<string>

Filter to connections of this transport protocol. Transport protocol of a connection.

Available options:
tcp,
udp,
unknown
provider
string

Filter to connections served by this upstream provider.

country
string

Filter to connections served from this upstream country (ISO 3166-1 alpha-2).

closeReason
string

Filter to connections that closed with this reason (closed connections only).

status
enum<string>

Filter by connection status. active while the connection is still open (no terminal record yet); closed once it has ended.

Available options:
active,
closed
startedAfter
string<date-time>

Filter to connections that started at or after this time (inclusive).

startedBefore
string<date-time>

Filter to connections that started at or before this time (inclusive).

endedAfter
string<date-time>

Filter to connections whose last activity was at or after this time (inclusive).

endedBefore
string<date-time>

Filter to connections whose last activity was at or before this time (inclusive).

minBytesIn
integer<int64>

Filter to connections with at least this many bytes received from upstream.

Required range: x >= 0
maxBytesIn
integer<int64>

Filter to connections with at most this many bytes received from upstream.

Required range: x >= 0
minBytesOut
integer<int64>

Filter to connections with at least this many bytes sent to upstream.

Required range: x >= 0
maxBytesOut
integer<int64>

Filter to connections with at most this many bytes sent to upstream.

Required range: x >= 0
minTotalBytes
integer<int64>

Filter to connections with at least this much total traffic (bytesIn + bytesOut).

Required range: x >= 0
maxTotalBytes
integer<int64>

Filter to connections with at most this much total traffic (bytesIn + bytesOut).

Required range: x >= 0
minDurationMs
integer<int64>

Filter to connections lasting at least this many milliseconds.

Required range: x >= 0
maxDurationMs
integer<int64>

Filter to connections lasting at most this many milliseconds.

Required range: x >= 0
orderBy
enum<string>
default:startedAt

Property to order the results by.

Available options:
startedAt,
endedAt,
bytesIn,
bytesOut,
totalBytes,
durationMs
order
enum<string>
default:desc

Sort direction.

Available options:
asc,
desc

Response

A page of connections.

A page of connections.

items
object[]
required
pagination
object
required

Pagination metadata for a list response.