Analytics
Analytics overview
The summary of a window that ends when you make the request, compared with the previous window of the same size.
GET https://api.diska.ai/v1/analytics/overview
Scope: analytics:read
Daily dates are in UTC.
Parameters
Query string
| Name | Type | Required | Description |
|---|---|---|---|
period | string | No | daily (last 24 hours), weekly (last 7 days) or monthly (last 30 days). Default: weekly. |
agent_id | string | null | No | Only this agent. |
agent_type | string | No | all, inbound or outbound. Default: all. |
Examples
curl "https://api.diska.ai/v1/analytics/overview?period=weekly" \
-H "Authorization: Bearer $DISKA_API_KEY"
import os
import requests
response = requests.get(
"https://api.diska.ai/v1/analytics/overview?period=weekly",
headers={"Authorization": f"Bearer {os.environ['DISKA_API_KEY']}"},
timeout=30,
)
response.raise_for_status()
print(response.json())
// Node.js 18 or later, in a .mjs file
const response = await fetch('https://api.diska.ai/v1/analytics/overview?period=weekly', {
headers: { Authorization: `Bearer ${process.env.DISKA_API_KEY}` }
})
if (!response.ok) throw new Error(`${response.status} ${await response.text()}`)
console.log(await response.json())
<?php
$ch = curl_init('https://api.diska.ai/v1/analytics/overview?period=weekly');
curl_setopt_array($ch, [
CURLOPT_HTTPHEADER => ['Authorization: Bearer ' . getenv('DISKA_API_KEY')],
CURLOPT_RETURNTRANSFER => true,
CURLOPT_TIMEOUT => 30,
]);
$body = curl_exec($ch);
$status = curl_getinfo($ch, CURLINFO_RESPONSE_CODE);
curl_close($ch);
if ($status >= 400) {
throw new RuntimeException("HTTP $status: $body");
}
print_r(json_decode($body, true));
Try it
Send the request from this page, with your key. The key stays on this page: it is not stored and is only sent to api.diska.ai. Use a test key with the fewest scopes you need.
GET
https://api.diska.ai/v1/analytics/overview?period=weeklyStarts with dsk_. It stays in this browser tab only.
query
query
query
Enter an API key (dsk_…).
Response 200
| Field | Type | Description |
|---|---|---|
period | string | Analyzed window. One of: daily, weekly, monthly. Default: weekly. |
start | string | Window start. |
end | string | Window end (when the request was made). |
totals | object | Window totals, compared with the previous one. |
totals.calls | object | Number of calls. |
totals.calls.value | number | Value in the current window. Default: 0. |
totals.calls.previous | number | Value in the previous window. Default: 0. |
totals.calls.change_pct | number | null | Change in percent, or null when the previous window has no data. |
totals.minutes | object | Call minutes. |
totals.minutes.value | number | Value in the current window. Default: 0. |
totals.minutes.previous | number | Value in the previous window. Default: 0. |
totals.minutes.change_pct | number | null | Change in percent, or null when the previous window has no data. |
totals.avg_duration_seconds | object | Average duration in seconds. |
totals.avg_duration_seconds.value | number | Value in the current window. Default: 0. |
totals.avg_duration_seconds.previous | number | Value in the previous window. Default: 0. |
totals.avg_duration_seconds.change_pct | number | null | Change in percent, or null when the previous window has no data. |
daily | array | Day-by-day evolution. |
daily[].date | string | Day, in UTC (YYYY-MM-DD). |
daily[].calls | integer | Calls that day. Default: 0. |
daily[].minutes | number | Minutes that day. Default: 0. |
daily[].completed | integer | Completed calls. Default: 0. |
daily[].failed | integer | Failed calls. Default: 0. |
daily[].cancelled | integer | Cancelled calls. Default: 0. |
by_status | array | Distribution by call state. |
by_status[].key | string | Value (code). |
by_status[].label | string | Readable name. |
by_status[].count | integer | Number of calls. Default: 0. |
by_status[].pct | number | Percent of the total. Default: 0. |
by_end_reason | array | Distribution by end reason. |
by_end_reason[].key | string | Value (code). |
by_end_reason[].label | string | Readable name. |
by_end_reason[].count | integer | Number of calls. Default: 0. |
by_end_reason[].pct | number | Percent of the total. Default: 0. |
sentiment | object | Call sentiment. |
sentiment.positive_pct | object | Percent of positive calls. |
sentiment.positive_pct.value | number | Value in the current window. Default: 0. |
sentiment.positive_pct.previous | number | Value in the previous window. Default: 0. |
sentiment.positive_pct.change_pct | number | null | Change in percent, or null when the previous window has no data. |
sentiment.classified | integer | Calls with a classified sentiment. Default: 0. |
sentiment.total | integer | Total calls. Default: 0. |
sentiment.breakdown | array | Distribution by sentiment. |
sentiment.breakdown[].key | string | Value (code). |
sentiment.breakdown[].label | string | Readable name. |
sentiment.breakdown[].count | integer | Number of calls. Default: 0. |
sentiment.breakdown[].pct | number | Percent of the total. Default: 0. |
sentiment.daily | array | Daily evolution. |
sentiment.daily[].date | string | Day, in UTC (YYYY-MM-DD). |
sentiment.daily[].positive | integer | Positive calls. Default: 0. |
sentiment.daily[].neutral | integer | Neutral calls. Default: 0. |
sentiment.daily[].negative | integer | Negative calls. Default: 0. |
agents | array | Performance per agent. |
agents[].agent_id | string | null | Agent. |
agents[].name | string | Agent name. Default: —. |
agents[].calls | integer | Calls. Default: 0. |
agents[].minutes | number | Minutes. Default: 0. |
agents[].completed | integer | Completed calls. Default: 0. |
agents[].completion_pct | number | Percent of completed calls (technical completion, not a business outcome). Default: 0. |
agents[].completion_change_pct | number | null | Change in completion against the previous window. |
agents[].goal_achieved_pct | number | null | Percent of calls that reached the goal, or null when unknown. |
agents[].calls_change_pct | number | null | Change in calls. |
agents[].minutes_change_pct | number | null | Change in minutes. |
agents[].goal_change_pct | number | null | Change in goal achieved. |
actions | array | Usage of each executed action. |
actions[].tool_name | string | Action (code). |
actions[].label | string | Action name. |
actions[].usage | object | Executions in the window, with the change. |
actions[].usage.value | number | Value in the current window. Default: 0. |
actions[].usage.previous | number | Value in the previous window. Default: 0. |
actions[].usage.change_pct | number | null | Change in percent, or null when the previous window has no data. |
actions[].daily | array | Executions per day. |
actions[].daily[].date | string | Day, in UTC (YYYY-MM-DD). |
actions[].daily[].count | integer | Executions that day. Default: 0. |
failed_calls | array | Recent failed calls. |
failed_calls[].id | string | Call ID. |
failed_calls[].started_at | string | null | Call start. |
failed_calls[].contact | string | null | Caller contact. |
failed_calls[].agent_name | string | null | Agent. |
failed_calls[].end_reason | string | null | Why it failed. |
{
"period": "weekly",
"start": "2026-10-25T18:40:00Z",
"end": "2026-11-01T18:40:00Z",
"totals": {
"calls": {
"value": 42,
"previous": 38,
"change_pct": 10.5
},
"minutes": {
"value": 42,
"previous": 38,
"change_pct": 10.5
},
"avg_duration_seconds": {
"value": 42,
"previous": 38,
"change_pct": 10.5
}
},
"daily": [
{
"date": "2026-10-25",
"calls": 42,
"minutes": 63.5,
"completed": 38,
"failed": 3,
"cancelled": 1
}
],
"by_status": [
{
"key": "completed",
"label": "Concluída",
"count": 38,
"pct": 90.5
}
],
"by_end_reason": [
{
"key": "completed",
"label": "Concluída",
"count": 38,
"pct": 90.5
}
],
"sentiment": {
"positive_pct": {
"value": 42,
"previous": 38,
"change_pct": 10.5
},
"classified": 40,
"total": 1,
"breakdown": [
{
"key": "completed",
"label": "Concluída",
"count": 38,
"pct": 90.5
}
],
"daily": [
{
"date": "2026-10-25",
"positive": 30,
"neutral": 8,
"negative": 2
}
]
},
"agents": [
{
"agent_id": "3f1c2a7e-5b9d-4c1e-8f3a-2d6b7e9c1a40",
"name": "Recepção",
"calls": 42,
"minutes": 63.5,
"completed": 38,
"completion_pct": 90.5,
"completion_change_pct": 0,
"goal_achieved_pct": 0,
"calls_change_pct": 0,
"minutes_change_pct": 0,
"goal_change_pct": 0
}
],
"actions": [
{
"tool_name": "transfer_call",
"label": "Concluída",
"usage": {
"value": 42,
"previous": 38,
"change_pct": 10.5
},
"daily": [
{
"date": "2026-10-25",
"count": 38
}
]
}
],
"failed_calls": [
{
"id": "8d0c6a3e-2f14-4b7a-9c55-1e3f0a6d2b81",
"started_at": "2026-10-25T18:40:00Z",
"contact": "+244900000000",
"agent_name": "Recepção",
"end_reason": "caller_hangup"
}
]
}
Errors
This endpoint has no errors of its own.
Errors common to every endpoint (401, 403, 422, 429 and 5xx) are in Errors.

