BrowserSessionTask
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}/tasks/{id}/cancel |
create |
Success |
POST |
/api/v1/organizations/{organization_id}/browser_sessions/{browser_session_id}/tasks |
create |
Success |
GET |
/api/v1/organizations/{organization_id}/browser_sessions/{browser_session_id}/tasks/{id} |
load |
Browser task state |
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_task, err := client.BrowserSessionTask(nil).Load(map[string]any{"browser_session_id": "example", "id": "example_id", "organization_id": "example"}, nil)
if err != nil {
panic(err)
}
fmt.Println(browser_session_task)
created, err := client.BrowserSessionTask(nil).Create(map[string]any{"browser_session_id": "example", "organization_id": "example", "instruction": "example"}, nil)
if err != nil {
panic(err)
}
fmt.Println(created)
Lua
Construct client as shown in the Lua setup, then call the operations:
local browser_session_task, err = client:BrowserSessionTask():load({ browser_session_id = "example", id = "example_id", organization_id = "example" })
local created, err = client:BrowserSessionTask():create({ browser_session_id = "example", organization_id = "example", instruction = "example" })
PHP
Construct client as shown in the PHP setup, then call the operations:
$browser_session_task = $client->BrowserSessionTask()->load(["browser_session_id" => "example", "id" => "example_id", "organization_id" => "example"]);
$created = $client->BrowserSessionTask()->create(["browser_session_id" => "example", "organization_id" => "example", "instruction" => "example"]);
Python
Construct client as shown in the Python setup, then call the operations:
browser_session_task = client.BrowserSessionTask().load({"browser_session_id": "example", "id": "example_id", "organization_id": "example"})
created = client.BrowserSessionTask().create({ "browser_session_id": "example", "organization_id": "example", "instruction": "example" })
Ruby
Construct client as shown in the Ruby setup, then call the operations:
browser_session_task = client.BrowserSessionTask.load({ "browser_session_id" => "example", "id" => "example_id", "organization_id" => "example" })
created = client.BrowserSessionTask.create({ "browser_session_id" => "example", "organization_id" => "example", "instruction" => "example" })
TypeScript
Construct client as shown in the TypeScript setup, then call the operations:
const browser_session_task = await client.BrowserSessionTask().load({ browser_session_id: "example", id: "example_id", organization_id: "example" })
const created = await client.BrowserSessionTask().create({ browser_session_id: "example", organization_id: "example", instruction: "example" })
Fields
| Field | Type | Required | Description |
|---|---|---|---|
activity |
one,object,null |
No | Activity |
browser_session_id |
string |
Yes | Browser Session Id |
cancel_requested_at |
one,string,null |
No | Cancel Requested At |
completed_at |
one,string,null |
No | Completed At |
control_generation |
one,integer,null |
No | Control Generation |
deadline_at |
string |
Yes | Deadline At |
effects_unknown |
boolean |
Yes | Effects Unknown |
failure_code |
one,string,null |
No | Failure Code |
id |
string |
Yes | Id |
idempotency_key |
string |
No | Idempotency Key |
instruction |
string |
Yes | Instruction |
max_rounds |
integer |
Yes | Max Rounds |
max_seconds |
integer |
No | Max Seconds |
model_selection |
object |
Yes | Model Selection |
outcome |
one,string,null |
No | Outcome |
result |
object |
Yes | Result |
started_at |
one,string,null |
No | Started At |
status |
string |
Yes | Status |
create
POST /api/v1/organizations/{organization_id}/browser_sessions/{browser_session_id}/tasks/{id}/cancel
Operation ID: post_api_v1_organizations_organization_id_browser_sessions_browser_session_id_tasks_id_cancel.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
browser_session_id |
path |
string |
Yes | |
id |
path |
string |
Yes |
Request body
application/json
The request body is object.
Responses
200: Success
application/json
The response is object.
202: Task cancellation requested or already terminal
application/json
| Property | Type | Required | Description |
|---|---|---|---|
activity |
object |
No | |
browser_session_id |
string |
Yes | |
cancel_requested_at |
string (date-time) |
No | |
completed_at |
string (date-time) |
No | |
control_generation |
integer |
No | |
deadline_at |
string (date-time) |
Yes | |
effects_unknown |
boolean |
Yes | |
failure_code |
string |
No | |
id |
string |
Yes | |
instruction |
string |
Yes | |
max_rounds |
integer |
Yes | |
model_selection |
object |
Yes | |
outcome |
string |
No | |
result |
object |
Yes | |
started_at |
string (date-time) |
No | |
status |
enum: pending, starting, running, stopping, completed, blocked, ... |
Yes |
401: Unauthorized
403: Forbidden
404: Not found
422: Unprocessable entity
502: Bad gateway
POST /api/v1/organizations/{organization_id}/browser_sessions/{browser_session_id}/tasks
Operation ID: api_v1_tasks.
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 |
|---|---|---|---|
idempotency_key |
string |
No | |
instruction |
string |
Yes | |
max_rounds |
integer |
No | |
max_seconds |
integer |
No | |
outcome |
string |
No |
Responses
200: Success
application/json
The response is object.
202: Instruction accepted or replayed
application/json
| Property | Type | Required | Description |
|---|---|---|---|
activity |
object |
No | |
browser_session_id |
string |
Yes | |
cancel_requested_at |
string (date-time) |
No | |
completed_at |
string (date-time) |
No | |
control_generation |
integer |
No | |
deadline_at |
string (date-time) |
Yes | |
effects_unknown |
boolean |
Yes | |
failure_code |
string |
No | |
id |
string |
Yes | |
instruction |
string |
Yes | |
max_rounds |
integer |
Yes | |
model_selection |
object |
Yes | |
outcome |
string |
No | |
result |
object |
Yes | |
started_at |
string (date-time) |
No | |
status |
enum: pending, starting, running, stopping, completed, blocked, ... |
Yes |
401: Unauthorized
403: Forbidden
404: Not found
409: The idempotency key belongs to a changed instruction or current task/control work prevents admission
422: Invalid instruction or unavailable browser authority
502: Bad gateway
load
GET /api/v1/organizations/{organization_id}/browser_sessions/{browser_session_id}/tasks/{id}
Operation ID: get_api_v1_organizations_organization_id_browser_sessions_browser_session_id_tasks_id_.
Authentication: bearer token (bearerAuth).
Parameters
| Parameter | In | Type | Required | Description |
|---|---|---|---|---|
organization_id |
path |
string |
Yes | |
browser_session_id |
path |
string |
Yes | |
id |
path |
string |
Yes |
Responses
200: Browser task state
application/json
| Property | Type | Required | Description |
|---|---|---|---|
activity |
object |
No | |
browser_session_id |
string |
Yes | |
cancel_requested_at |
string (date-time) |
No | |
completed_at |
string (date-time) |
No | |
control_generation |
integer |
No | |
deadline_at |
string (date-time) |
Yes | |
effects_unknown |
boolean |
Yes | |
failure_code |
string |
No | |
id |
string |
Yes | |
instruction |
string |
Yes | |
max_rounds |
integer |
Yes | |
model_selection |
object |
Yes | |
outcome |
string |
No | |
result |
object |
Yes | |
started_at |
string (date-time) |
No | |
status |
enum: pending, starting, running, stopping, completed, blocked, ... |
Yes |