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.
Call through Alter
Section titled “Call through Alter”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 osfrom alter_sdk import Appfrom 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()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
body | Model | Optional | Expand 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
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | Model | Root | Expand Get a session — response body |
Referenced models: Get a session — response body
Schemas
Section titled “Schemas”1 more schema is linked from the tables above, on the schema pages.
Create a session — request body — body
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
browser_profile_id | JSON | Optional | ID of a browser profile to load into this session (restores cookies, localStorage, etc.). browser_profile_id starts with `bp_`. |
browser_profile_id (anyOf 1) | string | Alternative | Pattern: ^bp_ |
browser_profile_id (anyOf 2) | null | Alternative | |
browser_settings | JSON | Optional | Settings 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) | Model | Alternative | Expand Get a session — response body — browser settings timezone id |
browser_settings (anyOf 2) | null | Alternative | |
browser_type | JSON | Optional | The type of browser to use for the session. |
browser_type (anyOf 1) | string | Alternative | One of: msedge, chrome, stealth-chromium |
browser_type (anyOf 2) | null | Alternative | |
extensions | JSON | Optional | A list of extensions to install in the browser session. |
extensions (anyOf 1) | array | Alternative | |
extensions (anyOf 1)[] | string | Each item | One of: ad-blocker, captcha-solver |
extensions (anyOf 2) | null | Alternative | |
generate_browser_profile | boolean | Optional | 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. Default: false |
needs_live_view | boolean | Optional | Whether 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_location | JSON | Optional | 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) | string | Alternative | One 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) | Model | Alternative | Expand Update an agent — response body — proxy location city, country, is ISP, subdivision |
proxy_location (anyOf 3) | object | Alternative | Additional keys: allowed |
proxy_location (anyOf 4) | null | Alternative | |
proxy_session_id | JSON | Optional | Opaque Skyvern-managed proxy sticky-session id for pinned Residential ISP sessions. |
proxy_session_id (anyOf 1) | string | Alternative | |
proxy_session_id (anyOf 2) | null | Alternative | |
timeout | JSON | Optional | Timeout 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) | integer | Alternative | Minimum: 5.0 |
timeout (anyOf 2) | null | Alternative | |
url | JSON | Optional | Optional URL to open when the standalone browser session starts. |
url (anyOf 1) | string | Alternative | |
url (anyOf 2) | null | Alternative |
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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
timezone_id | JSON | Optional | IANA 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) | string | Alternative | |
timezone_id (anyOf 2) | null | Alternative |
Update an agent — response body — proxy location city, country, is ISP, subdivision
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Granular proxy geo-targeting request with country, optional subdivision, and optional city. |
city | JSON | Optional | City name in English from GeoNames (e.g., 'New York', 'Los Angeles', 'London') |
city (anyOf 1) | string | Alternative | Maximum length: 100 |
city (anyOf 2) | null | Alternative | |
country | string | Required within parent | ISO 3166-1 alpha-2 country code (e.g., 'US', 'GB', 'DE') Maximum length: 2 Minimum length: 2 |
isISP | boolean | Optional | Whether this geo target is marked as an ISP proxy location. Default: false |
subdivision | JSON | Optional | ISO 3166-2 subdivision code without country prefix (e.g., 'CA' for California, 'NY' for New York) |
subdivision (anyOf 1) | string | Alternative | Maximum length: 10 |
subdivision (anyOf 2) | null | Alternative |
Login Task — response body — browser_settings_receipt / source: workflow version, session request, existing session, status: verified, mismatch, unapplied, unknown
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | |
actual_timezone_id | JSON | Optional | The timezone the browser reported when measured, or null when it could not be measured. |
actual_timezone_id (anyOf 1) | string | Alternative | |
actual_timezone_id (anyOf 2) | null | Alternative | |
requested_timezone_id | string | Required within parent | The timezone that was requested. |
source | string | Required within parent | Where the requested setting came from. Known values: workflow_version, session_request, existing_session |
status | string | Required 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 |
warning | JSON | Optional | |
warning (anyOf 1) | string | Alternative | |
warning (anyOf 2) | null | Alternative |
Get a session — response body — recordings array item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Information about a downloaded file, including URL and checksum. |
artifact_id | JSON | Optional | Artifact row id for refresh-on-read |
artifact_id (anyOf 1) | string | Alternative | |
artifact_id (anyOf 2) | null | Alternative | |
checksum | JSON | Optional | SHA-256 checksum of the file |
checksum (anyOf 1) | string | Alternative | |
checksum (anyOf 2) | null | Alternative | |
file_size | JSON | Optional | Size of the file in bytes |
file_size (anyOf 1) | JSON | Alternative | |
file_size (anyOf 1) (anyOf 1) | integer | Alternative | |
file_size (anyOf 1) (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
file_size (anyOf 2) | null | Alternative | |
filename | JSON | Optional | Original filename |
filename (anyOf 1) | string | Alternative | |
filename (anyOf 2) | null | Alternative | |
modified_at | JSON | Optional | Modified time of the file |
modified_at (anyOf 1) | string | Alternative | Format: date-time |
modified_at (anyOf 2) | null | Alternative | |
url | string | Required within parent | URL to access the file |
Policy, approvals and errors
Section titled “Policy, approvals and errors”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.