BrowserSession
A browser runner: open one, hand control between your client and the agent, read its media, or close it.
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}/control |
create |
Success |
POST |
/api/v1/organizations/{organization_id}/browser_sessions |
create |
Success |
GET |
/api/v1/organizations/{organization_id}/browser_sessions/{id} |
load |
Admin-only browser state; connection capabilities expire with control or session closure |
GET |
/api/v1/organizations/{organization_id}/browser_sessions/{browser_session_id}/media |
load |
Up to 256 captures belonging to this browser session |
DELETE |
/api/v1/organizations/{organization_id}/browser_sessions/{id} |
remove |
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:
browser_session, err := client.BrowserSession(nil).Load(map[string]any{"id": "example_id", "organization_id": "example"}, nil)
if err != nil {
panic(err)
}
fmt.Println(browser_session)
created, err := client.BrowserSession(nil).Create(map[string]any{"organization_id": "example"}, nil)
if err != nil {
panic(err)
}
fmt.Println(created)
removed, err := client.BrowserSession(nil).Remove(map[string]any{"id": "example_id", "organization_id": "example"}, nil)
if err != nil {
panic(err)
}
fmt.Println(removed)
Lua
Construct client as shown in the Lua setup, then call the operations:
local browser_session, err = client:BrowserSession():load({ id = "example_id", organization_id = "example" })
local created, err = client:BrowserSession():create({ organization_id = "example" })
local removed, err = client:BrowserSession():remove({ id = "example_id", organization_id = "example" })
PHP
Construct client as shown in the PHP setup, then call the operations:
$browser_session = $client->BrowserSession()->load(["id" => "example_id", "organization_id" => "example"]);
$created = $client->BrowserSession()->create(["organization_id" => "example"]);
$client->BrowserSession()->remove(["id" => "example_id", "organization_id" => "example"]);
Python
Construct client as shown in the Python setup, then call the operations:
browser_session = client.BrowserSession().load({"id": "example_id", "organization_id": "example"})
created = client.BrowserSession().create({ "organization_id": "example" })
client.BrowserSession().remove({"id": "example_id", "organization_id": "example"})
Ruby
Construct client as shown in the Ruby setup, then call the operations:
browser_session = client.BrowserSession.load({ "id" => "example_id", "organization_id" => "example" })
created = client.BrowserSession.create({ "organization_id" => "example" })
client.BrowserSession.remove({ "id" => "example_id", "organization_id" => "example" })
TypeScript
Construct client as shown in the TypeScript setup, then call the operations:
const browser_session = await client.BrowserSession().load({ id: "example_id", organization_id: "example" })
const created = await client.BrowserSession().create({ organization_id: "example" })
await client.BrowserSession().remove({ id: "example_id", organization_id: "example" })
Fields
| Field | Type | Required | Description |
|---|---|---|---|
active_task_id |
one,string,null |
No | Active Task Id |
authentication_status |
string |
Yes | Session readiness alone does not confirm application sign-in. |
authentication_task_id |
one,string,null |
No | Automatic sign-in task; read its status and result separately from browser readiness. |
cdp_url |
one,string,null |
No | Admin-only full browser CDP bearer capability for the current external control generation. |
closed_at |
one,string,null |
No | Closed At |
closure_basis |
one,string,null |
No | Provider deletion is a conservative closure bound when the worker cannot report its stop time. |
control_generation |
integer |
Yes | Control Generation |
controller |
string |
Yes | Controller |
credential_id |
one,string,null |
No | Optional configured credential public ID within the selected project. |
environment_id |
string |
No | Optional ready website environment slug or public ID within the selected project. |
environment_revision_id |
one,string,null |
No | Environment Revision Id |
expires_at |
string |
Yes | Expires At |
failure_code |
one,string,null |
No | Failure Code |
id |
string |
Yes | Id |
idempotency_key |
string |
No | Idempotency Key |
initial_url |
string |
Yes | Initial Url |
max_seconds |
integer |
No | Max Seconds |
pending_control_id |
one,string,null |
No | Pending Control Id |
project_id |
one,string,null |
No | Optional project slug or public ID. |
reconciled_at |
one,string,null |
No | Reconciled At |
started_at |
one,string,null |
No | Started At |
status |
string |
Yes | Status |
url |
string |
No | Initial HTTP or HTTPS URL; defaults to the selected environment or project URL, otherwise a blank page. |
viewer |
one,object,null |
No | Viewer |
create
POST /api/v1/organizations/{organization_id}/browser_sessions/{browser_session_id}/control
Operation ID: api_v1_control.
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 |
|---|---|---|---|
controller |
enum: idle, agent, external |
Yes | |
generation |
integer |
Yes | |
idempotency_key |
string |
No |
Responses
200: Success
application/json
The response is object.
202: Control 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
409: The idempotency key belongs to a changed handoff
422: Stale generation or active work prevents handoff
502: Bad gateway
POST /api/v1/organizations/{organization_id}/browser_sessions
Operation ID: api_v1_browser_runner_sessions.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
Idempotency-Key |
header |
string |
No |
Request body
application/json
| Property | Type | Required | Description |
|---|---|---|---|
controller |
enum: idle, agent, external |
No | |
credential_id |
string |
No | Optional configured credential public ID within the selected project. |
environment_id |
string |
No | Optional ready website environment slug or public ID within the selected project. |
idempotency_key |
string |
No | |
max_seconds |
integer |
No | |
project_id |
string |
No | Optional project slug or public ID. |
url |
string |
No | Initial HTTP or HTTPS URL; defaults to the selected environment or project URL, otherwise a blank page. |
Responses
200: Success
application/json
The response is object.
202: Admitted or previously created browser session
application/json
| Property | Type | Required | Description |
|---|---|---|---|
active_task_id |
string |
No | |
authentication_status |
enum: not_required, pending, ready, blocked |
Yes | Session readiness alone does not confirm application sign-in. |
authentication_task_id |
string |
No | Automatic sign-in task; read its status and result separately from browser readiness. |
cdp_url |
string |
No | Admin-only full browser CDP bearer capability for the current external control generation. |
closed_at |
string (date-time) |
No | |
closure_basis |
enum: worker_clock, provider_deletion |
No | Provider deletion is a conservative closure bound when the worker cannot report its stop time. |
control_generation |
integer |
Yes | |
controller |
enum: idle, agent, external, transitioning, blocked, closed |
Yes | |
credential_id |
string |
No | |
environment_revision_id |
string |
No | |
expires_at |
string (date-time) |
Yes | |
failure_code |
string |
No | |
id |
string |
Yes | |
initial_url |
string |
Yes | |
pending_control_id |
string |
No | |
project_id |
string |
No | |
reconciled_at |
string (date-time) |
No | |
started_at |
string (date-time) |
No | |
status |
enum: pending, provisioning, ready, closing, closed, expired, ... |
Yes | |
viewer |
object |
No | |
viewer.token |
string |
No | |
viewer.url |
string |
No |
401: Unauthorized
403: Forbidden
404: Not found
409: The idempotency key belongs to a different request
422: Invalid context, unavailable credential, exhausted capacity or funding, or paused admission
502: Bad gateway
load
GET /api/v1/organizations/{organization_id}/browser_sessions/{id}
Operation ID: api_v1_browser_runner_session.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes |
Responses
200: Admin-only browser state; connection capabilities expire with control or session closure
application/json
| Property | Type | Required | Description |
|---|---|---|---|
active_task_id |
string |
No | |
authentication_status |
enum: not_required, pending, ready, blocked |
Yes | Session readiness alone does not confirm application sign-in. |
authentication_task_id |
string |
No | Automatic sign-in task; read its status and result separately from browser readiness. |
cdp_url |
string |
No | Admin-only full browser CDP bearer capability for the current external control generation. |
closed_at |
string (date-time) |
No | |
closure_basis |
enum: worker_clock, provider_deletion |
No | Provider deletion is a conservative closure bound when the worker cannot report its stop time. |
control_generation |
integer |
Yes | |
controller |
enum: idle, agent, external, transitioning, blocked, closed |
Yes | |
credential_id |
string |
No | |
environment_revision_id |
string |
No | |
expires_at |
string (date-time) |
Yes | |
failure_code |
string |
No | |
id |
string |
Yes | |
initial_url |
string |
Yes | |
pending_control_id |
string |
No | |
project_id |
string |
No | |
reconciled_at |
string (date-time) |
No | |
started_at |
string (date-time) |
No | |
status |
enum: pending, provisioning, ready, closing, closed, expired, ... |
Yes | |
viewer |
object |
No | |
viewer.token |
string |
No | |
viewer.url |
string |
No |
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
GET /api/v1/organizations/{organization_id}/browser_sessions/{browser_session_id}/media
Operation ID: api_v1_media.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
browser_session_id |
path |
string |
Yes |
Responses
200: Up to 256 captures belonging to this browser session
application/json
| Property | Type | Required | Description |
|---|---|---|---|
[].browser_session_id |
string |
Yes | |
[].capture_omissions |
object |
No | |
[].captured_at |
string (date-time) |
No | |
[].ended_at |
string (date-time) |
No | |
[].failure_code |
string |
No | |
[].files |
array of object |
Yes | |
[].files[].byte_size |
integer |
Yes | |
[].files[].captured_at |
string (date-time) |
Yes | |
[].files[].checksum |
string |
Yes | |
[].files[].content_type |
enum: image/png, video/webm |
Yes | |
[].files[].download_path |
string |
Yes | |
[].files[].id |
string |
Yes | |
[].files[].index |
integer |
Yes | |
[].files[].playback_url |
string |
No | Authorized video capability, limited to five minutes and remaining retention. Refresh by reading this capture again. |
[].files[].readable |
boolean |
Yes | |
[].files[].recording |
object |
No | |
[].files[].recording.duration_ms |
integer |
No | |
[].files[].recording.recording_id |
string |
No | |
[].files[].recording.start_ms |
integer |
No | |
[].files[].retention_expires_at |
string (date-time) |
Yes | |
[].frames |
integer |
No | |
[].id |
string |
Yes | |
[].kind |
enum: screenshot, video |
Yes | |
[].partial |
boolean |
Yes | Retained footage has a capture failure or reported omissions. |
[].retention_expires_at |
string (date-time) |
Yes | |
[].source |
object |
No | Screenshot provenance. Dimensions describe retained PNG pixels. URLs are observations before and after capture; concurrent navigation may change the page during that interval. |
[].source.capture_finished_at |
string (date-time) |
No | |
[].source.capture_started_at |
string (date-time) |
No | |
[].source.height |
integer |
No | |
[].source.tab_id |
string |
No | |
[].source.url |
string |
No | |
[].source.url_before |
string |
No | |
[].source.width |
integer |
No | |
[].status |
enum: pending, starting, capturing, recording, finalizing, ready, ... |
Yes | |
[].stop_requested_at |
string (date-time) |
No |
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
remove
DELETE /api/v1/organizations/{organization_id}/browser_sessions/{id}
Operation ID: delete_api_v1_organizations_organization_id_browser_sessions_id_.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
id |
path |
string |
Yes |
Responses
200: Success
application/json
The response is object.
202: Closure requested or already finished
application/json
| Property | Type | Required | Description |
|---|---|---|---|
active_task_id |
string |
No | |
authentication_status |
enum: not_required, pending, ready, blocked |
Yes | Session readiness alone does not confirm application sign-in. |
authentication_task_id |
string |
No | Automatic sign-in task; read its status and result separately from browser readiness. |
cdp_url |
string |
No | Admin-only full browser CDP bearer capability for the current external control generation. |
closed_at |
string (date-time) |
No | |
closure_basis |
enum: worker_clock, provider_deletion |
No | Provider deletion is a conservative closure bound when the worker cannot report its stop time. |
control_generation |
integer |
Yes | |
controller |
enum: idle, agent, external, transitioning, blocked, closed |
Yes | |
credential_id |
string |
No | |
environment_revision_id |
string |
No | |
expires_at |
string (date-time) |
Yes | |
failure_code |
string |
No | |
id |
string |
Yes | |
initial_url |
string |
Yes | |
pending_control_id |
string |
No | |
project_id |
string |
No | |
reconciled_at |
string (date-time) |
No | |
started_at |
string (date-time) |
No | |
status |
enum: pending, provisioning, ready, closing, closed, expired, ... |
Yes | |
viewer |
object |
No | |
viewer.token |
string |
No | |
viewer.url |
string |
No |