Worktrees
CompozyOS Worktrees HTTP endpoints.
/api/workspaces/{workspace_id}/worktreesPath Parameters
Workspace id or path
Query Parameters
Refresh Git discovery and status
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/api/workspaces/string/worktrees"{ "discovered": [ { "branch": "string", "detached": true, "name": "string", "path": "string", "reason": "string", "selectable": true, "stale": true, "unavailable": true } ], "repo": { "diagnostic": "string", "git_available": true, "git_backed": true }, "worktrees": [ { "agent_activity": "string", "ahead": 0, "base_ref": "string", "behind": 0, "branch": "string", "created_at": "2019-08-24T14:15:22Z", "created_branch": true, "created_head": "string", "dirty": true, "id": "string", "name": "string", "origin": "string", "path": "string", "pending_phase": "string", "run_id": "string", "run_namespace": "string", "setup_error": "string", "setup_state": "string", "state": "string", "updated_at": "2019-08-24T14:15:22Z", "workspace_id": "string" } ]}/api/workspaces/{workspace_id}/worktreesPath Parameters
Workspace id or path
Request Body
application/json
JSON request body
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/workspaces/string/worktrees" \ -H "Content-Type: application/json" \ -d '{}'{ "worktree": { "agent_activity": "string", "ahead": 0, "base_ref": "string", "behind": 0, "branch": "string", "created_at": "2019-08-24T14:15:22Z", "created_branch": true, "created_head": "string", "dirty": true, "id": "string", "name": "string", "origin": "string", "path": "string", "pending_phase": "string", "run_id": "string", "run_namespace": "string", "setup_error": "string", "setup_state": "string", "state": "string", "updated_at": "2019-08-24T14:15:22Z", "workspace_id": "string" }}/api/workspaces/{workspace_id}/worktrees/adoptPath Parameters
Workspace id or path
Request Body
application/json
JSON request body
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/workspaces/string/worktrees/adopt" \ -H "Content-Type: application/json" \ -d '{ "path": "string" }'{ "worktree": { "agent_activity": "string", "ahead": 0, "base_ref": "string", "behind": 0, "branch": "string", "created_at": "2019-08-24T14:15:22Z", "created_branch": true, "created_head": "string", "dirty": true, "id": "string", "name": "string", "origin": "string", "path": "string", "pending_phase": "string", "run_id": "string", "run_namespace": "string", "setup_error": "string", "setup_state": "string", "state": "string", "updated_at": "2019-08-24T14:15:22Z", "workspace_id": "string" }}/api/workspaces/{workspace_id}/worktrees/{worktree_id}Path Parameters
Workspace id or path
Worktree id, name, or path
Response Body
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/api/workspaces/string/worktrees/string"{ "bindings": { "agent_activity": "string" }, "forge": { "fetched_at": "2019-08-24T14:15:22Z", "merged": true, "pr_number": 0, "pr_state": "string", "pr_url": "string", "provider": "string" }, "repo": { "diagnostic": "string", "git_available": true, "git_backed": true }, "status": { "ahead": 0, "ahead_of_base": 0, "behind": 0, "branch": "string", "deletions": 0, "detached": true, "dirty_files": 0, "has_upstream": true, "head_sha": "string", "insertions": 0, "read_error": "string", "refreshed_at": "2019-08-24T14:15:22Z" }, "worktree": { "agent_activity": "string", "ahead": 0, "base_ref": "string", "behind": 0, "branch": "string", "created_at": "2019-08-24T14:15:22Z", "created_branch": true, "created_head": "string", "dirty": true, "id": "string", "name": "string", "origin": "string", "path": "string", "pending_phase": "string", "run_id": "string", "run_namespace": "string", "setup_error": "string", "setup_state": "string", "state": "string", "updated_at": "2019-08-24T14:15:22Z", "workspace_id": "string" }}/api/workspaces/{workspace_id}/worktrees/{worktree_id}Path Parameters
Workspace id or path
Worktree id, name, or path
Query Parameters
Confirm destructive removal
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X DELETE "https://example.com/api/workspaces/string/worktrees/string"/api/workspaces/{workspace_id}/worktrees/{worktree_id}/cancelPath Parameters
Workspace id or path
Worktree id, name, or path
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/workspaces/string/worktrees/string/cancel"/api/workspaces/{workspace_id}/worktrees/{worktree_id}/dismissPath Parameters
Workspace id or path
Worktree id, name, or path
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/workspaces/string/worktrees/string/dismiss"/api/workspaces/{workspace_id}/worktrees/{worktree_id}/exitPath Parameters
Workspace id or path
Worktree id, name, or path
Response Body
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/api/workspaces/string/worktrees/string/exit"{ "actions": [ { "action": "string", "blocked_reason": "string", "enabled": true, "label": "string", "pr_number": 0, "publish": true, "url": "string" } ], "base": "string", "browser_url": "string", "cleanup": { "blocker": "string", "downgraded": true, "forge_state": "string", "safe": true, "source": "string", "stale": true, "summary": "string" }, "commit_scope": { "changed_files": 0, "deletions": 0, "insertions": 0, "untracked_files": [ "string" ], "untracked_total": 0, "untracked_truncated": true }, "forge": { "compare_url_template": "string", "credential_source": "string", "default_branch": "string", "open_action_label": "string", "provider": "string", "request_noun": "string", "supports_draft": true, "template_paths": [ "string" ], "view_action_label": "string" }, "forge_status": { "fetched_at": "2019-08-24T14:15:22Z", "merged": true, "pr_number": 0, "pr_state": "string", "pr_url": "string", "provider": "string" }, "global_pause_cause": "string", "pr_prefill": { "body": "string", "title": "string" }, "primary": "string", "worktree_id": "string"}/api/workspaces/{workspace_id}/worktrees/{worktree_id}/exit/actionsPath Parameters
Workspace id or path
Worktree id, name, or path
Request Body
application/json
JSON request body
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/workspaces/string/worktrees/string/exit/actions" \ -H "Content-Type: application/json" \ -d '{ "action": "string" }'{ "op_id": "string"}/api/workspaces/{workspace_id}/worktrees/{worktree_id}/exit/cancelPath Parameters
Workspace id or path
Worktree id, name, or path
Request Body
application/json
JSON request body
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/api/workspaces/string/worktrees/string/exit/cancel" \ -H "Content-Type: application/json" \ -d '{ "op_id": "string" }'/api/workspaces/{workspace_id}/worktrees/{worktree_id}/statusPath Parameters
Workspace id or path
Worktree id, name, or path
Query Parameters
Refresh local Git status
Refresh the serving forge provider
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/api/workspaces/string/worktrees/string/status"{ "forge": { "fetched_at": "2019-08-24T14:15:22Z", "merged": true, "pr_number": 0, "pr_state": "string", "pr_url": "string", "provider": "string" }, "status": { "ahead": 0, "ahead_of_base": 0, "behind": 0, "branch": "string", "deletions": 0, "detached": true, "dirty_files": 0, "has_upstream": true, "head_sha": "string", "insertions": 0, "read_error": "string", "refreshed_at": "2019-08-24T14:15:22Z" }, "worktree_id": "string"}/api/workspaces/{workspace_id}/worktrees/{worktree_id}/streamPath Parameters
Workspace id or path
Worktree id, name, or path
Query Parameters
Replay events after this durable sequence
int64Header Parameters
Resume after this durable sequence
Response Body
text/event-stream
application/json
application/json
application/json
application/json
curl -X GET "https://example.com/api/workspaces/string/worktrees/string/stream"{ "property1": null, "property2": null}curl -X GET "https://example.com/api/worktrees/catalog-stream"{ "error": "string", "kind": "string", "workspace_id": "string", "worktree_id": "string"}