# Uses the session's stored agent_session_id automatically
curl "https://app.runtm.com/api/cloud/sessions/ses_abc123/history" \
-H "Authorization: Bearer runtm_xxx"
# Or specify a specific agent session
curl "https://app.runtm.com/api/cloud/sessions/ses_abc123/history?agent_session_id=abc-def-123" \
-H "Authorization: Bearer runtm_xxx"
import requests
response = requests.get(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/history",
headers={"Authorization": "Bearer runtm_xxx"},
)
for event in response.json()["events"]:
print(event)
const response = await fetch(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/history",
{
headers: { "Authorization": "Bearer runtm_xxx" },
}
);
const { events, count } = await response.json();
console.log(`${count} events`);
{
"events": [
{
"type": "assistant",
"message": "I'll set up an Express API with the following structure..."
}
],
"count": 1
}
Prompts
Get History
Retrieve prompt history for a session
GET
/
api
/
sessions
/
{session_id}
/
history
# Uses the session's stored agent_session_id automatically
curl "https://app.runtm.com/api/cloud/sessions/ses_abc123/history" \
-H "Authorization: Bearer runtm_xxx"
# Or specify a specific agent session
curl "https://app.runtm.com/api/cloud/sessions/ses_abc123/history?agent_session_id=abc-def-123" \
-H "Authorization: Bearer runtm_xxx"
import requests
response = requests.get(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/history",
headers={"Authorization": "Bearer runtm_xxx"},
)
for event in response.json()["events"]:
print(event)
const response = await fetch(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/history",
{
headers: { "Authorization": "Bearer runtm_xxx" },
}
);
const { events, count } = await response.json();
console.log(`${count} events`);
{
"events": [
{
"type": "assistant",
"message": "I'll set up an Express API with the following structure..."
}
],
"count": 1
}
Returns the parsed conversation history for a session, including all events from the agent’s JSONL log.
Required scope:
sessions:read
Path Parameters
string
required
The session ID (e.g.
ses_abc123).Query Parameters
string
The Claude CLI session UUID. If omitted, falls back to the session’s stored
agent_session_id. Returns an empty list if neither is available.Headers
string
required
Bearer token. Example:
Bearer runtm_xxxResponse
array
Array of parsed conversation events from the agent’s JSONL log.
integer
Total number of events returned.
# Uses the session's stored agent_session_id automatically
curl "https://app.runtm.com/api/cloud/sessions/ses_abc123/history" \
-H "Authorization: Bearer runtm_xxx"
# Or specify a specific agent session
curl "https://app.runtm.com/api/cloud/sessions/ses_abc123/history?agent_session_id=abc-def-123" \
-H "Authorization: Bearer runtm_xxx"
import requests
response = requests.get(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/history",
headers={"Authorization": "Bearer runtm_xxx"},
)
for event in response.json()["events"]:
print(event)
const response = await fetch(
"https://app.runtm.com/api/cloud/sessions/ses_abc123/history",
{
headers: { "Authorization": "Bearer runtm_xxx" },
}
);
const { events, count } = await response.json();
console.log(`${count} events`);
{
"events": [
{
"type": "assistant",
"message": "I'll set up an Express API with the following structure..."
}
],
"count": 1
}