# 停止云端运行环境

停止浏览器所在的云端运行实例。
- **前置条件**：该浏览器必须有一个由你启动的进行中运行实例。若实例已停止或正在释放，调用成功但不做任何事。
- **副作用**：停止计费、结算用量、释放浏览器占用锁，并在释放实例前让客户端把 profile 和 Cookie 归档回云端。
- **完成信号**：**已受理，未完成。** 请轮询 `/cloudbrowser/page` 直到 `cloudBrowserStatus` 为 `CLOSED` 且 `cloudBrowserArchiveStatus` 到达 `COMPLETED` 或 `FAILED`。
- **归档失败时**：该运行实例仍在计费，且仍显示为 `RUNNING`。`force` **仅在这种状态下生效**：它跳过归档直接释放实例，代价是本次会话的 profile 变更会丢失。
- **并发**：同一运行实例的并发停止会被串行化，重复调用是安全的。

已记录的业务错误码：`40002`, `40006`, `40008`, `40020`。 各错误码的含义见 [Error Codes](../Getting%20Started/error-codes.md)。任何接口还可能返回通用错误码。

Endpoint: POST /api/cloudbrowser/stop
Version: 2026-09-05

## Request fields (application/json):

  - `envId` (string, required)
    Browser profile (environment) ID. Serialized as a decimal string to avoid JavaScript
precision loss on 64-bit integers.
    Example: 1800000000000001

  - `force` (boolean)
    Whether to forcibly release the cloud runtime. Only takes effect when the current run has
an archive status of `FAILED`; in that case the archive step is skipped and runtime
resources are reclaimed. Ignored in all other cases.
    Example: false

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

