Skip to main content

DELETE /tabs/:id

Closes a specific browser tab and releases associated resources. Safe to call even if the tab doesn’t exist.

Authentication

Requires userId in the request body to verify ownership of the tab.

Request

Path parameters

string
required
The tabId to close.

Body parameters

string
required
User identifier. Must match the user who owns the tab.

Response

boolean
Always true. Returns success even if tab was already closed or doesn’t exist.

Example

Response:

DELETE /tabs/group/:groupId

Closes all tabs within a session group (identified by sessionKey or legacy listItemId). Useful for cleaning up all tabs associated with a task or conversation.

Authentication

Requires userId in the request body to verify ownership.

Request

Path parameters

string
required
The sessionKey (or listItemId) identifying the tab group to close.

Body parameters

string
required
User identifier. Must match the user who owns the tab group.

Response

boolean
Always true. Returns success even if the group was empty or doesn’t exist.

Example

Response:

Error responses

Notes

Cleanup behavior

  • Closing a tab removes it from the session’s tab group
  • If closing the last tab in a group, the entire group is deleted
  • Tab locks are released immediately upon closure
  • Page close has a 5-second timeout to prevent hangs (PAGE_CLOSE_TIMEOUT_MS)

Session cleanup

  • If a session has zero tabs remaining, it becomes eligible for cleanup
  • Sessions expire after 30 minutes of inactivity (configurable via SESSION_TIMEOUT_MS)
  • When all sessions are closed, the browser enters idle mode and shuts down after 5 minutes (configurable via BROWSER_IDLE_TIMEOUT_MS)

Safe to call multiple times

  • Both endpoints are idempotent - calling them on already-closed tabs/groups returns success
  • No error is thrown if the tab or group doesn’t exist

To close all tabs for a user

Use the session endpoint instead:
This closes the entire browser context, all tabs, and clears all cookies/storage for the user.