POST
/
v1
/
sessions
cURL
curl --request POST \
  --url https://api.browserbase.com/v1/sessions \
  --header 'Content-Type: application/json' \
  --header 'X-BB-API-Key: <api-key>' \
  --data '{"projectId": "<project-id>"}'
{
  "id": "<string>",
  "createdAt": "2023-11-07T05:31:56Z",
  "updatedAt": "2023-11-07T05:31:56Z",
  "projectId": "<string>",
  "startedAt": "2023-11-07T05:31:56Z",
  "endedAt": "2023-11-07T05:31:56Z",
  "expiresAt": "2023-11-07T05:31:56Z",
  "status": "RUNNING",
  "proxyBytes": 123,
  "avgCpuUsage": 123,
  "memoryUsage": 123,
  "keepAlive": true,
  "contextId": "<string>",
  "region": "us-west-2",
  "userMetadata": {},
  "connectUrl": "<string>",
  "seleniumRemoteUrl": "<string>",
  "signingKey": "<string>"
}

Authorizations

X-BB-API-Key
string
header
required

Body

application/json
projectId
string
required

The Project ID. Can be found in Settings.

extensionId
string

The uploaded Extension ID. See Upload Extension.

browserSettings
object
timeout
integer

Duration in seconds after which the session will automatically end. Defaults to the Project's defaultTimeout.

Required range: 60 <= x <= 21600
keepAlive
boolean

Set to true to keep the session alive even after disconnections. Available on the Hobby Plan and above.

proxies

Proxy configuration. Can be true for default proxy, or an array of proxy configurations.

region
enum<string>
default:us-west-2

The region where the Session should run.

Available options:
us-west-2,
us-east-1,
eu-central-1,
ap-southeast-1
userMetadata
object

Arbitrary user metadata to attach to the session. To learn more about user metadata, see User Metadata.

Response

201 - application/json

The request has succeeded and a new resource has been created as a result.

id
string
required
createdAt
string<date-time>
required
updatedAt
string<date-time>
required
projectId
string
required

The Project ID linked to the Session.

startedAt
string<date-time>
required
expiresAt
string<date-time>
required
status
enum<string>
required
Available options:
RUNNING,
ERROR,
TIMED_OUT,
COMPLETED
proxyBytes
integer
required

Bytes used via the Proxy

keepAlive
boolean
required

Indicates if the Session was created to be kept alive upon disconnections

region
enum<string>
required

The region where the Session is running.

Available options:
us-west-2,
us-east-1,
eu-central-1,
ap-southeast-1
connectUrl
string<uri>
required

WebSocket URL to connect to the Session.

seleniumRemoteUrl
string<uri>
required

HTTP URL to connect to the Session.

signingKey
string
required

Signing key to use when connecting to the Session via HTTP.

endedAt
string<date-time>
avgCpuUsage
integer

CPU used by the Session

memoryUsage
integer

Memory used by the Session

contextId
string

Optional. The Context linked to the Session.

userMetadata
object

Arbitrary user metadata to attach to the session. To learn more about user metadata, see User Metadata.