Undo a revert: restore the pre-revert state and the rolled-back turns.
Revert is non-destructive: this restores the session FORWARD to the pre-revert state (returned by the revert as redo_checkpoint_id), restores the document to that state while still merging any concurrent edits from other sessions (keeping both where they conflict), and un-archives exactly the chat turns the revert hid. Intended for use immediately after a revert; once a new message is sent the timeline diverges and the web app stops offering it.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Headers
Path Parameters
Body
Undo a revert — restore the captured pre-revert state and the rolled-back conversation + document. Meant for use immediately after a revert (before sending a new message, which would diverge the timeline); the web app gates it to that window.
The turn the revert rewound to (rows at/after this were archived); redo un-archives exactly those.
x >= 0The identifier of the pre-revert state, returned by the revert response.
Optional identifier for the client window issuing the request, used to coordinate concurrent reverts from multiple browser tabs.
Response
Successful Response
Result of a session revert: restored document state and compose-box prefill.
Session identifier.
Turn index that the active conversation now ends at (the AI reply preceding the reverted user message). -1 when the session is reset to its initial empty state (revert from the very first user message).
The text of the user message that was reverted. Clients should pre-fill the compose box with this so the user can edit and resend.
Number of chat rows soft-archived by this revert (turns hidden from the UI but retained for audit).
Restored document state. Null when the session is reset to empty.
Client instruction: 'update' to load the restored document, or 'clear' to reset the editor to empty.
Per-document (slug -> change-set) revert diff. Applying these merges the revert onto any concurrent live edits — a conflicting section is surfaced for you to resolve rather than replacing the whole document. On dry_run this is the preview; on a real revert it is what was committed.
Echoes the request's dry_run: when true nothing was committed/archived — this is a preview only.
The identifier of the pre-revert state. Revert is non-destructive — passing this back to POST /sessions/{id}/redo (with the same turn_index) restores it and un-archives the rolled-back turns, undoing the revert. Null on a dry-run or a first-message reset.

