Analytics API
Analytics endpoints provide visibility into agent and app activity.
Endpoints
GET /analytics/agent-stats
GET Get agent performance statistics for the current user's data.
curl -X GET "https://api.ofself.ai/api/v1/analytics/agent-stats" \
-H "X-API-Key: your-api-key" \
-H "X-User-ID: user-123"
Response: 200 OK
{
"agent_stats": [
{
"agent_id": "agent_001",
"agent_name": "Memory Extractor",
"total_contributions": 150,
"nodes_affected": 45,
"avg_confidence": 0.88,
"active_contributions": 120,
"superseded_contributions": 30,
"first_contribution": "2024-01-01T10:00:00Z",
"last_contribution": "2024-01-15T14:30:00Z"
}
],
"total_agents": 3
}
GET /analytics/history-stats
GET Get history and contribution statistics overview.
curl -X GET "https://api.ofself.ai/api/v1/analytics/history-stats" \
-H "X-API-Key: your-api-key" \
-H "X-User-ID: user-123"
Response: 200 OK
{
"history_stats": {
"total_history_records": 1250,
"nodes_with_history": 300
},
"contribution_stats": {
"total_contributions": 850,
"agent_contributions": 700,
"user_contributions": 150
},
"session_stats": {
"total_sessions": 25,
"completed_sessions": 23,
"success_rate": 92.0
}
}
GET /third-party/:third_party_id/metrics
GET Get API usage metrics for a third-party app.
curl -X GET "https://api.ofself.ai/api/v1/third-party/app-uuid/metrics" \
-H "X-API-Key: your-api-key"
Response: 200 OK
Returns metrics including request counts, endpoints used, and usage patterns for the specified third-party app.