Skip to content

Summarize an agent's sessions

GET/api/public/v1/agents/{agent_id}/sessions/summary

Returns four aggregates scoped to a single agent: total lifetime sessions, sessions active in the last 30 minutes, mean actions per session, and the single longest session's action count. Empty agents (no sessions) return all zeros, not 404.

Terminal window
curl --fail-with-body -X GET 'https://app.openlatch.ai/api/public/v1/agents/<agent_id>/sessions/summary' \
-H "Authorization: Bearer $OPENLATCH_API_KEY"
Role in the organizationThis endpoint
ownerAllowed
adminAllowed
editorAllowed
viewerAllowed

A key carries the role its owner holds in the organization. See Authentication.

API key scope: agents:read

ParameterTypeDescription
agent_idstringRequired.
FieldTypeDescription
active_nowintegerSessions whose last_event_at is within the last 30 minutes.
avg_actions_per_sessionnumberMean event_count across every session for the agent (rounded to 1 decimal).
daily_action_countsarray of integerSummed event_count across every session for each of the last 7 UTC days, oldest first. Feeds the actions-per-session sparkline.
daily_session_countsarray of integerNumber of sessions whose first_event_at lands on each of the last 7 UTC days, oldest first.
longest_session_actionsintegerHighest event_count across every session for the agent.
total_sessionsinteger
{
"active_now": 0,
"avg_actions_per_session": 0,
"daily_action_counts": [
3
],
"daily_session_counts": [
3
],
"longest_session_actions": 0,
"total_sessions": 0
}