# クラウドランタイムに接続

起動中のクラウドランタイムへの接続情報を返します。
- **前提条件**
：ランタイムがちょうど
`RUNNING`
 状態で、かつ自分が起動したものである必要があります。停止中またはアーカイブ中のランタイムは、
`/cloudbrowser/page`
 がまだ
`RUNNING`
 と報告していても拒否されます。
- **副作用**
：新しいデスクトップアクセストークンを発行し、接続メンバーとして自分を記録します。
- **再呼び出し**
：返される
`cdpUrl`
 は不変で、既存の CDP セッションも動作し続けますが、呼び出しごとに新しいデスクトップトークンが発行され、記録済みの接続メンバーが上書きされます。
**以前のデスクトップ URL は失効しません**
。したがって返却された URL はすべて有効な資格情報として扱い、ログ出力や永続化は避けてください。
- **セッション上限**
：ランタイムは最大稼働時間に達すると自動停止し、その少し前からアーカイブが始まります。長時間の自動化処理では、ランタイムが消滅することを前提に設計してください。
- **用途**
：Puppeteer、Playwright、Selenium を
`cdpUrl`
 に接続します。

文書化されたビジネスエラー: `40008`, `40009`, `40010`。 各コードの意味は [Error Codes](/ja/api-reference/getting-started/error-codes) を参照してください。どの操作でも共通コードが返る場合があります。

Endpoint: POST /api/cloudbrowser/connect
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

## 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` (object, required)

  - `data.cdpUrl` (string, required)
    Full CDP (Chrome DevTools Protocol) address including the access `token` parameter. Pass this
URL to an automation framework such as Puppeteer, Playwright, or Selenium to attach to the
remote browser.
    Example: https://runtime1.morelogin.com:16167?token=c62fedaaac524e41a0f02fc4345d41cb

  - `data.accessUrl` (string | null)
    Cloud browser page wrapper address. Open it in a browser to view and control the cloud
browser desktop. `null` when the page wrapper is not configured.
The `token` parameter is a Base64-encoded payload carrying the desktop URL, desktop token,
expiry, and team, user, member, and environment IDs. The `envName` and `lang` parameters set
the displayed environment name and interface language.
    Example: https://official-website.morelogin.com/browser-remote?token=eyJkZXNrdG9wVXJsIjoi...ZW52SWQiOiIyMDczMzk1NDg5NzM4OTE5OTM2In0%3D&envName=P-1267&lang=en-US

