Get Task Analytics
GET /agent-tasks/analytics
Get comprehensive analytics and performance metrics for your agent task executions, including success rates, average duration, and more.
Your API key for authentication
Query Parameters
Filter analytics by specific agent ID
Start date for analytics period (ISO 8601 format)
End date for analytics period (ISO 8601 format)
Time granularity for analytics: “hour”, “day”, “week”, “month”
Response
Total number of tasks executed in the specified period
Number of successfully completed tasks
Success rate as a percentage (0-100)
Average task duration in seconds
Total execution time across all tasks in seconds
Time-series data for task execution metrics
ISO 8601 timestamp for this data point
Number of tasks in this time period
Number of successful tasks
Average duration for tasks in this period
Example Request
curl -X GET "https://api.beamstudio.ai/agent-tasks/analytics?agentId=agent_123456&granularity=day" \
-H "x-api-key: your-api-key" \
-H "current-workspace-id: your-workspace-id"
Example Response
{
"totalTasks": 1250,
"completedTasks": 1180,
"failedTasks": 70,
"successRate": 94.4,
"averageDuration": 45.2,
"totalDuration": 56500,
"timeSeries": [
{
"timestamp": "2024-03-20T00:00:00Z",
"taskCount": 150,
"successCount": 142,
"failureCount": 8,
"avgDuration": 43.5
},
{
"timestamp": "2024-03-21T00:00:00Z",
"taskCount": 175,
"successCount": 168,
"failureCount": 7,
"avgDuration": 46.2
}
]
}
Use Cases
Track agent performance over time to identify trends and optimization opportunities.
Resource Planning
Use duration and volume metrics to plan infrastructure and capacity.
Quality Assurance
Monitor success rates to ensure agents are performing reliably.
Cost Optimization
Analyze task execution patterns to optimize usage and reduce costs.