API / Call statistics List call statistics GET /api/v1/domains/{domain_uuid}/extension-statistics
Retrieve call statistics for your company’s extensions. Choose a reporting window with the date filters; without a date range, results cover the current day in your company’s local time zone.
Request example Responses Path parameters domain_uuidstring required
Your company ID supplied by Junction Cloud Connections. Use the same ID throughout your requests.
Query parameters limitinteger
Optional. Number of results to return (min 1, max 100). Defaults to 50.
starting_afterstring
Optional. Return results after this extension UUID.
searchstring
Optional. Search extension number, label, and related call fields.
date_frominteger
Optional. Start of date range in epoch seconds (UTC).
date_tointeger
Optional. End of date range in epoch seconds (UTC).
Responses 200 Successdataarray[object]
Show nested fields total_duration_secondsinteger
total_duration_formattedstring
total_talk_time_secondsinteger
total_talk_time_formattedstring
average_duration_secondsinteger
average_duration_formattedstring
400 Invalid date rangeerrorobject
Show nested fields 401 Unauthenticatederrorobject
Show nested fields 404 Domain not founderrorobject
Show nested fields Previous Retrieve a call recordNext List active callsREQUEST EXAMPLE Replace the host, token and example IDs with your account details.
curl Node.js Python
curl Copy
curl --request GET \
--url "https://YOUR-PORTAL-HOST/api/v1/domains/YOUR_COMPANY_UUID/extension-statistics?limit=25" \
--header "Authorization: Bearer $JUNCTIONCC_API_TOKEN" \
--header "Accept: application/json"Node.js Copy
const token = process.env.JUNCTIONCC_API_TOKEN;
const response = await fetch("https://YOUR-PORTAL-HOST/api/v1/domains/YOUR_COMPANY_UUID/extension-statistics?limit=25", {
method: "GET",
headers: {
Authorization: `Bearer ${token}`,
Accept: "application/json"
}
});
if (!response.ok) throw new Error(`HTTP ${response.status}`);
const text = await response.text();
console.log(text ? JSON.parse(text) : null);Python Copy
import json
import os
from urllib.request import Request, urlopen
request = Request(
"https://YOUR-PORTAL-HOST/api/v1/domains/YOUR_COMPANY_UUID/extension-statistics?limit=25",
method="GET",
headers={
"Authorization": "Bearer " + os.environ["JUNCTIONCC_API_TOKEN"],
"Accept": "application/json"
}
)
with urlopen(request, timeout=30) as response:
body = response.read()
print(json.loads(body) if body else None)RESPONSE EXAMPLE 200 400 401 404
JSON Copy
{
"object": "list",
"url": "/api/v1/domains/7d58342b-2b29-4dcf-92d6-e9a9e002a4e5/extension-statistics",
"has_more": false,
"data": [
{
"extension_uuid": "c9a76140-0ca4-4ea3-95af-7e12c2ff0df5",
"object": "extension_statistic",
"domain_uuid": "7d58342b-2b29-4dcf-92d6-e9a9e002a4e5",
"extension": "1001",
"extension_label": "Front Desk",
"call_count": 18,
"inbound": 10,
"outbound": 7,
"missed": 1,
"total_duration_seconds": 945,
"total_duration_formatted": "00:15:45",
"total_talk_time_seconds": 945,
"total_talk_time_formatted": "00:15:45",
"average_duration_seconds": 53,
"average_duration_formatted": "00:00:53"
}
]
}JSON Copy
{
"error": {
"type": "invalid_request_error",
"message": "date_from must be less than or equal to date_to.",
"code": "invalid_request",
"param": "date_from"
}
}JSON Copy
{
"error": {
"type": "authentication_error",
"message": "Unauthenticated.",
"code": "unauthenticated"
}
}JSON Copy
{
"error": {
"type": "invalid_request_error",
"message": "Domain not found.",
"code": "resource_missing",
"param": "domain_uuid"
}
}