# Adding proxy

Create a proxy configuration in the team.
- **Preconditions**: `proxyPort` is required and must be 1–65535, and `proxyProvider` must be a recognised provider.
- **Effect**: inserts a proxy record and returns its id, ready to bind to profiles. Nothing is sent to the proxy vendor.
- **Completion**: synchronous.
- **Retry**: **there is no name or configuration uniqueness check.** Posting the same body twice produces two proxies with two ids. After a timeout, search `/proxyInfo/page` before resending.

Documented business errors: `14023`. See [Error Codes](../Getting%20Started/error-codes.md) for what each code means. Any operation can additionally return the common codes.

Endpoint: POST /api/proxyInfo/add
Version: 2026-09-05

## Request fields (application/json):

  - `city` (string)
    City

  - `country` (string)
    Country code (ISO 3166-1 alpha-2). Required only if proxyProvider=17.
    Example: AD

  - `encryptionType` (integer)
    Encryption type, valid values are integers from 1 to 14.
    Example: 14

  - `ipChangeAction` (integer)
    Action on IP change:0 = Block, 1 = Warn
    Example: 1

  - `ipMonitor` (boolean)
    Enable IP change monitoring
    Example: false

  - `password` (string)
    Password for proxy authentication

  - `proxyIp` (string, required)
    Proxy IP address
    Example: 8.10.22.46

  - `proxyName` (string)
    Proxy name (supports placeholders like {{random}})
    Example: sock5_{{random}}

  - `proxyPort` (integer, required)
    Proxy port number
    Example: 65534

  - `proxyProvider` (integer, required)
    Proxy provider type:
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.
Special rules:
- If proxyProvider is 7 or 8, proxyType is required.
- If proxyProvider is 17, country is required; state and city are optional.
    Example: 2

  - `proxyType` (integer)
    Proxy protocol type: 0=HTTP, 1=HTTPS, 2=SOCKS5, 3=SSH.
Required only when proxyProvider is 7 or 8.
    Example: 1

  - `refreshUrl` (string)
    URL to refresh dynamic proxy IP (if supported)

  - `state` (string)
    State/Province

  - `username` (string)
    Username for proxy authentication

## Response 200 fields (application/json):

  - `code` (integer, required)
    Return result code 0:Normal Other codes are exceptions.

  - `msg` (string | null, required)
    Error message

  - `data` (integer, required)
    Proxy ID

  - `requestId` (string, required)
    Operation Request ID

