Read a session's transcript

GET/o/{org}/p/{project}/sessions/{session}/messages
View .md

The captured transcript as normalized events, filtered and sliced on the server. A turn starts at each user message; first/last keep that many turns, then include/exclude filter by role. Available once the run has captured its transcript; before that the answer is 404.

Authenticate with an org API key or a signed-in session.

Path parameters

orgstringrequired

The org's slug or id. A caller with no role in the org gets 404.

projectstringrequired

A Project's handle (name) or id, resolved inside {org} — OR the reserved sentinel _ meaning "no Project" (a direct-repo / repo-less dispatch on POST; "no Project constraint, resolve by session id alone" everywhere else). A real handle that doesn't match the session's actual Project is 404.

sessionstringrequired

The session's full id (execution_id).

Query parameters

includestringoptional

Comma-separated roles to keep.

excludestringoptional

Comma-separated roles to drop. Not with include.

firstintegeroptional

Keep the first N turns. Not with last.

min 1
lastintegeroptional

Keep the last N turns. Not with first.

min 1

Responses

200The transcript slice.
execution_idstringrequired
agentstring | nullrequired
formatstringrequired

The transcript format: claude, codex, opencode, rush or opaque.

event_countintegerrequired
eventsarray of SessionEventrequired
19 item fields
typestringrequired
One ofmessagetool_usetool_resultthinkingerrorinitresultusageattachmenthook
agentstringrequired
One ofclaudecodexrushopencodeopaque
timestampstringrequired
rolestringoptional
One ofuserassistant
contentstringoptional
toolstringoptional
callIdstringoptional

Links a tool_use to its tool_result.

argsobjectoptional
pathstringoptional
commandstringoptional
successbooleanoptional
outputstringoptional
modelstringoptional
inputTokensintegeroptional
outputTokensintegeroptional
cacheReadTokensintegeroptional
cacheCreationTokensintegeroptional
mediaTypestringoptional
sizeBytesintegeroptional
400A bad filter (an unknown role, include with exclude, or first with last).
errorstringoptional

A sentence for a person.

codestringoptional

Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, PLAN_REQUIRED.

error_codestringoptional

The machine code on routes that name it this way.

messagestringoptional
requestIdstringoptional
401No bearer, an unknown, revoked or expired one, or an API key on a route keys cannot call.
errorstringoptional

A sentence for a person.

codestringoptional

Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, PLAN_REQUIRED.

error_codestringoptional

The machine code on routes that name it this way.

messagestringoptional
requestIdstringoptional
404No such resource for the caller, including one that exists in an org the caller cannot see.
errorstringoptional

A sentence for a person.

codestringoptional

Stable machine code, e.g. AUTH_FAILED, NOT_FOUND, VALIDATION_ERROR, RATE_LIMITED, PLAN_REQUIRED.

error_codestringoptional

The machine code on routes that name it this way.

messagestringoptional
requestIdstringoptional