sessions module route (requires sessions:workspace:admin)
const url = 'https://example.com/v1/m/sessions/workspaces';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"allow_subpaths":["example"],"container_target":"example","dlp_mode":"","max_read_bytes":1,"mount_mode":"","name":"example","read_only_folders":["example"],"root_path":"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/workspaces \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "allow_subpaths": [ "example" ], "container_target": "example", "dlp_mode": "", "max_read_bytes": 1, "mount_mode": "", "name": "example", "read_only_folders": [ "example" ], "root_path": "example" }'Creates one session workspace from the posted parameters, and answers 503 when the workspace registry 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
Empty/null defaults to rw. write_no_delete is read-write without the right to remove a name: a native session creates and changes files in the folder (existing files can still be overwritten or emptied) and cannot unlink, rmdir, rename or move one out, and the file API refuses delete and move. The kernel enforces it (Linux Landlock), so a session in such a folder does not start on a host that cannot confine. In a folder that is a Git repository, .git stays fully writable so the agent’s own git works (it renames a lock file over its index), which also lets the session empty .git and destroy the repository’s history; the working files stay protected. A tool that replaces a file by removing or renaming it (sed -i, an atomic-save formatter) is refused and can leave its temporary file. The session’s Git panel acts for the person and is not restricted.
Additional read-only host folders for native sessions. Read-only folders protect file content and directory entries (no write, truncate, create, remove or rename); permissions, ownership, extended attributes and timestamps follow the host’s normal permissions. Must be absolute, existing directories outside protected engine folders. The server stores canonical paths. Omitted on create or an empty array grants no extra access.
After trimming, must be an absolute, existing directory; the server stores its canonical real path.
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
{}