Fork Agent Session
POST
/agents/{agent_id}/sessions/{session_id}/forkDeep-copy a session into a new independent session. Every run is copied with a fresh run_id; the new session has a fresh session_id. The original is untouched. Use to explore alternative conversation paths without mutating the source.
Distinct from /continue?fork=true: that creates a sibling run inside the same session. This creates a sibling session.
Authorization
HTTPBearer AuthorizationBearer <token>
In: header
Path Parameters
agent_id*Agent Id
session_id*Session Id
Query Parameters
user_id?string|null
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl --request POST 'https://example.com/agents/string/sessions/string/fork'null{ "detail": "string", "error_id": "string", "error_type": "string"}{ "detail": "string", "error_id": "string", "error_type": "string"}{ "detail": "string", "error_id": "string", "error_type": "string"}{ "detail": "string"}{ "detail": "string", "error_id": "string", "error_type": "string"}