Base URL
Create Event
ID of the parent session.
"tool_call", "llm_decision", "state_change", or "error".
Name of the tool called (for tool_call events).
Input passed to the tool.
Output returned by the tool.
Agent’s reasoning for this action.
Other options the agent considered.
Confidence score (0.0 to 1.0).
Cost for this event in USD.
Request
{
"sessionId": "sess_abc123def456",
"eventType": "tool_call",
"toolName": "search_kb",
"toolInput": {
"query": "password reset"
},
"toolOutput": {
"results": ["KB-001", "KB-002"]
},
"reasoning": "User needs password help",
"estimatedCost": 0.001
}
Response
{
"id": "evt_xyz789",
"sessionId": "sess_abc123def456",
"eventType": "tool_call",
"toolName": "search_kb",
"createdAt": "2025-01-12T10:30:01Z"
}
Event Types
Track when your agent calls a tool.
{
"sessionId": "sess_abc123def456",
"eventType": "tool_call",
"toolName": "search_knowledge_base",
"toolInput": {
"query": "how to reset password"
},
"toolOutput": {
"results": ["KB-001", "KB-002"],
"count": 2
},
"reasoning": "User asked about password reset",
"estimatedCost": 0.001
}
llm_decision
Track agent decision points.
{
"sessionId": "sess_abc123def456",
"eventType": "llm_decision",
"reasoning": "User needs password help. Will search KB first before escalating.",
"alternativesConsidered": [
"escalate_to_human",
"ask_clarifying_question"
],
"confidence": 0.92,
"estimatedCost": 0.0015
}
cURL Examples
curl -X POST https://api.sentrial.com/api/sdk/events \
-H "Authorization: Bearer sentrial_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"sessionId": "sess_abc123def456",
"eventType": "tool_call",
"toolName": "search_kb",
"toolInput": {"query": "password reset"},
"toolOutput": {"results": ["KB-001"]}
}'
Decision Event
curl -X POST https://api.sentrial.com/api/sdk/events \
-H "Authorization: Bearer sentrial_live_xxx" \
-H "Content-Type: application/json" \
-d '{
"sessionId": "sess_abc123def456",
"eventType": "llm_decision",
"reasoning": "Will search KB before escalating",
"alternativesConsidered": ["escalate", "clarify"],
"confidence": 0.92
}'
Error Codes
| Code | Title | Description |
|---|
400 | Bad Request | Missing required fields or invalid event type |
401 | Unauthorized | Invalid or missing API key |
404 | Not Found | Session ID not found |
500 | Internal Server Error | Server error, please retry |
Next Steps