Skip to main content
GET
Restore the full conversation and document state for a previous session.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Headers

authorization
string | null

Path Parameters

session_id
string
required

Query Parameters

focus_document_id
string | null

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_html
boolean
default:true

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).

Response

Successful Response

Conversation history with document state and restoration instructions.

session_id
string
required

Session identifier.

messages
Messages · object[]
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).

document_state
DocumentState · object | null

Current document state. Present if the session has an active document.

editor_action
string
default:keep

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