Get high-level agent performance statistics
curl --request GET \
--url http://localhost:2000/email-meter/stats/agents-highlevel/{startDate}/{endDate} \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:2000/email-meter/stats/agents-highlevel/{startDate}/{endDate}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:2000/email-meter/stats/agents-highlevel/{startDate}/{endDate}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "2000",
CURLOPT_URL => "http://localhost:2000/email-meter/stats/agents-highlevel/{startDate}/{endDate}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:2000/email-meter/stats/agents-highlevel/{startDate}/{endDate}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:2000/email-meter/stats/agents-highlevel/{startDate}/{endDate}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:2000/email-meter/stats/agents-highlevel/{startDate}/{endDate}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "<string>",
"data": {
"agentAssignmentTimes": {
"first": {
"min": 0.5,
"max": 26.5,
"average": 4.2,
"median": 3.9,
"count": 200
},
"overall": {
"min": 0.5,
"max": 26.5,
"average": 4.2,
"median": 3.9,
"count": 200
}
},
"agentsCount": {
"min": 0.5,
"max": 26.5,
"average": 4.2,
"median": 3.9,
"count": 200
}
}
}Agent Analytics
Agent Performance Summary
Retrieves high-level metrics for agent performance and email assignment efficiency within the given date range. - Includes statistics on time to assign agents and number of agents per conversation. - If no startDate or endDate is provided, defaults to the last 7 days (a week from today).
GET
/
email-meter
/
stats
/
agents-highlevel
/
{startDate}
/
{endDate}
Get high-level agent performance statistics
curl --request GET \
--url http://localhost:2000/email-meter/stats/agents-highlevel/{startDate}/{endDate} \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:2000/email-meter/stats/agents-highlevel/{startDate}/{endDate}"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('http://localhost:2000/email-meter/stats/agents-highlevel/{startDate}/{endDate}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "2000",
CURLOPT_URL => "http://localhost:2000/email-meter/stats/agents-highlevel/{startDate}/{endDate}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "http://localhost:2000/email-meter/stats/agents-highlevel/{startDate}/{endDate}"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("http://localhost:2000/email-meter/stats/agents-highlevel/{startDate}/{endDate}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:2000/email-meter/stats/agents-highlevel/{startDate}/{endDate}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"message": "<string>",
"data": {
"agentAssignmentTimes": {
"first": {
"min": 0.5,
"max": 26.5,
"average": 4.2,
"median": 3.9,
"count": 200
},
"overall": {
"min": 0.5,
"max": 26.5,
"average": 4.2,
"median": 3.9,
"count": 200
}
},
"agentsCount": {
"min": 0.5,
"max": 26.5,
"average": 4.2,
"median": 3.9,
"count": 200
}
}
}Retrieves high-level metrics for agent performance and email assignment efficiency within the given date range. Includes statistics on time to assign agents and number of agents per conversation.
Request
Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | Bearer token |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| startDate | string | Yes | Start date of the range (ISO 8601). Defaults to 7 days before today |
| endDate | string | Yes | End date of the range (ISO 8601). Defaults to today |
Parameter Format
- Format:
YYYY-MM-DD(ISO 8601 date) - Timezone: UTC
- Default: Last 7 days if not provided
Response
200 OK - Successfully retrieved agent high-level statistics
{
"message": "",
"data": {
"agentAssignmentTimes": {
"first": {
"min": 1,
"max": 45,
"average": 8.5,
"median": 6.2
},
"overall": {
"min": 2,
"max": 120,
"average": 15.8,
"median": 12.5
}
},
"agentsCount": {
"min": 1,
"max": 5,
"average": 1.8,
"median": 1
}
}
}
401 Unauthorized
{
"error": {
"code": "UNAUTHORIZED",
"message": "Missing or invalid token"
}
}
500 Internal Server Error
{
"error": {
"code": "SERVER_ERROR",
"message": "Internal server error"
}
}
Example
curl -X GET 'http://localhost:2000/email-meter/stats/agents-highlevel/2025-10-01/2025-10-07' \
-H 'Authorization: oBearerBearer your-jwt-token'
'
Data Fields Explained
Agent Assignment Times
| Field | Type | Description |
|---|---|---|
| first | object | Time to assign first agent (minutes) |
| overall | object | Time to complete all assignments (minutes) |
Assignment Time Metrics
| Field | Type | Description |
|---|---|---|
| min | number | Minimum assignment time (minutes) |
| max | number | Maximum assignment time (minutes) |
| average | number | Average assignment time (minutes) |
| median | number | Median assignment time (minutes) |
Agents Count
| Field | Type | Description |
|---|---|---|
| min | number | Minimum agents per conversation |
| max | number | Maximum agents per conversation |
| average | number | Average agents per conversation |
| median | number | Median agents per conversation |
Performance Metrics
Assignment Efficiency
- Excellent: < 5 minutes to first assignment
- Good: 5-10 minutes to first assignment
- Needs Improvement: 10-20 minutes
- Poor: > 20 minutes
Agent Utilization
- Optimal: 1-2 agents per conversation
- Collaborative: 2-3 agents per conversation
- Overstaffed: > 3 agents per conversation
- Understaffed: Consistent 1 agent with long assignments
Use Cases
- Team Performance: Monitor agent assignment efficiency
- Resource Planning: Optimize agent allocation
- Process Improvement: Identify bottlenecks in assignment
- Quality Assurance: Ensure timely agent responses
- Capacity Analysis: Understand agent workload distribution
Analysis Examples
Assignment Performance
const assignmentPerformance = {
excellent: data.data.agentAssignmentTimes.first.average < 5,
good: data.data.agentAssignmentTimes.first.average >= 5 &&
data.data.agentAssignmentTimes.first.average < 10,
needsImprovement: data.data.agentAssignmentTimes.first.average >= 10
};
Workload Distribution
const workloadDistribution = {
optimal: data.data.agentsCount.average <= 2,
collaborative: data.data.agentsCount.average > 2 &&
data.data.agentsCount.average <= 3,
overstaffed: data.data.agentsCount.average > 3
};
Best Practices
- Monitoring: Track assignment times regularly
- Alerts: Set up alerts for slow assignments
- Balancing: Distribute workload evenly across agents
- Training: Use data for agent performance training
- Optimization: Continuously improve assignment processes
Performance Targets
Assignment Time Targets
- First Assignment: < 10 minutes (80% of conversations)
- Complete Assignment: < 20 minutes (90% of conversations)
- Maximum Time: < 60 minutes (99% of conversations)
Agent Count Targets
- Average: 1.5-2.5 agents per conversation
- Maximum: < 5 agents per conversation
- Consistency: Low variance in agent counts
Related Endpoints
- Use
/email-meter/stats/agents-detailedfor per-agent statistics - Use
/email-meter/stats/response-timesfor overall response metrics - Use
/email-meter/stats/resolved-timesfor resolution analysis
Notes
- Assignment times are calculated from email receipt to agent assignment
- Times exclude automated assignments and routing
- Only human agent assignments are included
- Business hours are considered by default
- Weekends and holidays may affect average times
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Start date of the range (ISO 8601). Defaults to 7 days before today if not provided.
End date of the range (ISO 8601). Defaults to today if not provided.
Was this page helpful?