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

# Update a proxy config

> Replaces the proxy config identified by `proxyId` with the provided body. As with creation, the body is a `protocol`-discriminated union of socks5 or wireguard fields. Returns the updated config.



## OpenAPI

````yaml /api-reference/mobilerun-proxy/custom-proxies.yaml put /proxies/{proxyId}
openapi: 3.1.0
info:
  title: Custom Proxies
  version: v1
servers:
  - description: Droidrun Cloud API
    url: https://api.mobilerun.ai/v1
security:
  - bearerAuth: []
paths:
  /proxies/{proxyId}:
    put:
      tags:
        - Custom Proxies
      summary: Update a proxy config
      description: >-
        Replaces the proxy config identified by `proxyId` with the provided
        body. As with creation, the body is a `protocol`-discriminated union of
        socks5 or wireguard fields. Returns the updated config.
      operationId: updateProxy
      parameters:
        - in: path
          name: proxyId
          required: true
          schema:
            format: uuid
            type: string
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateProxyBody'
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  data:
                    $ref: '#/components/schemas/ProxyConfig'
                  message:
                    type: string
                  success:
                    enum:
                      - true
                    type: boolean
                required:
                  - success
                  - message
                  - data
                type: object
          description: Proxy updated
        '400':
          content:
            application/json:
              schema:
                anyOf:
                  - $ref: '#/components/schemas/CredentialErrorResponse'
                  - $ref: '#/components/schemas/ApiErrorEnvelope'
          description: >-
            Bad Request — invalid_request, package_exists, create_failed,
            update_failed, protocol_change_not_allowed (legacy body + additive
            code/message), or a generic request validation failure
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiErrorEnvelope'
          description: Unauthorized
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CredentialErrorResponse'
          description: >-
            Not Found — credential_not_found, proxy_not_found (legacy body +
            additive code/message)
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerError'
          description: Internal Server Error
      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 proxy = await
            client.proxies.update('182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', {
              host: 'x',
              name: 'xxx',
              password: 'x',
              port: 1,
              protocol: 'socks5',
              user: 'x',
            });


            console.log(proxy.data);
        - 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
            )
            proxy = client.proxies.update(
                proxy_id="182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e",
                host="x",
                name="xxx",
                password="x",
                port=1,
                protocol="socks5",
                user="x",
            )
            print(proxy.data)
components:
  schemas:
    UpdateProxyBody:
      discriminator:
        mapping:
          socks5: '#/components/schemas/UpdateSocks5Proxy'
          wireguard: '#/components/schemas/UpdateWireguardProxy'
        propertyName: protocol
      oneOf:
        - $ref: '#/components/schemas/UpdateSocks5Proxy'
        - $ref: '#/components/schemas/UpdateWireguardProxy'
    ProxyConfig:
      discriminator:
        mapping:
          socks5: '#/components/schemas/Socks5ProxyConfig'
          wireguard: '#/components/schemas/WireguardProxyConfig'
        propertyName: protocol
      oneOf:
        - $ref: '#/components/schemas/Socks5ProxyConfig'
        - $ref: '#/components/schemas/WireguardProxyConfig'
    CredentialErrorResponse:
      properties:
        code:
          $ref: '#/components/schemas/CredentialErrorCode'
        message:
          type: string
      required:
        - code
        - message
      type: object
    ApiErrorEnvelope:
      properties:
        code:
          type: string
        details: {}
        message:
          type: string
        retryAfterSeconds:
          type: number
        traceId:
          type: string
      required:
        - code
        - message
      type: object
    InternalServerError:
      properties:
        code:
          type: string
        message:
          type: string
        traceId:
          type: string
      required:
        - code
        - message
      type: object
    UpdateSocks5Proxy:
      properties:
        host:
          minLength: 1
          type: string
        name:
          maxLength: 50
          minLength: 3
          type: string
        password:
          minLength: 1
          type: string
        port:
          maximum: 65535
          minimum: 1
          type: integer
        protocol:
          enum:
            - socks5
          type: string
        user:
          minLength: 1
          type: string
      required:
        - name
        - protocol
        - host
        - port
        - user
        - password
      type: object
    UpdateWireguardProxy:
      properties:
        config:
          maxLength: 10000
          minLength: 1
          type: string
        name:
          maxLength: 50
          minLength: 3
          type: string
        protocol:
          enum:
            - wireguard
          type: string
      required:
        - name
        - protocol
        - config
      type: object
    Socks5ProxyConfig:
      properties:
        host:
          minLength: 1
          type: string
        name:
          maxLength: 50
          minLength: 3
          type: string
        password:
          minLength: 1
          type: string
        port:
          maximum: 65535
          minimum: 1
          type: integer
        protocol:
          enum:
            - socks5
          type: string
        proxyId:
          format: uuid
          type: string
        user:
          minLength: 1
          type: string
      required:
        - name
        - protocol
        - host
        - port
        - user
        - password
        - proxyId
      type: object
    WireguardProxyConfig:
      properties:
        config:
          maxLength: 10000
          minLength: 1
          type: string
        name:
          maxLength: 50
          minLength: 3
          type: string
        protocol:
          enum:
            - wireguard
          type: string
        proxyId:
          format: uuid
          type: string
      required:
        - name
        - protocol
        - config
        - proxyId
      type: object
    CredentialErrorCode:
      enum:
        - credential_read_only
        - credential_source_unavailable
        - credential_source_rate_limited
        - onepassword_not_connected
        - onepassword_token_invalid
        - onepassword_no_vaults
        - onepassword_reference_invalid
        - invalid_request
        - package_exists
        - credential_not_found
        - proxy_not_found
        - create_failed
        - update_failed
        - protocol_change_not_allowed
      type: string
  securitySchemes:
    bearerAuth:
      bearerFormat: Opaque
      description: Bearer token via Authorization header
      scheme: bearer
      type: http

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.