# 修改浏览器

更新已有的浏览器。只修改请求中出现的字段。
- **前置条件**
：浏览器必须存在于团队中。端到端加密的浏览器不可更新。操作系统与浏览器类型不可更改。运行中的浏览器可以更新。
- **副作用**
：写入浏览器主记录、其扩展设置与 Cookie，并合并高级指纹设置（未被覆盖的已有值保留）。
- **完成信号**
：同步。
- **重试**
：相同请求体可安全重复。注意没有乐观锁：对同一浏览器的并发更新是后写覆盖，且指纹合并是先读后写，因此并发调用可能丢失变更。
- **Open API**
：需要重新匹配内核时，使用浏览器上已保存的操作系统。不读取任何客户端操作系统或版本。

已记录的业务错误码：`19001`, `19039`, `19104`, `19105`, `19106`, `19107`, `19108`, `19142`, `19159`, `19160`, `19175`, `19193`。 各错误码的含义见 [Error Codes](/zh/api-reference/getting-started/error-codes)。任何接口还可能返回通用错误码。

Endpoint: POST /env/update
Version: 2026-09-05
Security: OpenApiBearer

## Security:

  - `OpenApiBearer` (unknown)
    http bearer JWT

## Request fields (application/json):

  - `envId` (string, required)
    浏览器 ID。请求也接受字段别名 `id`。
    Example: 1800000000000001

  - `envName` (string)
    浏览器名称。
    Example: marketing-01-updated

  - `groupId` (string)
    分组 ID。`0` 表示未分组。
    Example: 0

  - `groupName` (string)
    分组名称。传入后会自动查找或创建该分组。
    Example: Marketing

  - `tagIds` (array)
    标签 ID 列表。
    Example: ["1800000000000301"]

  - `proxyId` (string)
    已有代理 ID。`0` 表示不使用代理。
    Example: 0

  - `envRemark` (string)
    浏览器备注。
    Example: Updated through the Open API

  - `uaVersion` (integer)
    UA 主版本号。
    Example: 124

  - `browserCore` (integer)
    内核主版本号。
    Example: 124

  - `systemBitType` (integer)
    系统位数。默认 `1`：
- `0`
 — 32 位
- `1`
 — 64 位
    Enum: "0", "1"

  - `architecture` (integer)
    CPU 架构，默认 `0`：
- `0`
 — x86
- `1`
 — ARM
    Enum: "0", "1"

  - `accountInfo` (object)
    绑定到该浏览器的平台账号。

  - `accountInfo.username` (string)
    平台账号用户名。
    Example: account@example.com

  - `accountInfo.password` (string)
    平台账号密码。
    Example: secret

  - `accountInfo.siteId` (string)
    站点 ID。
    Example: 1800000000000201

  - `accountInfo.platformId` (string, required)
    平台 ID。`9999` 表示自定义平台。
    Example: 9999

  - `accountInfo.customerUrl` (string)
    自定义平台 URL。当 `platformId` 为 `9999` 时必填，必须是合法 URL。
    Example: https://example.com

  - `accountInfo.otpSecret` (string)
    双因素认证（2FA）密钥。
    Example: BASE32SECRET

  - `isShowAccount` (integer)
    密码保护开关。
    Enum: "0", "1"

  - `afterStartupConfig` (object)
    浏览器启动后的行为。

  - `afterStartupConfig.afterStartup` (integer)
    启动行为。默认 `1`：
- `1`
 — 重新打开上次会话的页面
- `2`
 — 打开指定页面
- `3`
 — 打开指定页面和平台
- `4`
 — 重新打开上次会话的页面和平台
    Enum: "1", "2", "3", "4"

  - `afterStartupConfig.autoOpenUrls` (array)
    启动后自动打开的页面。每项必须是合法 URL。
    Example: ["https://example.com"]

  - `afterStartupConfig.stayOnCheckIPPage` (boolean)
    启动后是否停留在 IP 检测页面。
    Example: false

  - `startupParams` (array)
    Example: ["--disable-notifications"]

  - `cookies` (string)
    以 JSON 文本形式提供的 Cookie。
    Example: [{"name":"sid","value":"abc"}]

  - `advancedSetting` (object)
    动态指纹配置。键来自浏览器高级设置协议；每个值可能是字符串、数字、布尔、数组或对象，取决于具体的键。
    Example: {"language":"en-US","timezone":"America/Los_Angeles"}

  - `disableAudio` (integer)
    是否禁止音频播放。
    Enum: "0", "1"

  - `disableVideo` (integer)
    是否禁止视频加载。
    Enum: "0", "1"

  - `disableImg` (integer)
    是否禁止图片加载。
    Enum: "0", "1"

  - `imgLimitSize` (integer)
    允许加载的图片最大尺寸，单位 KB。
    Example: 1000

  - `hostnameSource` (integer)
    设备名称来源：
- `0`
 — 自定义
- `1`
 — 真实
    Enum: "0", "1"

  - `hostname` (string)
    设备名称。当 `hostnameSource` 为 `0` 时使用。
    Example: DESKTOP-OPENAPI

  - `macAddressSource` (integer)
    MAC 地址来源：
- `0`
 — 自定义
- `1`
 — 真实
    Enum: "0", "1"

  - `macAddress` (string)
    MAC 地址。当 `macAddressSource` 为 `0` 时使用。
    Example: 00:16:3E:12:34:56

## Response 200:

  - `200` (unknown)
    Success

## 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` (null)
    Example: null

