Activate Tab
Browser Sessions
Activate Tab
Make the given tab the active one for subsequent session-scoped operations.
POST
Activate Tab
Overview
The/browser/sessions/{id}/pages/{pageId}/activate endpoint switches the session’s active tab to the one identified by pageId. The tab is brought to the foreground and becomes the target for all subsequent session-scoped operations (mouse, keyboard, navigate, content, screenshot, PDF).
This avoids having to pass pageId on every request — set the active tab once, then use the compact session-scoped endpoints.
Path Parameters
Browser session ID (UUID). Create via
POST /browser/sessions.CDP target identifier of the tab to activate. 32-character uppercase hex. Obtain via
POST /pages or GET /pages.Body
No request body. Send an empty request.Example Request
Response
Success Response (200)
true when the tab was activated.CDP target identifier of the now-active tab (echoed back for correlation).
Error Responses
| Status | Description |
|---|---|
401 | Unauthorized — invalid or missing API key. |
404 | Session not found, not owned by the caller, or no tab with the given pageId exists in the session. |
408 | Navigation timeout — rarely occurs, set if the underlying bring-to-front command stalls. |
503 | The browser session is temporarily unreachable. |
Notes
- Subsequent session-scoped operations (mouse, keyboard, navigate, content, screenshot) target whichever tab is currently active. Use this to swap context between tabs without needing per-request
pageIdplumbing. - The active tab also reflects in noVNC live-view — activating a tab brings it to the foreground for anyone watching.