sessions module route (requires sessions:run:read)
GET
/v1/m/sessions/runs/{ref}/git
const url = 'https://example.com/v1/m/sessions/runs/example/git';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://example.com/v1/m/sessions/runs/example/git \ --header 'Authorization: Bearer <token>'Returns the current branch, local branches, working-tree status and write policy in the session’s folder.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ” ref
required
string
Path parameter ref.
Header Parameters
Section titled “ Header Parameters ” X-Olivares-Tenant
string format: uuid
Target tenant id; required when the principal can act in more than one tenant.
Responses
Section titled “ Responses ”Confined local Git status and folder write policy
Media type application/json
object
branch
required
Current local branch; empty for detached HEAD.
string
branches
required
Array<string>
files
required
Array<object>
object
index
required
string
path
required
string
worktree
required
string
truncated
required
boolean
writable
required
boolean
Example generated
{ "branch": "example", "branches": [ "example" ], "files": [ { "index": "example", "path": "example", "worktree": "example" } ], "truncated": true, "writable": 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
{}