Close a tab by pageId.
DELETE /browser/sessions/{id}/pages/{pageId} endpoint closes a single tab in the session. The tab is identified by its CDP target identifier, which you can obtain from POST /browser/sessions/{id}/pages or GET /browser/sessions/{id}/pages.
Closing the currently active tab promotes another tab to active. You cannot close the last remaining tab in a session — doing so returns 409 Conflict.
POST /browser/sessions.POST /pages or GET /pages.true when the tab was closed.| 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 while processing the close (rare — occurs when beforeunload handlers block). |
409 | Cannot close the last remaining tab in the session. Close the session instead. |
503 | The browser session is temporarily unreachable. |
GET /browser/sessions/{id}/pages to inspect the new active tab.DELETE /browser/sessions/{id} rather than closing the last tab.