> ## Documentation Index
> Fetch the complete documentation index at: https://docs.gbox.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Update browser tab URL

> Navigate an existing browser tab to a new URL. This endpoint updates the specified tab by navigating it to the provided URL and returns the updated tab information. The browser will wait for the DOM content to be loaded before returning the response. If the navigation fails due to an invalid URL or network issues, an error will be returned. The updated tab information will include the new title, final URL (after any redirects), and favicon from the new page.



## OpenAPI

````yaml put /boxes/{boxId}/browser/tabs/{tabId}
openapi: 3.0.0
info:
  title: GBOX Open API
  description: GBOX Open API Documentation
  version: '1.0'
  contact: {}
servers:
  - url: https://gbox.ai/api/v1
    description: Production Server
security: []
tags: []
paths:
  /boxes/{boxId}/browser/tabs/{tabId}:
    put:
      tags:
        - Browser
      summary: Update browser tab URL
      description: >-
        Navigate an existing browser tab to a new URL. This endpoint updates the
        specified tab by navigating it to the provided URL and returns the
        updated tab information. The browser will wait for the DOM content to be
        loaded before returning the response. If the navigation fails due to an
        invalid URL or network issues, an error will be returned. The updated
        tab information will include the new title, final URL (after any
        redirects), and favicon from the new page.
      operationId: BrowserController_updateTab
      parameters:
        - name: boxId
          required: true
          in: path
          description: Box ID
          schema:
            example: c9bdc193-b54b-4ddb-a035-5ac0c598d32d
            type: string
        - name: tabId
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        description: New URL to navigate the tab to
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateTab'
            examples:
              navigate_google:
                summary: Navigate to Google
                value:
                  url: https://www.google.com
              navigate_github:
                summary: Navigate to GitHub
                value:
                  url: https://github.com
      responses:
        '200':
          description: Successfully updated tab
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BrowserTab'
      security:
        - bearer: []
      x-codeSamples:
        - lang: JavaScript
          source: |-
            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();
        - lang: Python
          source: |-
            import os
            from gbox_sdk import GboxSDK

            def main():
                gbox_sdk = GboxSDK(api_key=os.environ["GBOX_API_KEY"])

                box = gbox_sdk.create(type="linux")

                # Update tab with ID "1" to navigate to GitHub
                updated_tab = box.browser.update_tab(
                    tab_id="1",
                    url="https://github.com"
                )

                print(f"Tab updated successfully:")
                print(f"  ID: {updated_tab.id}")
                print(f"  Title: {updated_tab.title}")
                print(f"  URL: {updated_tab.url}")

            if __name__ == "__main__":
                main()
        - lang: Go
          source: "package main\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"log\"\n\t\"os\"\n\n\t\"github.com/gbox/gbox-sdk-go\"\n)\n\nfunc main() {\n\tgboxSDK := gbox.NewGboxSDK(os.Getenv(\"GBOX_API_KEY\"))\n\n\tbox, err := gboxSDK.Create(context.Background(), gbox.CreateOptions{Type: \"linux\"})\n\tif err != nil {\n\t\tlog.Fatalf(\"Failed to create linux box: %v\", err)\n\t}\n\n\t// Update tab with ID \"1\" to navigate to GitHub\n\tupdatedTab, err := box.Browser.UpdateTab(context.Background(), &gbox.UpdateTabRequest{\n\t\tID:  \"1\",\n\t\tURL: \"https://github.com\",\n\t})\n\tif err != nil {\n\t\tlog.Fatalf(\"Failed to update tab: %v\", err)\n\t}\n\n\tfmt.Printf(\"Tab updated successfully:\\n\")\n\tfmt.Printf(\"  ID: %s\\n\", updatedTab.ID)\n\tfmt.Printf(\"  Title: %s\\n\", updatedTab.Title)\n\tfmt.Printf(\"  URL: %s\\n\", updatedTab.URL)\n\n\t// Update multiple tabs with different URLs\n\ttype Update struct {\n\t\tID  string\n\t\tURL string\n\t}\n\n\tupdates := []Update{\n\t\t{ID: \"2\", URL: \"https://stackoverflow.com\"},\n\t\t{ID: \"3\", URL: \"https://developer.mozilla.org\"},\n\t}\n\n\tfor _, update := range updates {\n\t\ttab, err := box.Browser.UpdateTab(context.Background(), &gbox.UpdateTabRequest{\n\t\t\tID:  update.ID,\n\t\t\tURL: update.URL,\n\t\t})\n\t\tif err != nil {\n\t\t\tfmt.Printf(\"Failed to update tab %s: %v\\n\", update.ID, err)\n\t\t} else {\n\t\t\tfmt.Printf(\"Updated tab %s: %s - %s\\n\", update.ID, tab.Title, tab.URL)\n\t\t}\n\t}\n}"
components:
  schemas:
    UpdateTab:
      type: object
      properties:
        url:
          type: string
          description: The tab new url
          example: https://www.google.com
          title: TabUrl
      title: Update Tab
      description: Update tab url
      required:
        - url
    BrowserTab:
      type: object
      properties:
        id:
          type: string
          description: The tab id
          example: '1'
          title: TabId
        title:
          type: string
          description: The tab title
          example: Google
          title: TabTitle
        url:
          type: string
          description: The tab url
          example: https://www.google.com
          title: TabUrl
        favicon:
          type: string
          description: The tab favicon
          example: https://www.google.com/favicon.ico
          title: TabFavicon
        active:
          type: boolean
          description: Whether the tab is the current active (frontmost) tab
          example: true
          title: TabActive
        loading:
          type: boolean
          description: >-
            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
          title: TabLoading
      title: Browser Tab
      description: Browser tab
      required:
        - id
        - title
        - url
        - favicon
        - active
        - loading
  securitySchemes:
    bearer:
      scheme: bearer
      bearerFormat: JWT
      type: http
      description: >-
        Enter your API Key in the format: Bearer <token>. Get it from
        https://gbox.ai

````