Open a browser connection
Launch or reuse a dedicated Chromium profile in the desktop session of a running Linux computer. Send {} for the legacy ten-minute grant, or lifecycle_version: 2 for a renewable session. Requires the guest streaming channel and Chromium. Returns a CDP WebSocket capability, with at most eight grants per computer and one active socket per grant. Use the returned URL with an Authorization: Bearer header containing the returned token, spelled exactly Authorization: Bearer <token>: Bearer capitalised, one space, and nothing after the token. Other spellings the REST API accepts are a 401 here. Account API keys, desktop tokens and query-string tokens do not authenticate this socket. Legacy expiry closes the socket and permits reconnect before expiry. Version 2 keeps expires_at as an immutable alias of attach_expires_at: attach once, before the shorter of ten minutes and lease_seconds. Its active lease defaults to 1800 seconds and the absolute session cap is 7200 seconds from creation. Renew the existing attached connection with POST /computers/{id}/browser-connections/{connection}/renew using account authorization. No independent idle timeout applies. Version 2 disconnect revokes the grant; renewal never extends the attachment credential or reconnects Chromium. DELETE closes either version without stopping the browser. The managed profile persists on disk and is shared by grants for this computer; it is separate from the default desktop profile. A stop, restart, suspend, migration, desktop-credential rotation or daemon restart invalidates the grants. Issued capabilities are delegated access: revoking the issuing API key does not itself revoke them; delete the grant or wait for expiry. Raw CDP grants full control of that browser, including JavaScript and guest file access; it is not a read-only or tab-scoped capability. WebSocket reconnect never replays commands. Clients must decide whether an interrupted action completed. The endpoint is Chromium CDP, not the Playwright server protocol.
The WebSocket handshake answers 101 when it attaches. It answers 400 when a GET whose token the host accepts is not a WebSocket upgrade; 401 for any other method, a missing, expired or revoked token, a query string on the URL, a version 2 grant that has already attached once, or a computer or account that is no longer active: a computer deleted, being deleted or written off with its host, or a suspended account. A computer whose host is only unreachable is still active; see the 503 below for what it gets. 409 when a legacy grant already has an open socket, or another handshake with the same token is still under way; 502 when the browser in the guest cannot be reached, so request a new connection; and 503 when the computer’s host cannot be found or does not answer and the host accepted this token on a handshake within the last ten minutes. That 503 says only that the token cannot be checked now. Once the host answers, a legacy grant that has not expired, or a version 2 grant that never attached, is answered on its merits; a version 2 token that has attached is spent and gets the 401, so request a new connection. A token the host has not accepted within the last ten minutes cannot be checked while the host is unreachable and gets the 401; if you just created it, read the computer or request a new connection, which say whether its host is reachable. Under heavy load, or after many refused attempts from your address within a minute, it can also answer 503 with Retry-After instead of judging the token: send the same token again after that many seconds and it is answered on its merits, 101 if it is good and 401 if not. A 401 is never about load.
Requires the member role or higher.
Request
- Base URL: https://app.mandala.computer/api/v1
- URL: https://app.mandala.computer/api/v1/computers/{id}/browser-connections
- Auth: HTTP bearer
Path parameters
The computer id.
Request body
Response
A browser connection and its expiry.
Changes
No recorded changes to this operation across all 1 revision of this API.