Skip to main content

Create Browser Session

POST /v1/browser/sessions/

Create a new browser session

Authentication

Requires authentication via: OAuth2PasswordBearer.

Parameters

NameInTypeRequiredDescriptionConstraints
X-API-Keyheaderstring | nullNonullable

Request Body

Required: Yes

application/json

Resolved schema:

{
"properties": {
"viewport_width": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Viewport Width",
"default": 1920
},
"viewport_height": {
"anyOf": [
{
"type": "integer"
},
{
"type": "null"
}
],
"title": "Viewport Height",
"default": 1080
},
"user_agent": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "User Agent"
}
},
"type": "object",
"title": "BrowserSessionCreateRequest",
"description": "Request schema for creating a browser session"
}

Field details:

FieldTypeRequiredDescriptionConstraints
viewport_widthinteger | nullNonullable
viewport_heightinteger | nullNonullable
user_agentstring | nullNonullable

Responses

200

Successful Response

application/json

Resolved schema:

{
"properties": {
"session_id": {
"type": "string",
"title": "Session Id"
},
"status": {
"type": "string",
"title": "Status"
},
"viewport_width": {
"type": "integer",
"title": "Viewport Width"
},
"viewport_height": {
"type": "integer",
"title": "Viewport Height"
},
"user_agent": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "User Agent"
},
"created_at": {
"type": "string",
"format": "date-time",
"title": "Created At"
},
"last_activity": {
"type": "string",
"format": "date-time",
"title": "Last Activity"
},
"expires_at": {
"anyOf": [
{
"type": "string",
"format": "date-time"
},
{
"type": "null"
}
],
"title": "Expires At"
}
},
"type": "object",
"required": [
"session_id",
"status",
"viewport_width",
"viewport_height",
"user_agent",
"created_at",
"last_activity",
"expires_at"
],
"title": "BrowserSessionResponse",
"description": "Response schema for browser session information"
}

Field details:

FieldTypeRequiredDescriptionConstraints
session_idstringYes
statusstringYes
viewport_widthintegerYes
viewport_heightintegerYes
user_agentstring | nullYesnullable
created_atstringYesformat=date-time
last_activitystringYesformat=date-time
expires_atstring | nullYesformat=date-time, nullable

422

Validation Error

application/json

Resolved schema:

{
"properties": {
"detail": {
"items": {
"properties": {
"loc": {
"items": {
"anyOf": [
{
"type": "string"
},
{
"type": "integer"
}
]
},
"type": "array",
"title": "Location"
},
"msg": {
"type": "string",
"title": "Message"
},
"type": {
"type": "string",
"title": "Error Type"
}
},
"type": "object",
"required": [
"loc",
"msg",
"type"
],
"title": "ValidationError"
},
"type": "array",
"title": "Detail"
}
},
"type": "object",
"title": "HTTPValidationError"
}

Field details:

FieldTypeRequiredDescriptionConstraints
detailarray<object>No
detail[]objectNo
detail[].locarray<string | integer>No
detail[].loc[]string | integerNo
detail[].msgstringNo
detail[].typestringNo