Aller au contenu

Résumer les sessions d’un agent

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.

Fenêtre de terminal
curl --fail-with-body -X GET 'https://app.openlatch.ai/api/public/v1/agents/<agent_id>/sessions/summary' \
-H "Authorization: Bearer $OPENLATCH_API_KEY"
Rôle dans l’organisationCe point de terminaison
ownerAutorisé
adminAutorisé
editorAutorisé
viewerAutorisé

Une clé porte le rôle que son propriétaire détient dans l’organisation. Voir Authentification.

Portée de clé d’API : agents:read

ParamètreTypeDescription
agent_idstringObligatoire.
ChampTypeDescription
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
}