List a session's executions
Read a session's executions, newest first, one page at a time. Useful for a tool call hook that needs more of the session than its request carries.
/api/v1/sessions/:sessionId/executionsconst response = await fetch("https://api.smallworld.sh/api/v1/sessions/01995e57-0501-76b8-b797-5b24df5b307f/executions?limit=20", {
method: "GET",
headers: { Authorization: `Bearer ${apiKey}` },
});
if (!response.ok) throw new Error(`HTTP ${response.status}: ${await response.text()}`);
const result = await response.json();
Use your server-side apiKey. Replace the example IDs.
Path parameters#
sessionIdUUIDrequiredThe session ID returned in session.id.
Query parameters#
cursorstringThe opaque nextCursor from a previous page of this same list and session. Omit for the first page.
limitintegerNumber of items to return, from 1 to 50. Defaults to 20.
Responses#
Returns items and nextCursor. Each execution has id, sessionId, command, status (requires_approval, running, completed, timed_out, or interrupted), exitCode, stdout, stdoutTruncated, stderr, stderrTruncated, errorCode, createdAt, and completedAt. stdout and stderr are null while the execution runs and are cut at 16 KB each, with their flag set when cut. Items leave out file changes, mount changes, and tool calls.
{
"items": [
{
"id": "01995e57-3027-7557-a233-009ea3dcd8fc",
"sessionId": "01995e57-0501-76b8-b797-5b24df5b307f",
"command": "echo 'Hello from Smallworld'",
"status": "completed",
"exitCode": 0,
"stdout": "Hello from Smallworld\n",
"stdoutTruncated": false,
"stderr": "",
"stderrTruncated": false,
"errorCode": null,
"createdAt": "2026-10-10T12:00:00.000Z",
"completedAt": "2026-10-10T12:00:01.000Z"
}
],
"nextCursor": null
}
More about this endpoint
Items are newest first. Pass nextCursor to read older items; it is null on the final page.
A cursor works only for the list and session that returned it.
GET /executions/:executionId returns an execution's full output, file changes, mount changes, and tool calls.