v1
mcp
sessions

Start a new chat session and open documents into it in one call.

Create a session AND open N saved documents into it in ONE call (the documents are SHARED, never copied — the same cross-session behavior as /documents/open). The web UI passes its own session_id so its session model stays consistent; an MCP/API integrator can omit it and the server mints one — the one-call way to start a session with documents already open. With no document_ids it just returns a fresh, empty session. The open semantics (first document focused, durable binding, returned roster) are identical to /documents/open.

post/v1/sessions/init

Request

  • Base URL: https://api.superdocs.app
  • URL: https://api.superdocs.app/v1/sessions/init
  • Auth: HTTP bearer

Query parameters

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

Request body

document_idsstring[] nullable

Durable document ids (from GET /v1/documents) to open into the brand-new session. Omit/empty to start an empty session.

session_idstring nullable

Optional client-chosen session id (the web UI passes its own so its session model stays consistent). Omit and the server mints one — the one-call way for an MCP/API integrator to start a session with documents already open.

Response

Successful Response

unknown required

Changes

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