Skip to content

Remove a worktree

DELETE
/api/panes/{pane_id}/worktree
Code sample: Shell / cURL
curl --request DELETE \
--url http://127.0.0.1:8004/api/panes/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/worktree \
--header 'Authorization: Bearer <token>'

Removes the Git worktree the pane is in, closing every pane in it.

pane_id
required
string format: uuid

Pane ID

The removed worktree and the panes it closed

Media typeapplication/json
object
path
required
string
branch
string | null
closed_panes
required
Array<string>

Example generated

{
"path": "example",
"branch": "example",
"closed_panes": [
"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"
]
}

A malformed ID

Media typetext/plain
string

Missing or wrong access token

Media typetext/plain
string

The request’s Host or Origin isn’t allowed, or the caller can’t use this route (a guest token, or btmux connect)

No such pane

Media typetext/plain
string

The pane isn’t in a linked worktree, the worktree is locked, or a pane in it is running a program

Media typetext/plain
string

Git failed

Media typetext/plain
string