Skip to content

Get a session transcript

GET
/agents/{id}/sessions/{sessionId}
curl --request GET \
--url https://api.somebodyai.co/api/v1/agents/507f1f77bcf86cd799439011/sessions/sess-abc \
--header 'Authorization: Bearer <token>'

Returns the full transcript for one session of the agent.

id
required

Agent ObjectId

string
/^[a-fA-F0-9]{24}$/

Agent ObjectId

sessionId
required

Session id

string

Session id

Session detail

Media typeapplication/json
object
sessionId
required
string
startedAt
required
string
endedAt
required
string
durationMs
required
number
turnCount
required
number
firstUserMessage
required
string
learner

The learner an LMS launched the session for, limited by the agent's learnerIdentity setting

object
id
string
name
string
lms
object
mode
string
credit
string
entry
string
priorStatus
string
language
string
host
string
scoUrl
string
referrer
string
exportLabel
string
grade

The roleplay score, from the in-call assessment or the grader after the role-play

object
score
required
number
maxScore
required
number
passed

Whether the learner passed: the assessment's own result, else the agent's passing score; absent when neither sets one

boolean
turns
required
Array<object>
object
messageId
required
string
role
required
string
Allowed values: user assistant system tool
text
required
string
timestamp
required
string
tool

The call a tool turn recorded, with secret-looking and visitor-typed values redacted

object
name
required
string
callId
string
arguments
object
key
additional properties
result

A summary string or the JSON returned

ok
boolean
error
string
export

The package the session was launched from

object
label
string
agentRevisionId
string
adapterVersion
string
runtime
object
inputMode
string
Allowed values: voice text
textFallback
boolean
reconnects
integer
timezone
string
device
string
Allowed values: desktop mobile tablet
agentRevisionId

The agent revision live for the session: the one the runtime was served, else the latest when the transcript was stored

string
Example
{
"sessionId": "sess-abc",
"startedAt": "2026-07-13T15:42:00.000Z",
"endedAt": "2026-07-13T15:45:20.000Z",
"durationMs": 200000,
"turnCount": 14,
"firstUserMessage": "how do I reset my password",
"learner": {
"id": "s-10442",
"name": "Ada Lovelace"
},
"exportLabel": "Sales onboarding, cohort 3",
"grade": {
"score": 7,
"maxScore": 10
},
"turns": [
{
"messageId": "3f1a2b4c-1111-2222-3333-444455556666",
"role": "user",
"timestamp": "2026-07-13T15:42:01.000Z",
"tool": {
"name": "scroll_to",
"arguments": {
"anchor": "pricing"
}
}
}
],
"runtime": {
"inputMode": "voice",
"device": "desktop"
}
}

Unauthorized - missing or invalid auth

Media typeapplication/json
object
error
required
string
details
Array<string>
Example
{
"error": "Resource not found",
"details": [
"Field is required"
]
}

Resource not found

Media typeapplication/json
object
error
required
string
details
Array<string>
Example
{
"error": "Resource not found",
"details": [
"Field is required"
]
}