Query agent sessions
Query agent sessions with optional filters
Query parameters
The ID of the workspace to query sessions for
Filter by agent type (deprecated, use agent_types instead)
Filter by multiple agent types. If both agent_type and agent_types are null, defaults to the public agent types the workspace is entitled to see (test_recovery if Test Recovery Agent mode is on, runtime_recovery_summary_agent if the workspace can also start recovery work, test_authoring and repair_notes if generative AI is enabled for the workspace).
Filter by latest instance status. Include 'none' to match sessions without any cloud instance.
Filter by the user who created the agent session
Deprecated; use test_id, which accepts the same full variant id for an exact-version match. Filters by the exact test variant ID stored on the session's startup_params (test authoring sessions only).
Filter test authoring sessions by test id. A bare invariant id (e.g. "abc123") matches sessions for any version of the test; a full variant id including the version (e.g. "abc123:2") matches only that version. Matches against startup_params.test_variant_id, which is stored as "<invariant_id>:<version>". Combine with other filters (AND semantics).
Filter test authoring sessions by the mabl branch they operate on, matching startup_params.branch_id exactly. The branch a session edits on is recorded at session creation, so this returns only the sessions that authored changes on that branch (not every session for the branch's tests). Combine with other filters (AND semantics).
Origin of an agent session — who or what initiated it. user_web, user_mcp, user_cli distinguish the human-driven entry point. auto_tra marks sessions automatically started by the Test Recovery Agent (runtime recovery). user_tra marks edits the user explicitly accepted from a TRA suggestion. unknown is used when no source was provided.
Filter by the source attribution stored on the session's startup_params. Use this together with test_variant_id to dedup auto-triggered edit sessions.
The limit to use for pagination
The cursor to use for pagination
Filter by the test run recorded on the session's startup_params, matching startup_params.test_run_id exactly. Requires agent_types (or the deprecated agent_type); a run lookup with no type filter is rejected with a 400, because the match is against startup_params JSON with no index behind it and would scan the workspace's whole session range. Any session type that records a test_run_id matches, so the type filter is also what scopes the lookup to one agent. Combine with other filters (AND semantics).
Response
Query results