Skip to content

Skyvern: Create a session

Skyvern browserSessions.createBrowserSession: arguments, response, policy and SDK examples.

← Browser sessions operations · Get started

Operation skyvern.create_browser_session_v1_browser_sessions_post

Provider route: POST /v1/browser_sessions. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/skyvern with npm, or alter-sdk-skyvern with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { SkyvernIntegration } from "@alter-ai/skyvern";
async function execute(input: Parameters<SkyvernIntegration["browserSessions"]["createBrowserSession"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new SkyvernIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.browserSessions.createBrowserSession(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_skyvern import SkyvernIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = SkyvernIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.browser_sessions.create_browser_session(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
bodyModelOptionalExpand Create a session — request body — body
Default: {“generate_browser_profile”: false, “needs_live_view”: false, “timeout”: 60}

Referenced models: Create a session — request body — body

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$ModelRootExpand Get a session — response body

Referenced models: Get a session — response body

1 more schema is linked from the tables above, on the schema pages.

Create a session — request body — body
FieldTypePresenceDescription and constraints
$objectRoot
browser_profile_idJSONOptionalID of a browser profile to load into this session (restores cookies, localStorage, etc.). browser_profile_id starts with `bp_`.
browser_profile_id (anyOf 1)stringAlternativePattern: ^bp_
browser_profile_id (anyOf 2)nullAlternative
browser_settingsJSONOptionalSettings applied when the session's browser is created. A timezone_id here takes precedence over the timezone implied by proxy_location.
browser_settings (anyOf 1)ModelAlternativeExpand Get a session — response body — browser settings timezone id
browser_settings (anyOf 2)nullAlternative
browser_typeJSONOptionalThe type of browser to use for the session.
browser_type (anyOf 1)stringAlternativeOne of: msedge, chrome, stealth-chromium
browser_type (anyOf 2)nullAlternative
extensionsJSONOptionalA list of extensions to install in the browser session.
extensions (anyOf 1)arrayAlternative
extensions (anyOf 1)[]stringEach itemOne of: ad-blocker, captcha-solver
extensions (anyOf 2)nullAlternative
generate_browser_profilebooleanOptionalWhen 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.
Default: false
needs_live_viewbooleanOptionalWhether a person will watch this session's browser live. Defaults to false, which suits unattended automation; the Skyvern app sets it because a session opened in the UI is watched. It requests a capability, not a particular browser, and cannot be used to select where the session runs.
Default: false
proxy_locationJSONOptional
Geographic Proxy location to route the browser traffic through. This is only available in Skyvern Cloud.

Available geotargeting options:
- RESIDENTIAL: the default value. Skyvern Cloud uses a random US residential proxy.
- RESIDENTIAL_ES: Spain
- RESIDENTIAL_IE: Ireland
- RESIDENTIAL_GB: United Kingdom
- RESIDENTIAL_IN: India
- RESIDENTIAL_JP: Japan
- RESIDENTIAL_FR: France
- RESIDENTIAL_DE: Germany
- RESIDENTIAL_NZ: New Zealand
- RESIDENTIAL_PH: Philippines
- RESIDENTIAL_KR: South Korea
- RESIDENTIAL_SA: Saudi Arabia
- RESIDENTIAL_ZA: South Africa
- RESIDENTIAL_AR: Argentina
- RESIDENTIAL_AU: Australia
- RESIDENTIAL_BR: Brazil
- RESIDENTIAL_TR: Turkey
- RESIDENTIAL_CA: Canada
- RESIDENTIAL_MX: Mexico
- RESIDENTIAL_IT: Italy
- RESIDENTIAL_NL: Netherlands
- RESIDENTIAL_ISP: ISP proxy
- US-CA: California (deprecated, routes through RESIDENTIAL_ISP)
- US-NY: New York (deprecated, routes through RESIDENTIAL_ISP)
- US-TX: Texas (deprecated, routes through RESIDENTIAL_ISP)
- US-FL: Florida (deprecated, routes through RESIDENTIAL_ISP)
- US-WA: Washington (deprecated, routes through RESIDENTIAL_ISP)
- NONE: No proxy

For self-hosted deployments, you can pass a custom proxy URL as a dict: {"url": "http://user:password@proxy.example:8080"}. This routes the browser through your own proxy server and takes precedence over any globally configured proxy pool.
Can also be a GeoTarget object for granular city/state targeting: {"country": "US", "subdivision": "CA", "city": "San Francisco"}, or a custom proxy URL dict for self-hosted deployments: {"url": "http://user:password@proxy.example:8080"}
proxy_location (anyOf 1)stringAlternativeOne of: RESIDENTIAL, US-CA, US-NY, US-TX, US-FL, US-WA, RESIDENTIAL_ES, RESIDENTIAL_IE, RESIDENTIAL_GB, RESIDENTIAL_IN, RESIDENTIAL_JP, RESIDENTIAL_FR, RESIDENTIAL_DE, RESIDENTIAL_NZ, RESIDENTIAL_ZA, RESIDENTIAL_AR, RESIDENTIAL_AU, RESIDENTIAL_BR, RESIDENTIAL_TR, RESIDENTIAL_CA, RESIDENTIAL_MX, RESIDENTIAL_IT, RESIDENTIAL_NL, RESIDENTIAL_PH, RESIDENTIAL_KR, RESIDENTIAL_SA, RESIDENTIAL_ISP, NONE
proxy_location (anyOf 2)ModelAlternativeExpand Update an agent — response body — proxy location city, country, is ISP, subdivision
proxy_location (anyOf 3)objectAlternativeAdditional keys: allowed
proxy_location (anyOf 4)nullAlternative
proxy_session_idJSONOptionalOpaque Skyvern-managed proxy sticky-session id for pinned Residential ISP sessions.
proxy_session_id (anyOf 1)stringAlternative
proxy_session_id (anyOf 2)nullAlternative
timeoutJSONOptionalTimeout in minutes for the session. Timeout is applied after the session is started. Must be between 5 and 240. Defaults to 60.
Default: 60
timeout (anyOf 1)integerAlternativeMinimum: 5.0
timeout (anyOf 2)nullAlternative
urlJSONOptionalOptional URL to open when the standalone browser session starts.
url (anyOf 1)stringAlternative
url (anyOf 2)nullAlternative

Referenced models: Get a session — response body — browser settings timezone id, Update an agent — response body — proxy location city, country, is ISP, subdivision

Get a session — response body — browser settings timezone id
FieldTypePresenceDescription and constraints
$objectRoot
timezone_idJSONOptionalIANA timezone the browser reports to pages, for example `America/New_York`. Applied when a browser is created and takes precedence over any timezone implied by the proxy location. Offsets such as `+03:00` are rejected. Omit or set to null to keep the default behavior.
timezone_id (anyOf 1)stringAlternative
timezone_id (anyOf 2)nullAlternative
Update an agent — response body — proxy location city, country, is ISP, subdivision
FieldTypePresenceDescription and constraints
$objectRootGranular proxy geo-targeting request with country, optional subdivision, and optional city.
cityJSONOptionalCity name in English from GeoNames (e.g., 'New York', 'Los Angeles', 'London')
city (anyOf 1)stringAlternativeMaximum length: 100
city (anyOf 2)nullAlternative
countrystringRequired within parentISO 3166-1 alpha-2 country code (e.g., 'US', 'GB', 'DE')
Maximum length: 2
Minimum length: 2
isISPbooleanOptionalWhether this geo target is marked as an ISP proxy location.
Default: false
subdivisionJSONOptionalISO 3166-2 subdivision code without country prefix (e.g., 'CA' for California, 'NY' for New York)
subdivision (anyOf 1)stringAlternativeMaximum length: 10
subdivision (anyOf 2)nullAlternative
Login Task — response body — browser_settings_receipt / source: workflow version, session request, existing session, status: verified, mismatch, unapplied, unknown
FieldTypePresenceDescription and constraints
$objectRoot
actual_timezone_idJSONOptionalThe timezone the browser reported when measured, or null when it could not be measured.
actual_timezone_id (anyOf 1)stringAlternative
actual_timezone_id (anyOf 2)nullAlternative
requested_timezone_idstringRequired within parentThe timezone that was requested.
sourcestringRequired within parentWhere the requested setting came from.
Known values: workflow_version, session_request, existing_session
statusstringRequired within parent`verified` when the browser reported the requested timezone or an IANA alias of it (Chromium reports `Asia/Calcutta` for `Asia/Kolkata`), `mismatch` when it reported another zone, `unapplied` when the browser already existed and was left unchanged, `unknown` when it could not be measured.
Known values: verified, mismatch, unapplied, unknown
warningJSONOptional
warning (anyOf 1)stringAlternative
warning (anyOf 2)nullAlternative
Get a session — response body — recordings array item
FieldTypePresenceDescription and constraints
$objectRootInformation about a downloaded file, including URL and checksum.
artifact_idJSONOptionalArtifact row id for refresh-on-read
artifact_id (anyOf 1)stringAlternative
artifact_id (anyOf 2)nullAlternative
checksumJSONOptionalSHA-256 checksum of the file
checksum (anyOf 1)stringAlternative
checksum (anyOf 2)nullAlternative
file_sizeJSONOptionalSize of the file in bytes
file_size (anyOf 1)JSONAlternative
file_size (anyOf 1) (anyOf 1)integerAlternative
file_size (anyOf 1) (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
file_size (anyOf 2)nullAlternative
filenameJSONOptionalOriginal filename
filename (anyOf 1)stringAlternative
filename (anyOf 2)nullAlternative
modified_atJSONOptionalModified time of the file
modified_at (anyOf 1)stringAlternativeFormat: date-time
modified_at (anyOf 2)nullAlternative
urlstringRequired within parentURL to access the file

SDK function policy ID: skyvern.create_browser_session_v1_browser_sessions_post. Catalog operation: create_browser_session_v1_browser_sessions_post. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.