Get email response time statistics
curl --request GET \
--url http://localhost:2000/email-meter/stats/response-times/{startDate}/{endDate} \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:2000/email-meter/stats/response-times/{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/response-times/{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/response-times/{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/response-times/{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/response-times/{startDate}/{endDate}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:2000/email-meter/stats/response-times/{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": "",
"data": {
"first": {
"min": 0.5,
"max": 24,
"average": 4.2,
"median": 3.9
},
"overall": {
"min": 0.3,
"max": 26.5,
"average": 5.8,
"median": 5
},
"sla": {
"withinSLA": 180,
"afterSLA": 20,
"percentage": 90
}
}
}Email Statistics
Email Response Time Statistics
Returns detailed response time metrics for emails within the specified date range. - Includes both first response and overall response time statistics. - Also reports SLA(Service Level Agreement currently 15 mins) compliance breakdown (responses within SLA vs. after SLA). - If no/invalid startDate or endDate is provided, the system defaults to the last 7 days (a week from today).
GET
/
email-meter
/
stats
/
response-times
/
{startDate}
/
{endDate}
Get email response time statistics
curl --request GET \
--url http://localhost:2000/email-meter/stats/response-times/{startDate}/{endDate} \
--header 'Authorization: Bearer <token>'import requests
url = "http://localhost:2000/email-meter/stats/response-times/{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/response-times/{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/response-times/{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/response-times/{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/response-times/{startDate}/{endDate}")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:2000/email-meter/stats/response-times/{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": "",
"data": {
"first": {
"min": 0.5,
"max": 24,
"average": 4.2,
"median": 3.9
},
"overall": {
"min": 0.3,
"max": 26.5,
"average": 5.8,
"median": 5
},
"sla": {
"withinSLA": 180,
"afterSLA": 20,
"percentage": 90
}
}
}Returns detailed response time metrics for emails within the specified date range. Includes both first response and overall response time statistics. Also reports SLA (Service Level Agreement - currently 15 mins) compliance breakdown.
Request
Headers
| Name | Type | Required | Description |
|---|---|---|---|
| Authorization | string | Yes | Bearer token |
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| startDate | string | Yes | Start date for the report (ISO 8601). Defaults to 7 days before today |
| endDate | string | Yes | End date for the report (ISO 8601). Defaults to today |
Parameter Format
- Format:
YYYY-MM-DDTHH:mm:ss.sssZ(ISO 8601) - Timezone: UTC
- Default: Last 7 days if not provided
Response
200 OK - Successfully retrieved response time statistics
{
"message": "",
"data": {
"firstResponse": {
"min": 2,
"max": 180,
"average": 25.5,
"median": 18.2,
"withinSLA": 85,
"outsideSLA": 15
},
"overallResponse": {
"min": 5,
"max": 240,
"average": 45.8,
"median": 38.5,
"withinSLA": 72,
"outsideSLA": 28
}
}
}
400 Bad Request
{
"error": {
"code": "INVALID_DATE_RANGE",
"message": "Invalid date range or malformed request"
}
}
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/response-times/2025-10-01T00:00:00.000Z/2025-10-20T23:59:59.000Z' \
-H 'Authorization: Bearer your-jwt-token'
Data Fields Explained
First Response Metrics
| Field | Type | Description |
|---|---|---|
| min | number | Minimum first response time (minutes) |
| max | number | Maximum first response time (minutes) |
| average | number | Average first response time (minutes) |
| median | number | Median first response time (minutes) |
| withinSLA | integer | Count of responses within 15 minutes |
| outsideSLA | integer | Count of responses after 15 minutes |
Overall Response Metrics
| Field | Type | Description |
|---|---|---|
| min | number | Minimum overall response time (minutes) |
| max | number | Maximum overall response time (minutes) |
| average | number | Average overall response time (minutes) |
| median | number | Median overall response time (minutes) |
| withinSLA | integer | Count of final responses within 15 minutes |
| outsideSLA | integer | Count of final responses after 15 minutes |
SLA Compliance
Current SLA: 15 Minutes
- Within SLA: Response sent within 15 minutes
- Outside SLA: Response sent after 15 minutes
- First Response: Time to first reply in conversation
- Overall Response: Time to final resolution
SLA Calculations
SLA Compliance Rate = (withinSLA / (withinSLA + outsideSLA)) * 100
Use Cases
- Service Quality: Monitor email response performance
- SLA Reporting: Track compliance with service level agreements
- Team Performance: Evaluate agent response times
- Process Improvement: Identify areas needing faster responses
- Customer Satisfaction: Correlate response times with satisfaction
Performance Metrics
Response Time Categories
- Excellent: < 5 minutes
- Good: 5-15 minutes (within SLA)
- Needs Improvement: 15-60 minutes
- Poor: > 60 minutes
Benchmarking
- Compare against industry standards
- Track improvement over time
- Identify peak performance periods
- Monitor team performance trends
Best Practices
- Monitoring: Regularly check SLA compliance
- Alerts: Set up alerts for SLA breaches
- Analysis: Analyze patterns in delayed responses
- Training: Use data for agent training
- Optimization: Identify bottlenecks in response process
Related Endpoints
- Use
/email-meter/stats/agents-detailedfor agent-specific response times - Use
/email-meter/stats/hourly-trendsfor time-of-day analysis - Use
/email-meter/stats/clients/response-timesfor client-specific analysis
Notes
- All response times are calculated in minutes
- Times are based on business hours by default
- Weekends and holidays may be excluded based on configuration
- Automated responses are excluded from calculations
- Response times include only human-to-human interactions
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Start date for the report (ISO 8601 format).
End date for the report (ISO 8601 format).
Was this page helpful?