v1
mcp
sessions

Close (remove) a document from a multi-document session.

Remove document_id from the session's open documents (the tab close button). If it's the focused document, focus another open document — next_focus if it's still open (so the client can pick the adjacent tab), else the next remaining one; closing the last document leaves the session empty. Returns the updated document roster + the now-focused document's HTML.

The close takes effect immediately and is persisted, so a later reconnect or session restore won't bring the closed document back. Persistence is best-effort — a failure is logged, not fatal (the close still holds for the active session).

delete/v1/sessions/{session_id}/documents/{document_id}

Request

  • Base URL: https://api.superdocs.app
  • URL: https://api.superdocs.app/v1/sessions/{session_id}/documents/{document_id}
  • Auth: HTTP bearer

Path parameters

session_idstring required
document_idstring required

Query parameters

next_focusstring nullable
include_htmlboolean

Include each document's full reassembled HTML body. Default false (token-light — recommended for AI agents enumerating or switching tabs): returns only ids, title, section count, focused flag, and page setup, omitting the body which can be hundreds of KB per document. The web app passes true to render document content.

Headers

authorizationstring nullable

Response

Successful Response

unknown required

Changes

No recorded changes to this operation across all 1 revision of this API.