PUT
/
boxes
/
{boxId}
/
browser
/
tabs
/
{tabId}
JavaScript
import GboxSDK from "gbox-sdk";

const gboxSDK = new GboxSDK({
  apiKey: process.env["GBOX_API_KEY"] // This is the default and can be omitted
});

async function main() {
  const box = await gboxSDK.create({ type: "linux" });

  // Update tab at index 0 to navigate to GitHub
  const updatedTab = await box.browser.updateTab(
    "1",
    "https://github.com"
  );

  console.log(`Tab updated successfully:`);
  console.log(`  ID: ${updatedTab.id}`);
  console.log(`  Title: ${updatedTab.title}`);
  console.log(`  URL: ${updatedTab.url}`);
}

main();
{
  "id": "1",
  "title": "Google",
  "url": "https://www.google.com",
  "favicon": "https://www.google.com/favicon.ico",
  "active": true,
  "loading": false
}

Authorizations

Authorization
string
header
required

Enter your API Key in the format: Bearer <token>. Get it from https://gbox.ai

Path Parameters

boxId
string
required

Box ID

Example:

"c9bdc193-b54b-4ddb-a035-5ac0c598d32d"

tabId
string
required

Body

application/json

New URL to navigate the tab to

Update tab url

url
string
required

The tab new url

Example:

"https://www.google.com"

Response

200 - application/json

Successfully updated tab

Browser tab

id
string
required

The tab id

Example:

"1"

title
string
required

The tab title

Example:

"Google"

url
string
required

The tab url

Example:

"https://www.google.com"

favicon
string
required

The tab favicon

Example:

"https://www.google.com/favicon.ico"

active
boolean
required

Whether the tab is the current active (frontmost) tab

Example:

true

loading
boolean
required

Whether the tab is currently in a loading state.

The value is true while the browser is still navigating to the target URL or fetching sub-resources (i.e. document.readyState is not "complete"). It typically switches to false once the load event fires and all major network activity has settled.

Example:

false