Skip to content

Switch the caller's worktree to another branch (or create one)

POST
/api/workspaces/{workspaceId}/apps-v2/{id}/checkout

The same thing git checkout (or git checkout -b with create) in the terminal does, offered as a button — and it goes through the sandbox, so both agree afterwards. Refuses with uncommitted work rather than choosing between carrying it across and discarding it.

workspaceId
required
string
id
required
string
object
branch
required
string
>= 1 characters <= 200 characters
create
boolean

Successful response

object
success

Whether the request succeeded.

boolean
data

Endpoint-specific response payload.

message
string
Example
Operation completed
error
string
Example
Error message

Invalid request

object
success
boolean
error
string
Example
Error message

Internal server error

object
success
boolean
error
string
Example
Error message