# Batch set profile proxy

Bind a proxy to multiple profiles. When `proxyId` matches an existing proxy, the profiles are
bound to it; otherwise a new proxy is created from the supplied connection details.
Provide at least one of `envIds` or `uniqueIds`.

Endpoint: POST /env/setProxy/batch
Version: 1.0.0
Security: OpenApiBearer

## Request fields (application/json):

  - `envIds` (array)
    Profile IDs.

  - `uniqueIds` (array)
    Profile sequence numbers.
    Example: [1001]

  - `proxy` (object)
    Proxy connection details. When `proxyId` refers to an existing proxy, that proxy is reused;
otherwise a new proxy is created from these fields.

  - `proxy.proxyId` (string)
    Existing proxy ID.
    Example: 1800000000000101

  - `proxy.proxyIp` (string)
    Proxy host or IP address.
    Example: 127.0.0.1

  - `proxy.proxyPort` (integer)
    Proxy port.
    Example: 1080

  - `proxy.proxyName` (string)
    Proxy name.
    Example: proxy-a

  - `proxy.proxyType` (integer)
    Proxy protocol:
- `0` — HTTP
- `1` — HTTPS
- `2` — SOCKS5
- `3` — SSH
    Enum: 0, 1, 2, 3

  - `proxy.proxyProvider` (integer)
    Proxy provider. `0` to `3` mean a plain proxy of the matching protocol; `4` and above identify a
commercial provider:
- `0` — HTTP
- `1` — HTTPS
- `2` — SOCKS5
- `3` — SSH
- `4` — Oxylabs
- `5` — Proxys.io
- `6` — GeoSurf
- `7` — Luminati
- `8` — Lumauto
- `9` — Oxylabsauto
- `10` — Trojan
- `11` — Shadowsocks
- `12` — vmess
- `13` — ABCProxy
- `14` — LunaProxy
- `15` — IPHTML
- `16` — PiaProxy
- `17` — 922S5
- `18` — 360Proxy

Treat unknown future values as a generic commercial provider.
    Example: 0

  - `proxy.ipMonitor` (boolean)
    Whether to monitor changes to the exit IP.
    Example: true

  - `proxy.ipChangeAction` (integer)
    Action to take after the exit IP changes.
    Example: 0

  - `proxy.username` (string)
    Proxy username.
    Example: user

  - `proxy.password` (string)
    Proxy password.
    Example: pass

  - `proxy.refreshUrl` (string)
    Proxy refresh URL.
    Example: https://example.com/refresh

  - `proxy.encryptionType` (integer)
    Proxy encryption type.
    Example: 0

  - `proxy.country` (string)
    Country or region.
    Example: US

  - `proxy.state` (string)
    State or province.
    Example: CA

  - `proxy.city` (string)
    City.
    Example: Los Angeles

## Response 200 fields (application/json):

  - `code` (integer, required)
    Return result code. `0` means success; other codes indicate exceptions.
    Example: 0

  - `msg` (string | null, required)
    Error message. Usually `null` on success.
    Example: null

  - `requestId` (string)
    Operation request ID. This field may be present when the request passes through the API gateway.
    Example: 1d4f3ea968664593860b94b35d4ebf5e

  - `data` (boolean, required)
    Whether the batch operation succeeded.
    Example: true

