Close Tab
Browser Sessions
Close Tab
Close a tab by pageId.
DELETE
Close Tab
Overview
TheDELETE /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.
Path Parameters
string
required
Browser session ID (UUID). Create via
POST /browser/sessions.string
required
CDP target identifier of the tab to close. 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)
boolean
true when the tab was closed.string
CDP target identifier of the closed tab (echoed back for correlation).
Error Responses
Notes
- If the closed tab was active, another tab is promoted to active. Call
GET /browser/sessions/{id}/pagesto inspect the new active tab. - To end a session entirely, call
DELETE /browser/sessions/{id}rather than closing the last tab.