API

BrowserSessionConnection

Operations

Every route this entity exposes. Each route links to its own reference on this page.

Method Route SDK operation Returns
POST /api/v1/organizations/{organization_id}/browser_sessions/{browser_session_id}/connections create Success

Examples

One example per SDK, generated from the API model. The argument names are the parameters and fields of this entity, and the values are placeholders. The examples are not compiled or executed.

Golang

Construct client as shown in the Golang setup, then call the operations:

created, err := client.BrowserSessionConnection(nil).Create(map[string]any{"browser_session_id": "example", "organization_id": "example", "generation": 1}, nil)
if err != nil {
    panic(err)
}
fmt.Println(created)

Lua

Construct client as shown in the Lua setup, then call the operations:

local created, err = client:BrowserSessionConnection():create({ browser_session_id = "example", organization_id = "example", generation = 1 })

PHP

Construct client as shown in the PHP setup, then call the operations:

$created = $client->BrowserSessionConnection()->create(["browser_session_id" => "example", "organization_id" => "example", "generation" => 1]);

Python

Construct client as shown in the Python setup, then call the operations:

created = client.BrowserSessionConnection().create({ "browser_session_id": "example", "organization_id": "example", "generation": 1 })

Ruby

Construct client as shown in the Ruby setup, then call the operations:

created = client.BrowserSessionConnection.create({ "browser_session_id" => "example", "organization_id" => "example", "generation" => 1 })

TypeScript

Construct client as shown in the TypeScript setup, then call the operations:

const created = await client.BrowserSessionConnection().create({ browser_session_id: "example", organization_id: "example", generation: 1 })

Fields

Field Type Required Description
generation integer Yes Generation
idempotency_key string No Idempotency Key

create

POST /api/v1/organizations/{organization_id}/browser_sessions/{browser_session_id}/connections

Operation ID: api_v1_connections.

Authentication: bearer token (bearerAuth).

Parameters

Parameter In Type Required Description
organization_id path string Yes
browser_session_id path string Yes
Idempotency-Key header string No

Request body

application/json

Property Type Required Description
generation integer Yes
idempotency_key string No

Responses

200: Success

application/json

The response is object.

202: External connection handoff accepted or replayed

application/json

Property Type Required Description
browser_session_id string Yes
completed_at string (date-time) No
completed_generation integer No
connection object No
connection.cdp_url string No
connection.expires_at string (date-time) No
connection.generation integer No
failure_code string No
id string Yes
requested_controller enum: idle, agent, external Yes
requested_generation integer Yes
status enum: pending, running, completed, failed Yes
401: Unauthorized
403: Forbidden
404: Not found
422: Stale generation or active task prevents connection rotation
502: Bad gateway