Skip to main content

Switch Tab

POST /v1/browser/tabs/switch

Make another open tab the one later actions use

Authentication​

Requires authentication via: OAuth2PasswordBearer.

Parameters​

NameInTypeRequiredDescriptionConstraints
X-API-Keyheaderstring | nullNonullable

Request Body​

Required: Yes

application/json​

Resolved schema:

{
"properties": {
"session_id": {
"type": "string",
"title": "Session Id"
},
"tab_id": {
"type": "string",
"minLength": 1,
"title": "Tab Id"
}
},
"type": "object",
"required": [
"session_id",
"tab_id"
],
"title": "BrowserTabRequest",
"description": "Address one open tab by the tab_id the tab listing returned."
}

Field details:

FieldTypeRequiredDescriptionConstraints
session_idstringYes
tab_idstringYesminLength=1

Responses​

200​

Successful Response

application/json​

Resolved schema:

{
"properties": {
"success": {
"type": "boolean",
"title": "Success"
},
"session_id": {
"type": "string",
"title": "Session Id"
},
"tabs": {
"items": {
"properties": {
"tab_id": {
"type": "string",
"title": "Tab Id"
},
"url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Url"
},
"title": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Title"
},
"active": {
"type": "boolean",
"title": "Active",
"default": false
}
},
"type": "object",
"required": [
"tab_id"
],
"title": "BrowserTab"
},
"type": "array",
"title": "Tabs"
},
"tab_count": {
"type": "integer",
"title": "Tab Count"
},
"active_tab_id": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Active Tab Id"
},
"active_url": {
"anyOf": [
{
"type": "string"
},
{
"type": "null"
}
],
"title": "Active Url"
},
"execution_time": {
"type": "number",
"title": "Execution Time"
}
},
"type": "object",
"required": [
"success",
"session_id",
"tabs",
"tab_count",
"execution_time"
],
"title": "BrowserTabsResponse",
"description": "Open tabs in a session; page actions target the active one."
}

Field details:

FieldTypeRequiredDescriptionConstraints
successbooleanYes
session_idstringYes
tabsarray<object>Yes
tabs[]objectYes
tabs[].tab_idstringYes
tabs[].urlstring | nullNonullable
tabs[].titlestring | nullNonullable
tabs[].activebooleanNodefault=false
tab_countintegerYes
active_tab_idstring | nullNonullable
active_urlstring | nullNonullable
execution_timenumberYes

400​

The browser rejected the tab request as invalid (detail.code is invalid_request).

No response body.

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.

404​

Session not found, expired, or not yours (not_found); the tab does not exist (tab_not_found); or this browser has no tab support (unsupported).

No response body.

409​

The tab request conflicts with the session state, for example the tab limit is reached (tab_limit) or it is the last open tab (last_tab).

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:

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

502​

The browser service could not complete the tab request.

No response body.