Branch Conversation
Fork a conversation at a completed user turn.
Creates a NEW thread whose message history is the parent’s prefix up to
from_turn and whose workspace (document / preferences / todos /
artifacts) is copied as-of that turn. The service manages its own
sessions because the LangGraph checkpointer seeding must happen between
two committed transactions.
Args:
payload: from_turn (>= 0; 0 forks from the empty start) and an
optional reason label.
user: The authenticated user (must own the conversation).
thread_id: The conversation to fork.
Returns:
BranchCreateResponse with the new thread id and branch metadata.
Raises:
HTTPException 400: from_turn at or before the thread’s own branch point.
HTTPException 403: The conversation belongs to another user.
HTTPException 404: Unknown conversation, or from_turn beyond the latest turn.
HTTPException 409: The snapshot needed to reconstruct the workspace is missing.
HTTPException 502: Checkpointer seeding failed (branch fully rolled back).
Authorizations
A personal access token (haico_pat_...), created under Profile → API keys. Send it as Authorization: Bearer <key>. The browser session JWT is also accepted but is an internal mechanism and is not part of the public contract.
Path Parameters
1 - 255Body
Payload for forking a conversation at a completed user turn.
Parent turn index to branch from. 0 forks from the empty start (used to retry/edit the very first turn).
x >= 0Optional branch label
500Displayed workspace to seed the branch with (restored-preview edits included). Omit to seed from the as-of-turn snapshot.