Create Browser Session
POST /v1/browser/sessions/
Create a new browser session
Authentication
Requires authentication via: OAuth2PasswordBearer.
Parameters
| Name | In | Type | Required | Description | Constraints |
|---|---|---|---|---|---|
X-API-Key | header | string | null | No | nullable |
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:
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
viewport_width | integer | null | No | nullable | |
viewport_height | integer | null | No | nullable | |
user_agent | string | null | No | nullable |
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:
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
session_id | string | Yes | ||
status | string | Yes | ||
viewport_width | integer | Yes | ||
viewport_height | integer | Yes | ||
user_agent | string | null | Yes | nullable | |
created_at | string | Yes | format=date-time | |
last_activity | string | Yes | format=date-time | |
expires_at | string | null | Yes | format=date-time, nullable |
401
No credentials, or the Bearer token / X-API-Key is invalid.
No response body.
403
The account is disabled, or a guest token was used.
No response body.
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:
| Field | Type | Required | Description | Constraints |
|---|---|---|---|---|
detail | array<object> | No | ||
detail[] | object | No | ||
detail[].loc | array<string | integer> | No | ||
detail[].loc[] | string | integer | No | ||
detail[].msg | string | No | ||
detail[].type | string | No |
429
Your monthly browser API quota is used up, or the browser service is at session capacity (close or reuse one of your sessions).
No response body.
502
The browser service could not create the session.
No response body.