sessions module route (requires sessions:run:write)
const url = 'https://example.com/v1/m/sessions/runs';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"credentials":["example"],"effort":"example","env_allow":["example"],"fast_mode":true,"git_read":"example","isolation":"","model":"example","name":"example","no_setup":true,"permission_mode":"","provider_profile_ref":"example","secret_env":[{"env":"example","secret":"example"}],"service_tier":"example","template_id":"example","transport":"","workspace_ref":"example","worktree":true,"worktree_from":"example"}'};
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 \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "credentials": [ "example" ], "effort": "example", "env_allow": [ "example" ], "fast_mode": true, "git_read": "example", "isolation": "", "model": "example", "name": "example", "no_setup": true, "permission_mode": "", "provider_profile_ref": "example", "secret_env": [ { "env": "example", "secret": "example" } ], "service_tier": "example", "template_id": "example", "transport": "", "workspace_ref": "example", "worktree": true, "worktree_from": "example" }'Creates one session run from the posted parameters, and answers 503 when the runtime is not available.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Header Parameters
Section titled “ Header Parameters ”Target tenant id; required when the principal can act in more than one tenant.
Request Body required
Section titled “ Request Body required ”object
Business. Names of managed credentials (an SSH key or certificate, a database login, an API account) the session gets a way to use: an SSH agent socket, a database proxy or a local reverse proxy that the engine holds, never the secret itself. Needs tenant administration. A Community engine answers 501 business_required.
When non-empty, one approved Git-host repository binding (
When non-empty, names the provider profile the session launches under; the server resolves its homes and refuses a disabled, retired, foreign-environment or non-operable profile, and one whose driver requires an authorized authentication source it does not have. Only the reference is accepted: no home, environment, driver, binding, session id or authentication source.
object
The environment variable the child reads the secret from. A shell name; variables the runtime, a provider or the host base owns are refused.
The vault secret’s name in the tenant scope; must begin with env/.
Opt in to a git worktree and a new branch of the session’s own, made from the named workspace’s repository (which must be the repository’s top folder, native isolation, with no read-only folders). Absent, null or false keeps the session in the workspace folder itself.
With worktree: start the new worktree at this commit id or local branch of the workspace’s repository instead of its current commit (for example the branch and sha a handoff names). Absent keeps the current start. Refused without worktree, and when the commit or branch is not in the repository.
Responses
Section titled “ Responses ”OK
object
Example generated
{}Bad request
object
Example generated
{}Unauthenticated
object
Example generated
{}Forbidden
object
Example generated
{}Not found
object
Example generated
{}Conflict / setup required
object
Example generated
{}Rate limited
object
Example generated
{}