Session Parameters
Parameters used when creating a new session viaPOST /start/start-session.
environmentId
- Type:
string - Required: No
- Default:
null - Description: ID of an environment to attach to the session. When set, the browser loads the environment’s saved cookies, local storage, extensions, and other browser data before starting the task. Files stored in the environment are also available to the session. This maintains consistent browser state (e.g., login sessions) and persistent file access across multiple sessions.
policyId
- Type:
string - Required: No
- Default:
null - Description: ID of an automation policy to enforce during the session. When set, every agent action is evaluated against the policy’s rules before execution. Actions can be allowed, blocked, or paused for human approval depending on the matching rule. Policies cover domain restrictions, keyword filters, action types, URL patterns, and sensitive data detection.
policyId is a top-level session parameter, alongside environmentId and proxy. A session can have a policy, an environment, both, or neither. See Automation Policies for details.proxy
- Type:
object | null - Required: No
- Default:
null - Description: Proxy configuration for the session. Routes all browser traffic through the specified proxy server. The proxy is applied at the device level, ensuring no IP leakage. Adds 2-3 seconds of cold-start latency per session.
WebRun Proxy Fields:
Custom Proxy Fields:
Examples:
The
proxy field is a top-level session parameter, alongside environmentId. It is not nested inside task. The proxy applies to the entire session. All tasks within the session use the same proxy.mode
- Type:
string - Required: No
- Default:
"default" - Description: Session mode. Currently only
"default"is supported.
reachOutMode
- Type:
string, one of"off","guardrail_only","full" - Required: No
- Default:
"guardrail_only" - Description: Controls whether the chat-connected user (Telegram, WhatsApp, Slack, Discord, Teams) on the session’s environment receives proactive messages from this session. The chat user is only contacted when no client is actively watching the session (no polling or WebSocket subscriber). This is a top-level session parameter and applies for the lifetime of the session.
Validation: Invalid values return
400 Bad Request with the error message reachOutMode must be one of: off, guardrail_only, full.
Example:
The mode is locked at session creation. To change the behavior, create a new session. See Routing Guardrails to a Chat User for the full flow.
task
- Type:
object - Required: No
- Description: Configuration for the task to run when the session starts. Contains all task-specific parameters.
All task-specific parameters like
prompt, startingUrl, outputType, and outputSchema are now nested inside the task object.Task Parameters
Parameters used inside thetask object when creating a session, or in the message body when sending a new task via POST /start/send-message.
prompt
- Type:
string - Required: No
- Default:
"" - Description: Task description for the AI agent to execute.
startingUrl
- Type:
string - Required: No
- Default:
null - Description: URL where the browser should navigate before starting the task. Speeds up task execution by starting at the relevant page.
maxDuration
- Type:
number(milliseconds) - Required: No
- Default:
300000(5 minutes) - Maximum:
300000(5 minutes) - Description: Maximum time a task can run before automatic termination.
maxInputTokens
- Type:
number - Required: No
- Default:
100000 - Description: Maximum number of input tokens the AI can process. Limits context size to control costs.
maxOutputTokens
- Type:
number - Required: No
- Default:
100000 - Description: Maximum number of output tokens the AI can generate. Limits response size to control costs.
terminateOnCompletion
- Type:
boolean - Required: No
- Default:
false - Description: Whether to automatically terminate the session after the current task completes. Set to
trueto prevent idle session charges.
outputType
- Type:
string - Required: No
- Default:
"text" - Values:
"text","structured_json","structured_csv" - Description: Specifies the output format.
Examples:
When using
outputType: "structured_json" or "structured_csv", you must also provide an outputSchema to define the expected response structure.outputSchema
- Type:
object(JSON Schema) orarray(column names) - Required: No (required when
outputTypeis"structured_json"or"structured_csv") - Description: Defines the expected response structure. The format depends on the
outputType:- For
structured_json: A JSON Schema object - For
structured_csv: An array of column name strings
- For
string- Text valuesnumber- Numeric values (integers and decimals)boolean- True/false valuesobject- Nested objects with defined propertiesarray- Arrays with defined item structure
secrets
- Type:
array - Required: No
- Default:
[] - Description: Array of secret entries to provide credentials for websites the agent visits. Secrets are matched by domain pattern so the agent uses the right credentials for each site.
Example:
Secrets are never stored in a database or persisted anywhere. They are only attached to the active session and immediately discarded once the session is destroyed. Secrets are never included in task output or webhook payloads.
files
- Type:
string[](array of file ID strings) - Required: No
- Default:
[] - Description: Array of file IDs (returned from
POST /files/upload) to attach to a task. The agent can use these files during browser automation, for example, uploading a document to a website form. This is a task-level parameter. Place it alongsideprompt.
webhook
- Type:
object - Required: No
- Description: Webhook configuration for receiving task completion notifications.
submittedData Options:
"ai_response"- The response from the AI (text, structured_json, or structured_csv), only the results/output from the LLM"full_response"- Full body response that includes the usage info"just_ping"- Just a ping notification, no data payload
Task Parameters
Parameters used when starting a new task viaPOST /start/send-message with actionType: "newTask".
All Task Parameters are available, plus:
actionType
- Type:
string - Required: Yes
- Values:
"newTask","state","interaction","guardrail" - Description: Type of action to perform on the session.
newState
- Type:
string - Required: Yes (for
actionType: "newTask"andactionType: "state") - Values:
- For tasks:
"start" - For state control:
"pause","resume","stop","terminate"
- For tasks:
- Description: State change to apply.
Message Parameters
Parameters used in themessage field of POST /start/send-message.
For State Control (actionType: “state”)
Required Parameters:actionType:"state"newState:"pause" | "resume" | "stop" | "terminate"
For Manual Interaction (actionType: “interaction”)
Required Parameters:actionType:"interaction"action: Object containing interaction details
takeOverControl / releaseControl
CLICK / DOUBLE_CLICK
x(number): Horizontal coordinate (0-1024)y(number): Vertical coordinate (155-600, accounting for browser chrome)
Coordinate System: The browser viewport is 1024×600 pixels. The top 155 pixels are browser chrome (not clickable). Clickable area is 1024×445 pixels starting at Y=155.
TYPE
text(string, required): Text to typehumanLike(boolean, optional): Simulate human typing speed
KEY_PRESS
key(string, required): Key to press
EnterEscapeTabBackspaceArrowUp,ArrowDown,ArrowLeft,ArrowRight
For Guardrail Response (actionType: “guardrail”)
Required Parameters:actionType:"guardrail"prompt: Human-provided informationnewState:"resume"
Response Fields
Fields returned in API responses.Session Response Fields
Returned fromPOST /start/start-session:
Task Response Fields
Returned fromPOST /start/send-message with actionType: "newTask" and POST /start/run-task:
When task completes within 50 seconds:
When task is still running after 50 seconds:
Poll Response Fields
Returned fromGET /task/:sessionId/:taskId:
While running:
When completed:
When guardrail triggered:
When failed:
Usage Object Structure
Theusage object provides token and cost information:
OpenAI-Compatible Parameters
Parameters forPOST /v1/chat/completions.
model
- Type:
string - Required: Yes
- Value:
"webrun-browser-1" - Description: Model to use. Currently only
webrun-browser-1is available.
messages
- Type:
arrayof message objects - Required: Yes
- Description: Array of conversation messages
stream
- Type:
boolean - Required: No
- Default:
false - Description: Enable streaming responses via Server-Sent Events (SSE).
max_tokens
- Type:
number - Required: No
- Default:
2000 - Description: Maximum number of tokens in the response.
temperature
- Type:
number - Required: No
- Description: Not used (included for OpenAI compatibility only). Task execution is deterministic.
Type Definitions
ActionType
StateType
InteractionType
OutputType
OutputSchema
Forstructured_json, use a JSON Schema object:
structured_csv, use an array of column names:
WebhookConfig
SecretEntry
###TaskConfig