Reset worktree
POST /api/v1/projects/{projectId}/{agentType}/worktrees/{wid}/reset
POST
/api/v1/projects/{projectId}/{agentType}/worktrees/{wid}/reset
Clears session state for a worktree: kills any running process, deletes agent session files, and removes terminal tracking state. Audit events are preserved. The worktree itself is preserved.
Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ” projectId
required
string
Project ID
wid
required
string
Worktree ID
Responses
Section titled “ Responses ”OK
object
projectId
ProjectID is the deterministic project identifier the worktree belongs to.
string
state
State is the worktree’s terminal state after the mutation (“connected”, “shell”, “background”, “stopped”). Best-effort — may be empty if the state could not be determined (e.g. container not running).
string
worktreeId
WorktreeID is the worktree identifier.
string
Bad Request
object
code
string
error
string
Not Found
object
code
string
error
string
Internal Server Error
object
code
string
error
string