Aller au contenu

Lister les sessions d’un agent

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

Fenêtre de terminal
curl --fail-with-body -X GET 'https://app.openlatch.ai/api/public/v1/agents/<agent_id>/sessions' \
-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.
ParamètreTypeDescription
pageinteger
page_sizeinteger
qstring or nullFree-text search (case-insensitive). Matches display_name, native_session_id, initial_prompt, and session_id (prefix match on the UUID). Excludes orphan rows.
statusstring — one of active, idle, offline or nullStatus filter, derived from last_event_at: active <5min, idle 5min-24h, offline >24h.
fromstring (date-time) or nullInclusive lower bound on last_event_at (ISO 8601).
tostring (date-time) or nullInclusive upper bound on last_event_at (ISO 8601).
ChampTypeDescription
dataarray of objectObligatoire.
data[].action_mixobjectDomain / file / command action counts rolled up from the agent_action_* tables.
data[].action_mix.commandsinteger
data[].action_mix.domainsinteger
data[].action_mix.filesinteger
data[].agent_display_namestring or nullOwning agent's display name. Populated only by the organization-wide GET /inventory/sessions; null on an agent's own GET /agents/{agent_id}/sessions, where the agent is already known.
data[].agent_idstringObligatoire.
data[].display_namestring or null
data[].event_countinteger
data[].first_event_atstring (date-time)Obligatoire.
data[].initial_promptstring or nullFirst user prompt captured by the ingest normalizer. Redacted + truncated.
data[].intentstring or nullWhat this session was for, in one line. The generated summary's goal when one exists, otherwise the truncated initial_prompt. The same rule resolves the session intent everywhere OpenLatch reports it, so no two reads disagree about when a summary replaces the prompt.
data[].intent_sourcestringWhich of the two intent is: summary (generated), pending (queued, showing the prompt meanwhile) or initial_prompt_fallback. intent is usable text in all three cases; this field records where it came from.
data[].is_orphanboolean
data[].last_event_atstring (date-time)Obligatoire.
data[].native_session_idstringObligatoire.
data[].platformstringObligatoire. Joined from the parent agents row for display convenience
data[].session_idstringObligatoire.
data[].verdicts_24hobjectVerdict counts over the last 24h for an Agent or Session.
data[].verdicts_24h.allowintegerActions the policy allowed
data[].verdicts_24h.askintegerActions the policy sent to Ask
data[].verdicts_24h.blockintegerActions the policy blocked
data[].verdicts_24h.totalintegerTotal events in the 24h window
pageintegerObligatoire.
page_sizeintegerObligatoire.
totalintegerObligatoire.
{
"data": [
{
"action_mix": {
"commands": 0,
"domains": 0,
"files": 0
},
"agent_display_name": "release-bot",
"agent_id": "agt_01jbwa2k1vfrn9y42xhgxhmzj2",
"display_name": "release-bot",
"event_count": 0,
"first_event_at": "2026-01-15T14:32:05Z",
"initial_prompt": "string",
"intent": "string",
"intent_source": "initial_prompt_fallback",
"is_orphan": false,
"last_event_at": "2026-01-15T14:32:05Z",
"native_session_id": "3f6c1a2e-8b4d-4c1f-9a7e-0d5b2c8e4f10",
"platform": "string",
"session_id": "ses_01jbwa2k1vfrn9y42xhgxhmzj2",
"verdicts_24h": {
"allow": 0,
"ask": 0,
"block": 0,
"total": 0
}
}
],
"page": 1,
"page_size": 3,
"total": 3
}