Skip to main content
A browser session is a cloud browser that stays open between runs, so tasks and agents can share cookies and page state. Pass its browser_session_id (pbs_…) to run_task or run_workflow. Every method here also accepts request_options (Python) or a final requestOptions argument (TypeScript) to override the timeout, retries or headers for one call; see request options.

create_browser_session

Create a browser session that persists across multiple runs
Parameters
str | None
Optional URL to open when the standalone browser session starts.Sent only when you pass it
int | None
Timeout in minutes for the session. Timeout is applied after the session is started. Must be between 5 and 240. Defaults to 60.Sent only when you pass it
CreateBrowserSessionRequestProxyLocation | None
Geographic Proxy location to route the browser traffic through. This is only available in Skyvern Cloud.Sent only when you pass it
str | None
Opaque Skyvern-managed proxy sticky-session id for pinned Residential ISP sessions.Sent only when you pass it
Sequence[Extensions] | None
A list of extensions to install in the browser session.Sent only when you pass it
PersistentBrowserType | None
The type of browser to use for the session.Sent only when you pass it
str | None
ID of a browser profile to load into this session (restores cookies, localStorage, etc.). browser_profile_id starts with bp_.Sent only when you pass it
bool | None
When true, the session’s browser profile (cookies, localStorage, etc.) is saved to storage when the session ends so it can be turned into a reusable browser profile. Defaults to false to avoid storing profiles for sessions that never need them. Sessions started with a browser_profile_id always persist their profile regardless of this flag.Sent only when you pass it
Returns BrowserSessionResponse · TypeScript Promise<BrowserSessionResponse>
Example

get_browser_session

Get details about a specific browser session, including the browser address for cdp connection.
Parameters
str
required
The ID of the browser session. browser_session_id starts with pbs_TypeScript: browserSessionId
Returns BrowserSessionResponse · TypeScript Promise<BrowserSessionResponse>
Example

get_browser_sessions

Get all active browser sessions for the organization
Returns list[BrowserSessionResponse] · TypeScript Promise<BrowserSessionResponse[]>
Example

update_browser_session

Update a live browser session. Currently supports toggling generate_browser_profile, which is read when the session ends to decide whether to save its browser profile.
Parameters
str
required
The ID of the browser session. browser_session_id starts with pbs_TypeScript: browserSessionId
bool
required
Enable or disable saving this session’s browser profile when it ends. Can be toggled while the session is still alive; the value is read at session teardown.
Returns BrowserSessionResponse · TypeScript Promise<BrowserSessionResponse>
Example

extend_browser_session

Extend a live browser session by a number of minutes. Sessions are created with a timeout of at most 240 minutes and can be extended, one or more times, up to a total lifetime of 360 minutes (6 hours). The minutes are added to the session’s current deadline. A request for more than the remaining headroom is granted the remainder, and the response carries a warning. The response’s timeout is the session’s new total budget in minutes, counted from when the session started.
Parameters
str
required
The ID of the browser session. browser_session_id starts with pbs_TypeScript: browserSessionId
int
required
Minutes to add to the session’s current deadline. A session can be extended, one or more times, up to a total lifetime of 360 minutes (6 hours) counted from when it started; a request for more than the remaining headroom is granted the remainder and the response carries a warning.
Returns BrowserSessionResponse · TypeScript Promise<BrowserSessionResponse>
Example

close_browser_session

Close a session. Once closed, the session cannot be used again.
Parameters
str
required
The ID of the browser session to close. completed_at will be set when the browser session is closed. browser_session_id starts with pbs_TypeScript: browserSessionId
Returns Any | None · TypeScript Promise<unknown> Example