sessions module route (requires sessions:run:write)
POST
/v1/m/sessions/runs/{ref}/git/stage
const url = 'https://example.com/v1/m/sessions/runs/example/git/stage';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"create":true,"message":"example","name":"example","paths":["example"],"work_lease_fence":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/v1/m/sessions/runs/example/git/stage \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "create": true, "message": "example", "name": "example", "paths": [ "example" ], "work_lease_fence": 1 }'Stages the selected paths in the session’s folder for the next commit.
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.
Request Body required
Section titled “ Request Body required ” 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
name
string
paths
required
Array<string>
work_lease_fence
integer format: int64
Example generated
{ "create": true, "message": "example", "name": "example", "paths": [ "example" ], "work_lease_fence": 1}Responses
Section titled “ Responses ”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
{}