List Sessions
List a workspace’s sessions, newest first (keyset-paginated).
Ordered created_at DESC, id DESC. Page forward with after set to the
prior response’s next_cursor; has_more signals another page. Each row
is a summary (status, instructions, environment, person, turn counts, key
attribution, accrued credits, timestamps). The per-turn decision trace lives
on the detail GET.
Authorizations
Workspace API key as a bearer token: Authorization: Bearer ish_sk_live_.... Keys are workspace-scoped machine principals minted in Settings > Developers (shown once at mint). Scopes: sessions:run (create a session, submit turns, close), sessions:read (read the session and its decision trace), environments:read and environments:write (manage the workspace's registered environments), tasks:read and tasks:write (manage the workspace's registered tasks), people:read and people:write (the people the workspace can run a session for), and usage:read (the workspace's own consumption, spend limits and rate-limit budgets). A key is minted with sessions:run, sessions:read, and tasks:read by default; every other scope must be requested, people:read and usage:read included. An ish user access token also works on the same header for personal scripts.
Path Parameters
Query Parameters
Filter by session status (repeatable).
open, completed, gave_up, closed, max_turns, spend_cap_reached, balance_exhausted Filter to sessions opened by this API key.
Filter to sessions run in this registered environment. Matches on the environment's id, so a renamed environment still returns its older sessions; sessions opened with an inline environment descriptor have no id and are never matched, and sessions whose environment was since deleted no longer match (their reference is cleared; the frozen snapshot stays on the session).
Filter to sessions pinned to this declared environment version, as resolved at open. Narrower than environment_id and independent of it: a session that ran the same environment UNVERSIONED is never matched.
Filter to sessions bound to this registered task. Matches on the task's id: a renamed task still returns its older sessions, inline-instruction sessions are never matched, and an archived task's sessions keep matching (archive clears nothing; the frozen instructions stays on each session).
Free-text filter: matches a session id by PREFIX or the frozen instructions by case-insensitive substring. One term, no ranking.
200Only sessions created at/after this ISO 8601 instant.
Only sessions created at/before this ISO 8601 instant.
Opaque keyset cursor from a prior page's next_cursor.
1 <= x <= 100Response
Successful Response
A keyset-paginated page of a workspace's sessions.
Ordered created_at DESC, id DESC. next_cursor is an opaque token
(base64 of the last row's keyset); pass it back as after to fetch the
next page, and it is null on the final page. Never an offset: rows keep
inserting, so an offset would skip/duplicate across pages.