v1
mcp
sessions

Restore the full conversation and document state for a previous session.

Returns complete message history (user and AI), final document HTML with chunk IDs preserved, attachment list, and editor actions (font, color, alignment changes). Use to continue editing a document you started in a prior session. The AI rehydrates with full context of all prior decisions, chunk IDs, and attachments. Pass include_document_html=false to skip the full document body when you only need the conversation.

get/v1/sessions/{session_id}/history

Request

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

Path parameters

session_idstring required

Query parameters

focus_document_idstring nullable

Durable id of the document to focus on restore (e.g. the file the user clicked in the Files view). When set, that document is shown in the editor and marked focused in the roster; omit to use the session's own last-focused document.

include_document_htmlboolean

When false, omit the restored document's full HTML body (document_state.html_content) to keep your context small — agents that just need the conversation + metadata should set false. Default true (the web app needs the body to re-render the editor).

Headers

authorizationstring nullable

Response

Successful Response

session_idstring required

Session identifier.

messagesobject[] required

Ordered list of messages. Each item has: id (string), sender ('user' or 'ai'), content (string), timestamp (ISO 8601), turn_index (int), checkpoint_id (string or null — present on turns recorded after the revertability feature shipped; null for legacy turns where revert is unavailable).

editor_actionstring

Client instruction: 'update' (load document_state HTML into editor), 'clear' (reset editor), or 'keep' (no change).

restore_errorboolean nullable

True ONLY when the document RESTORE itself failed transiently (its content load timed out or errored, typically under backend memory pressure) — as distinct from a genuine document-less session ('clear') or an intentional no-change ('keep'). editor_action stays 'keep' so the editor is left exactly as-is (never wrongly cleared); this flag lets the client offer a non-blocking retry instead of silently leaving the user on an empty editor. Null/absent on success and on the genuine no-document path.

Changes

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