Skip to content

sessions module route (requires sessions:run:write)

POST
/v1/m/sessions/runs/{ref}/git/branch
curl --request POST \
--url https://example.com/v1/m/sessions/runs/example/git/branch \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "create": true, "message": "example", "name": "example", "paths": [ "example" ], "work_lease_fence": 1 }'

Switches the session’s folder to the named branch, creating it first when requested.

ref
required
string

Path parameter ref.

X-Olivares-Tenant
string format: uuid

Target tenant id; required when the principal can act in more than one tenant.

Media type application/json
object
create
boolean
message

Nonblank commit message, at most 8192 UTF-8 bytes. Both Git identities come from the authenticated user profile.

string
<= 8192 characters
name
required
string
<= 512 characters
paths
Array<string>
>= 1 items <= 200 items
work_lease_fence
integer format: int64
>= 1
Example generated
{
"create": true,
"message": "example",
"name": "example",
"paths": [
"example"
],
"work_lease_fence": 1
}

Local Git operation completed

Media type application/json
object
ok
required
boolean
Example generated
{
"ok": true
}

Bad request

Media type application/json
object
Example generated
{}

Unauthenticated

Media type application/json
object
Example generated
{}

Forbidden

Media type application/json
object
Example generated
{}

Not found

Media type application/json
object
Example generated
{}

Git refused the operation, the workspace changed, or the work lease is stale

Media type application/json
object
Example generated
{}

Unsupported isolation or Git output limit exceeded

Media type application/json
object
Example generated
{}

Rate limited

Media type application/json
object
Example generated
{}

Session OS boundary could not be established; no unconfined fallback

Media type application/json
object
Example generated
{}

Session confinement, Git, policy or store is unavailable

Media type application/json
object
Example generated
{}