> ## Documentation Index
> Fetch the complete documentation index at: https://docs.mobilerun.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# List connections by SOCKS5 user

> 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.



## OpenAPI

````yaml /api-reference/mobilerun-proxy.yaml get /connect/users/{id}/connections
openapi: 3.1.0
info:
  title: Mobilerun Proxy
  version: v1
servers:
  - url: https://api.mobilerun.ai
    description: Droidrun Cloud API
security:
  - bearerAuth: []
paths:
  /connect/users/{id}/connections:
    get:
      tags:
        - Users
      summary: List connections by SOCKS5 user
      description: >-
        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.
      operationId: ListUserConnections
      parameters:
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
        - $ref: '#/components/parameters/ConnSessionId'
        - $ref: '#/components/parameters/ConnProxyId'
        - $ref: '#/components/parameters/ConnDstHost'
        - $ref: '#/components/parameters/ConnDstPort'
        - $ref: '#/components/parameters/ConnProtocol'
        - $ref: '#/components/parameters/ConnProvider'
        - $ref: '#/components/parameters/ConnCountry'
        - $ref: '#/components/parameters/ConnCloseReason'
        - $ref: '#/components/parameters/ConnStatus'
        - $ref: '#/components/parameters/ConnStartedAfter'
        - $ref: '#/components/parameters/ConnStartedBefore'
        - $ref: '#/components/parameters/ConnEndedAfter'
        - $ref: '#/components/parameters/ConnEndedBefore'
        - $ref: '#/components/parameters/ConnMinBytesIn'
        - $ref: '#/components/parameters/ConnMaxBytesIn'
        - $ref: '#/components/parameters/ConnMinBytesOut'
        - $ref: '#/components/parameters/ConnMaxBytesOut'
        - $ref: '#/components/parameters/ConnMinTotalBytes'
        - $ref: '#/components/parameters/ConnMaxTotalBytes'
        - $ref: '#/components/parameters/ConnMinDurationMs'
        - $ref: '#/components/parameters/ConnMaxDurationMs'
        - $ref: '#/components/parameters/ConnOrderBy'
        - $ref: '#/components/parameters/ConnOrder'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ConnectionList'
          description: A page of connections.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '503':
          $ref: '#/components/responses/ServiceUnavailable'
      security:
        - UserIDHeader: []
      x-codeSamples:
        - lang: JavaScript
          source: >-
            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);
        - lang: Python
          source: |-
            from mobilerun_sdk import Mobilerun

            client = Mobilerun()
            response = client.connect.users.list_connections(
                id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(response.items)
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\n\t\"github.com/stainless-sdks/droidrun-cloud-go\"\n)\n\nfunc main() {\n\tclient := mobileruncloud.NewClient()\n\tresponse, err := client.Connect.Users.ListConnections(\n\t\tcontext.TODO(),\n\t\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\tmobileruncloud.ConnectUserListConnectionsParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Items)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud connect:users list-connections \
              --id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
components:
  parameters:
    Page:
      description: Page number (1-based).
      in: query
      name: page
      schema:
        default: 1
        minimum: 1
        type: integer
    PageSize:
      description: Number of items per page.
      in: query
      name: pageSize
      schema:
        default: 20
        maximum: 100
        minimum: 1
        type: integer
    ConnSessionId:
      description: Filter to a single connection by its session id.
      in: query
      name: sessionId
      schema:
        format: uuid
        type: string
    ConnProxyId:
      description: Filter to connections routed through this proxy.
      in: query
      name: proxyId
      schema:
        format: uuid
        type: string
    ConnDstHost:
      description: Filter to connections to this destination host (exact match).
      in: query
      name: dstHost
      schema:
        type: string
    ConnDstPort:
      description: Filter to connections to this destination port.
      in: query
      name: dstPort
      schema:
        maximum: 65535
        minimum: 0
        type: integer
    ConnProtocol:
      description: Filter to connections of this transport protocol.
      in: query
      name: protocol
      schema:
        $ref: '#/components/schemas/ConnectionProtocol'
    ConnProvider:
      description: Filter to connections served by this upstream provider.
      in: query
      name: provider
      schema:
        type: string
    ConnCountry:
      description: >-
        Filter to connections served from this upstream country (ISO 3166-1
        alpha-2).
      in: query
      name: country
      schema:
        type: string
    ConnCloseReason:
      description: >-
        Filter to connections that closed with this reason (closed connections
        only).
      in: query
      name: closeReason
      schema:
        type: string
    ConnStatus:
      description: Filter by connection status.
      in: query
      name: status
      schema:
        $ref: '#/components/schemas/ConnectionStatus'
    ConnStartedAfter:
      description: Filter to connections that started at or after this time (inclusive).
      in: query
      name: startedAfter
      schema:
        format: date-time
        type: string
    ConnStartedBefore:
      description: Filter to connections that started at or before this time (inclusive).
      in: query
      name: startedBefore
      schema:
        format: date-time
        type: string
    ConnEndedAfter:
      description: >-
        Filter to connections whose last activity was at or after this time
        (inclusive).
      in: query
      name: endedAfter
      schema:
        format: date-time
        type: string
    ConnEndedBefore:
      description: >-
        Filter to connections whose last activity was at or before this time
        (inclusive).
      in: query
      name: endedBefore
      schema:
        format: date-time
        type: string
    ConnMinBytesIn:
      description: >-
        Filter to connections with at least this many bytes received from
        upstream.
      in: query
      name: minBytesIn
      schema:
        format: int64
        minimum: 0
        type: integer
    ConnMaxBytesIn:
      description: >-
        Filter to connections with at most this many bytes received from
        upstream.
      in: query
      name: maxBytesIn
      schema:
        format: int64
        minimum: 0
        type: integer
    ConnMinBytesOut:
      description: Filter to connections with at least this many bytes sent to upstream.
      in: query
      name: minBytesOut
      schema:
        format: int64
        minimum: 0
        type: integer
    ConnMaxBytesOut:
      description: Filter to connections with at most this many bytes sent to upstream.
      in: query
      name: maxBytesOut
      schema:
        format: int64
        minimum: 0
        type: integer
    ConnMinTotalBytes:
      description: >-
        Filter to connections with at least this much total traffic (bytesIn +
        bytesOut).
      in: query
      name: minTotalBytes
      schema:
        format: int64
        minimum: 0
        type: integer
    ConnMaxTotalBytes:
      description: >-
        Filter to connections with at most this much total traffic (bytesIn +
        bytesOut).
      in: query
      name: maxTotalBytes
      schema:
        format: int64
        minimum: 0
        type: integer
    ConnMinDurationMs:
      description: Filter to connections lasting at least this many milliseconds.
      in: query
      name: minDurationMs
      schema:
        format: int64
        minimum: 0
        type: integer
    ConnMaxDurationMs:
      description: Filter to connections lasting at most this many milliseconds.
      in: query
      name: maxDurationMs
      schema:
        format: int64
        minimum: 0
        type: integer
    ConnOrderBy:
      description: Property to order the results by.
      in: query
      name: orderBy
      schema:
        default: startedAt
        enum:
          - startedAt
          - endedAt
          - bytesIn
          - bytesOut
          - totalBytes
          - durationMs
        type: string
    ConnOrder:
      description: Sort direction.
      in: query
      name: order
      schema:
        default: desc
        enum:
          - asc
          - desc
        type: string
  schemas:
    ConnectionList:
      description: A page of connections.
      properties:
        items:
          items:
            $ref: '#/components/schemas/Connection'
          type: array
        pagination:
          $ref: '#/components/schemas/PaginationMeta1'
      required:
        - items
        - pagination
      type: object
    ConnectionProtocol:
      description: Transport protocol of a connection.
      enum:
        - tcp
        - udp
        - unknown
      type: string
    ConnectionStatus:
      description: >-
        `active` while the connection is still open (no terminal record yet);
        `closed` once it has ended.
      enum:
        - active
        - closed
      type: string
    Connection:
      description: >-
        A single proxy connection, aggregated across its lifetime. Byte counts
        are totals for the whole connection.
      properties:
        bytesIn:
          description: Total bytes received from upstream over the connection's lifetime.
          format: int64
          type: integer
        bytesOut:
          description: Total bytes sent to upstream over the connection's lifetime.
          format: int64
          type: integer
        closeReason:
          description: Why the connection closed; null while still active.
          nullable: true
          type: string
        country:
          description: Upstream country code (ISO 3166-1 alpha-2), or empty if unknown.
          type: string
        dstHost:
          description: Destination host the client connected to.
          type: string
        dstPort:
          description: Destination port the client connected to.
          type: integer
        durationMs:
          description: Elapsed time between startedAt and endedAt, in milliseconds.
          format: int64
          type: integer
        endedAt:
          description: >-
            Time of the connection's last recorded activity (close time once
            closed).
          format: date-time
          type: string
        protocol:
          $ref: '#/components/schemas/ConnectionProtocol'
        provider:
          description: Upstream provider that served the connection.
          type: string
        proxyId:
          description: >-
            The proxy the connection was routed through. All-zero when the
            upstream was unresolved at capture time.
          format: uuid
          type: string
        sessionId:
          description: Unique id of this connection.
          format: uuid
          type: string
        srcIp:
          description: Client source IP address.
          type: string
        startedAt:
          description: When the connection started.
          format: date-time
          type: string
        status:
          $ref: '#/components/schemas/ConnectionStatus'
        totalBytes:
          description: bytesIn + bytesOut.
          format: int64
          type: integer
        userId:
          description: The user that made the connection.
          format: uuid
          type: string
      required:
        - sessionId
        - userId
        - proxyId
        - srcIp
        - dstHost
        - dstPort
        - protocol
        - provider
        - country
        - bytesIn
        - bytesOut
        - totalBytes
        - startedAt
        - endedAt
        - durationMs
        - status
      type: object
    PaginationMeta1:
      description: Pagination metadata for a list response.
      properties:
        hasNext:
          description: Whether a next page exists.
          type: boolean
        hasPrev:
          description: Whether a previous page exists.
          type: boolean
        page:
          description: Current page number (1-based).
          type: integer
        pageSize:
          description: Number of items per page.
          type: integer
        pages:
          description: Total number of pages.
          type: integer
        total:
          description: Total number of items across all pages.
          type: integer
      required:
        - page
        - pageSize
        - total
        - pages
        - hasNext
        - hasPrev
      type: object
    ErrorResponse1:
      description: A Problem Details (RFC 7807-style) error response.
      properties:
        detail:
          description: Human-readable explanation of this occurrence.
          type: string
        errors:
          description: Per-input errors, when applicable.
          items:
            $ref: '#/components/schemas/ErrorDetail1'
          type: array
        status:
          description: HTTP status code.
          type: integer
        title:
          description: Short, human-readable summary of the error type.
          type: string
      required:
        - title
        - status
        - detail
        - errors
      type: object
    ErrorDetail1:
      description: A single error, locating an offending input where applicable.
      properties:
        location:
          description: Path to the offending input, e.g. "body.proxyId".
          type: string
        message:
          description: Human-readable description of this error.
          type: string
        value:
          description: The offending value, when available.
      required:
        - location
        - message
      type: object
  responses:
    Unauthorized:
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ErrorResponse1'
      description: The X-User-ID header was missing or invalid.
    NotFound:
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ErrorResponse1'
      description: The resource was not found.
    ServiceUnavailable:
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ErrorResponse1'
      description: The connection-insights backend is disabled or temporarily unavailable.
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: Opaque
      description: Bearer token via Authorization header

````