openapi: 3.1.0
info:
  title: Mobilerun Proxy
  version: v1
servers:
  - url: https://api.mobilerun.ai
    description: Droidrun Cloud API
security:
  - bearerAuth: []
paths:
  /connect/proxies:
    get:
      description: >-
        Returns proxies owned by the calling tenant (the X-Owner-Id header,
        falling back to X-User-ID). Credentials are omitted from the list.
      operationId: ListProxies
      parameters:
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
        - description: Filter to proxies in this country (ISO 3166-1 alpha-2, lowercase).
          in: query
          name: country
          schema:
            format: country-code
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProxyList'
          description: The caller's proxies, without credentials.
        '401':
          $ref: '#/components/responses/Unauthorized'
      security:
        - UserIDHeader: []
        - OwnerIDHeader: []
          UserIDHeader: []
      summary: List proxies
      tags:
        - Proxies
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Mobilerun from '@mobilerun/sdk';

            const client = new Mobilerun();

            const proxies = await client.connect.proxies.list();

            console.log(proxies.items);
        - lang: Python
          source: |-
            from mobilerun_sdk import Mobilerun

            client = Mobilerun()
            proxies = client.connect.proxies.list()
            print(proxies.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\tproxies, err := client.Connect.Proxies.List(context.TODO(), mobileruncloud.ConnectProxyListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", proxies.Items)\n}\n"
        - lang: CLI
          source: mobilerun-cloud connect:proxies list
    post:
      description: Provisions a proxy for the caller in the selected country.
      operationId: CreateProxy
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateProxyRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProxyWithSecret'
          description: The created proxy, including its password.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '409':
          $ref: '#/components/responses/Conflict'
      security:
        - UserIDHeader: []
        - OwnerIDHeader: []
          UserIDHeader: []
      summary: Create a proxy
      tags:
        - Proxies
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Mobilerun from '@mobilerun/sdk';


            const client = new Mobilerun();


            const response = await client.connect.proxies.buy({ country:
            'country' });


            console.log(response.id);
        - lang: Python
          source: |-
            from mobilerun_sdk import Mobilerun

            client = Mobilerun()
            response = client.connect.proxies.buy(
                country="country",
            )
            print(response.id)
        - 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.Proxies.Buy(context.TODO(), mobileruncloud.ConnectProxyBuyParams{\n\t\tCountry: \"country\",\n\t})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.ID)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud connect:proxies buy \
              --country country
  /connect/proxies/{id}:
    delete:
      description: >-
        Deletes the proxy identified by the path ID and releases its
        provisioning. Returns 404 if no such proxy exists for the caller.
      operationId: DeleteProxy
      responses:
        '204':
          description: Proxy deleted.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - UserIDHeader: []
        - OwnerIDHeader: []
          UserIDHeader: []
      summary: Delete a proxy
      tags:
        - Proxies
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Mobilerun from '@mobilerun/sdk';


            const client = new Mobilerun();


            await
            client.connect.proxies.cancel('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
        - lang: Python
          source: |-
            from mobilerun_sdk import Mobilerun

            client = Mobilerun()
            client.connect.proxies.cancel(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\n\t\"github.com/stainless-sdks/droidrun-cloud-go\"\n)\n\nfunc main() {\n\tclient := mobileruncloud.NewClient()\n\terr := client.Connect.Proxies.Cancel(context.TODO(), \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud connect:proxies cancel \
              --id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
    get:
      description: >-
        Returns the proxy identified by the path ID. The response includes the
        proxy's password.
      operationId: GetProxy
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProxyWithSecret'
          description: The proxy, including its password.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - UserIDHeader: []
        - OwnerIDHeader: []
          UserIDHeader: []
      summary: Get proxy by ID
      tags:
        - Proxies
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Mobilerun from '@mobilerun/sdk';


            const client = new Mobilerun();


            const proxy = await
            client.connect.proxies.retrieve('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');


            console.log(proxy.id);
        - lang: Python
          source: |-
            from mobilerun_sdk import Mobilerun

            client = Mobilerun()
            proxy = client.connect.proxies.retrieve(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(proxy.id)
        - 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\tproxy, err := client.Connect.Proxies.Get(context.TODO(), \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", proxy.ID)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud connect:proxies retrieve \
              --id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
  /connect/proxies/{id}/connections:
    get:
      description: >-
        Returns the connection history recorded for this proxy, 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: ListProxyConnections
      parameters:
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
        - $ref: '#/components/parameters/ConnSessionId'
        - $ref: '#/components/parameters/ConnUserId'
        - $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: []
        - OwnerIDHeader: []
          UserIDHeader: []
      summary: List Proxy Connections
      tags:
        - Proxies
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Mobilerun from '@mobilerun/sdk';

            const client = new Mobilerun();

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

            console.log(response.items);
        - lang: Python
          source: |-
            from mobilerun_sdk import Mobilerun

            client = Mobilerun()
            response = client.connect.proxies.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.Proxies.ListConnections(\n\t\tcontext.TODO(),\n\t\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\tmobileruncloud.ConnectProxyListConnectionsParams{},\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:proxies list-connections \
              --id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
  /connect/proxies/{id}/ping:
    get:
      description: >-
        Returns the most recent cached network-latency measurement for the
        proxy, sampled periodically by connecting through the proxy to a fixed
        target. `latency` is null when no measurement is available yet (e.g. the
        proxy is not active, or it has not been sampled since coming online).
      operationId: PingProxy
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ProxyLatency'
          description: The proxy's latest latency reading.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - UserIDHeader: []
        - OwnerIDHeader: []
          UserIDHeader: []
      summary: Latency check
      tags:
        - Proxies
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Mobilerun from '@mobilerun/sdk';


            const client = new Mobilerun();


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


            console.log(response.latency);
        - lang: Python
          source: |-
            from mobilerun_sdk import Mobilerun

            client = Mobilerun()
            response = client.connect.proxies.ping(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(response.latency)
        - 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.Proxies.Ping(context.TODO(), \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", response.Latency)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud connect:proxies ping \
              --id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
  /connect/countries:
    get:
      description: Lookup of countries that can be selected when creating a proxy.
      operationId: ListCountries
      parameters:
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
        - description: Filter to countries offering this proxy type.
          in: query
          name: type
          schema:
            $ref: '#/components/schemas/ProxyType'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CountryList'
          description: Available countries.
      summary: List available countries
      tags:
        - Countries
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Mobilerun from '@mobilerun/sdk';

            const client = new Mobilerun({
              apiKey: process.env['MOBILERUN_CLOUD_API_KEY'], // This is the default and can be omitted
            });

            const countries = await client.connect.countries.list();

            console.log(countries.items);
        - lang: Python
          source: |-
            import os
            from mobilerun_sdk import Mobilerun

            client = Mobilerun(
                api_key=os.environ.get("MOBILERUN_CLOUD_API_KEY"),  # This is the default and can be omitted
            )
            countries = client.connect.countries.list()
            print(countries.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\t\"github.com/stainless-sdks/droidrun-cloud-go/option\"\n)\n\nfunc main() {\n\tclient := mobileruncloud.NewClient(\n\t\toption.WithAPIKey(\"My API Key\"),\n\t)\n\tcountries, err := client.Connect.Countries.List(context.TODO(), mobileruncloud.ConnectCountryListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", countries.Items)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud connect:countries list \
              --api-key 'My API Key'
  /connect/users:
    get:
      description: >-
        Returns SOCKS5 users owned by the caller. Passwords are omitted from the
        list.
      operationId: ListUsers
      parameters:
        - $ref: '#/components/parameters/Page'
        - $ref: '#/components/parameters/PageSize'
        - description: >-
            Filter to users bound to this proxy. Users not bound to it
            (including unbound users) are excluded.
          in: query
          name: proxyId
          schema:
            format: uuid
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserList'
          description: The caller's SOCKS5 users, without credentials.
        '401':
          $ref: '#/components/responses/Unauthorized'
      security:
        - UserIDHeader: []
        - OwnerIDHeader: []
          UserIDHeader: []
      summary: List SOCKS5 users
      tags:
        - Users
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Mobilerun from '@mobilerun/sdk';

            const client = new Mobilerun();

            const users = await client.connect.users.list();

            console.log(users.items);
        - lang: Python
          source: |-
            from mobilerun_sdk import Mobilerun

            client = Mobilerun()
            users = client.connect.users.list()
            print(users.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\tusers, err := client.Connect.Users.List(context.TODO(), mobileruncloud.ConnectUserListParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", users.Items)\n}\n"
        - lang: CLI
          source: mobilerun-cloud connect:users list
    post:
      description: >-
        Creates a SOCKS5 credential, optionally bound to a proxy for dedicated
        routing. Username and password are generated when omitted.
      operationId: CreateUser
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateUserRequest'
        required: true
      responses:
        '201':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserWithSecret'
          description: The created user, including its password.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
      security:
        - UserIDHeader: []
        - OwnerIDHeader: []
          UserIDHeader: []
      summary: Create a SOCKS5 user
      tags:
        - Users
      x-codeSamples:
        - lang: JavaScript
          source: |-
            import Mobilerun from '@mobilerun/sdk';

            const client = new Mobilerun();

            const user = await client.connect.users.create();

            console.log(user.id);
        - lang: Python
          source: |-
            from mobilerun_sdk import Mobilerun

            client = Mobilerun()
            user = client.connect.users.create()
            print(user.id)
        - 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\tuser, err := client.Connect.Users.New(context.TODO(), mobileruncloud.ConnectUserNewParams{})\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", user.ID)\n}\n"
        - lang: CLI
          source: mobilerun-cloud connect:users create
  /connect/users/{id}:
    delete:
      description: >-
        Deletes the SOCKS5 user identified by the path ID, revoking its
        credentials and any proxy binding. Returns 404 if no such user exists
        for the caller.
      operationId: DeleteUser
      responses:
        '204':
          description: User deleted.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - UserIDHeader: []
        - OwnerIDHeader: []
          UserIDHeader: []
      summary: Delete a SOCKS5 user
      tags:
        - Users
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Mobilerun from '@mobilerun/sdk';


            const client = new Mobilerun();


            await
            client.connect.users.delete('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e');
        - lang: Python
          source: |-
            from mobilerun_sdk import Mobilerun

            client = Mobilerun()
            client.connect.users.delete(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\n\t\"github.com/stainless-sdks/droidrun-cloud-go\"\n)\n\nfunc main() {\n\tclient := mobileruncloud.NewClient()\n\terr := client.Connect.Users.Delete(context.TODO(), \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud connect:users delete \
              --id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
    get:
      description: >-
        Returns the SOCKS5 user identified by the path ID. The response includes
        the user's password.
      operationId: GetUser
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/UserWithSecret'
          description: The user, including its password.
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - UserIDHeader: []
        - OwnerIDHeader: []
          UserIDHeader: []
      summary: Get a SOCKS5 user by ID
      tags:
        - Users
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Mobilerun from '@mobilerun/sdk';


            const client = new Mobilerun();


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


            console.log(user.id);
        - lang: Python
          source: |-
            from mobilerun_sdk import Mobilerun

            client = Mobilerun()
            user = client.connect.users.retrieve(
                "182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(user.id)
        - 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\tuser, err := client.Connect.Users.Get(context.TODO(), \"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\")\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", user.ID)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud connect:users retrieve \
              --id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
    patch:
      description: Rebind the user to a different proxy (or detach it by passing null).
      operationId: UpdateUser
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateUserRequest'
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/User'
          description: The updated user.
        '400':
          $ref: '#/components/responses/BadRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
      security:
        - UserIDHeader: []
        - OwnerIDHeader: []
          UserIDHeader: []
      summary: Update a SOCKS5 user
      tags:
        - Users
      x-codeSamples:
        - lang: JavaScript
          source: >-
            import Mobilerun from '@mobilerun/sdk';


            const client = new Mobilerun();


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


            console.log(user.id);
        - lang: Python
          source: |-
            from mobilerun_sdk import Mobilerun

            client = Mobilerun()
            user = client.connect.users.update(
                id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
            )
            print(user.id)
        - 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\tuser, err := client.Connect.Users.Update(\n\t\tcontext.TODO(),\n\t\t\"182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e\",\n\t\tmobileruncloud.ConnectUserUpdateParams{},\n\t)\n\tif err != nil {\n\t\tpanic(err.Error())\n\t}\n\tfmt.Printf(\"%+v\\n\", user.ID)\n}\n"
        - lang: CLI
          source: |-
            mobilerun-cloud connect:users update \
              --id 182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e
  /connect/users/{id}/connections:
    get:
      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: []
        - OwnerIDHeader: []
          UserIDHeader: []
      summary: List connections by SOCKS5 user
      tags:
        - Users
      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
    ConnUserId:
      description: Filter to connections made by this user.
      in: query
      name: userId
      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
    ConnProxyId:
      description: Filter to connections routed through this proxy.
      in: query
      name: proxyId
      schema:
        format: uuid
        type: string
  schemas:
    ProxyList:
      description: A page of proxies.
      properties:
        items:
          items:
            $ref: '#/components/schemas/Proxy'
          type: array
        pagination:
          $ref: '#/components/schemas/PaginationMeta1'
      required:
        - items
        - pagination
      type: object
    CreateProxyRequest:
      properties:
        country:
          description: ISO 3166-1 alpha-2 country code to provision the proxy in.
          format: country-code
          type: string
        type:
          $ref: '#/components/schemas/ProxyType'
      required:
        - country
      type: object
    ProxyWithSecret:
      allOf:
        - $ref: '#/components/schemas/Proxy'
        - properties:
            password:
              type: string
            paymentUrl:
              description: >-
                Checkout URL to complete payment while status is
                `pending_payment`. Null once paid or when no payment was
                required.
              nullable: true
              type: string
          required:
            - password
          type: object
      description: >-
        A proxy including its password. Returned only on create and single-proxy
        reads.
    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
    ProxyLatency:
      description: The latest cached latency reading for a proxy.
      properties:
        latency:
          allOf:
            - $ref: '#/components/schemas/LatencySample'
          description: The latest reading, or null if none has been taken yet.
          nullable: true
        proxyId:
          format: uuid
          type: string
      required:
        - proxyId
        - latency
      type: object
    ProxyType:
      default: dedicated_residential
      enum:
        - dedicated_residential
        - residential
        - mobile
      type: string
    CountryList:
      description: A page of countries.
      properties:
        items:
          items:
            $ref: '#/components/schemas/Country'
          type: array
        pagination:
          $ref: '#/components/schemas/PaginationMeta1'
      required:
        - items
        - pagination
      type: object
    UserList:
      description: A page of SOCKS5 users.
      properties:
        items:
          items:
            $ref: '#/components/schemas/User'
          type: array
        pagination:
          $ref: '#/components/schemas/PaginationMeta1'
      required:
        - items
        - pagination
      type: object
    CreateUserRequest:
      properties:
        password:
          description: >-
            Desired SOCKS5 password, 1-255 bytes (RFC 1929). Generated when
            omitted.
          maxLength: 255
          minLength: 1
          type: string
        proxyId:
          description: Proxy to bind the user to for dedicated routing.
          format: uuid
          type: string
        username:
          description: >-
            Desired SOCKS5 username, 1-255 bytes (RFC 1929). Generated when
            omitted.
          maxLength: 255
          minLength: 1
          type: string
      type: object
    UserWithSecret:
      allOf:
        - $ref: '#/components/schemas/User'
        - properties:
            password:
              type: string
          required:
            - password
          type: object
      description: >-
        A SOCKS5 user including its password. Returned only on create and
        single-user reads.
    UpdateUserRequest:
      properties:
        proxyId:
          description: >-
            Proxy to rebind to, or null to detach. Omit to leave the user's
            current binding unchanged — only an explicit null detaches.
          format: uuid
          nullable: true
          type: string
          x-go-type: nullable.Nullable[openapi_types.UUID]
          x-go-type-import:
            path: github.com/oapi-codegen/nullable
          x-go-type-skip-optional-pointer: true
      type: object
    User:
      description: A SOCKS5 credential without its password.
      properties:
        createdAt:
          format: date-time
          type: string
        id:
          format: uuid
          type: string
        proxyId:
          description: >-
            The proxy this user routes to (dedicated routing), or null if
            unbound.
          format: uuid
          nullable: true
          type: string
        username:
          type: string
      required:
        - id
        - username
        - createdAt
      type: object
    Proxy:
      description: A provisioned proxy without its credentials.
      properties:
        country:
          description: ISO 3166-1 alpha-2 country code (lowercase).
          type: string
        createdAt:
          format: date-time
          type: string
        host:
          type: string
        id:
          format: uuid
          type: string
        port:
          format: int32
          type: integer
        status:
          $ref: '#/components/schemas/ProxyStatus'
        type:
          $ref: '#/components/schemas/ProxyType'
        username:
          type: string
      required:
        - id
        - country
        - type
        - status
        - host
        - port
        - username
        - createdAt
      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
    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
    LatencySample:
      description: An aggregated latency measurement taken through the proxy.
      properties:
        avgMs:
          description: Mean round-trip time over successful probes, in milliseconds.
          type: integer
        jitterMs:
          description: >-
            Round-trip time spread (max - min) over successful probes, in
            milliseconds.
          type: integer
        maxMs:
          description: Maximum round-trip time over successful probes, in milliseconds.
          type: integer
        measuredAt:
          description: When this measurement was taken.
          format: date-time
          type: string
        minMs:
          description: Minimum round-trip time over successful probes, in milliseconds.
          type: integer
        packetLoss:
          description: >-
            Fraction of probes that failed, 0..1 (1 means the proxy was
            unreachable; rtt fields are 0).
          type: number
        samples:
          description: Number of probes taken in this measurement.
          type: integer
        target:
          description: The host:port the latency was measured against, through the proxy.
          type: string
      required:
        - target
        - samples
        - minMs
        - avgMs
        - maxMs
        - jitterMs
        - packetLoss
        - measuredAt
      type: object
    Country:
      properties:
        code:
          description: ISO 3166-1 alpha-2 country code (lowercase).
          example: us
          type: string
        name:
          example: United States
          type: string
        proxyTypes:
          description: Proxy types available to provision in this country.
          items:
            $ref: '#/components/schemas/ProxyType'
          minItems: 1
          type: array
      required:
        - code
        - name
        - proxyTypes
      type: object
    ProxyStatus:
      description: >-
        Lifecycle of a proxy. A freshly created proxy is `provisioning` — or
        `pending_payment` until the customer completes checkout — and becomes
        `active` once its upstream is assigned. `cancelling` retains full access
        through the paid period; when the subscription expires the proxy is
        `ended`. `error` marks a failed provisioning attempt.
      enum:
        - pending_payment
        - provisioning
        - active
        - cancelling
        - ended
        - error
      type: string
    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, or a present X-Owner-Id
        header was not a uuid.
    BadRequest:
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ErrorResponse1'
      description: The request was invalid.
    Conflict:
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/ErrorResponse1'
      description: >-
        The request cannot be fulfilled in the current state (e.g. the provider
        has no capacity for the requested country/type).
    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
