Metrics Summary
curl --request GET \
--url https://api.getdoppel.ai/api/v1/api/v1/metrics/summary \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.getdoppel.ai/api/v1/api/v1/metrics/summary"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.getdoppel.ai/api/v1/api/v1/metrics/summary', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.getdoppel.ai/api/v1/api/v1/metrics/summary",
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 := "https://api.getdoppel.ai/api/v1/api/v1/metrics/summary"
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("https://api.getdoppel.ai/api/v1/api/v1/metrics/summary")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getdoppel.ai/api/v1/api/v1/metrics/summary")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"total_interactions": 123,
"total_calls": 123,
"total_conversations": 123,
"inbound_count": 123,
"outbound_count": 123,
"avg_duration_seconds": 123,
"total_duration_seconds": 123,
"success_rate": 123,
"appointments_scheduled": 123
}
}Metrics
Metrics Summary
Get aggregated KPIs and summary statistics
GET
/
api
/
v1
/
metrics
/
summary
Metrics Summary
curl --request GET \
--url https://api.getdoppel.ai/api/v1/api/v1/metrics/summary \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.getdoppel.ai/api/v1/api/v1/metrics/summary"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://api.getdoppel.ai/api/v1/api/v1/metrics/summary', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.getdoppel.ai/api/v1/api/v1/metrics/summary",
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 := "https://api.getdoppel.ai/api/v1/api/v1/metrics/summary"
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("https://api.getdoppel.ai/api/v1/api/v1/metrics/summary")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getdoppel.ai/api/v1/api/v1/metrics/summary")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"success": true,
"data": {
"total_interactions": 123,
"total_calls": 123,
"total_conversations": 123,
"inbound_count": 123,
"outbound_count": 123,
"avg_duration_seconds": 123,
"total_duration_seconds": 123,
"success_rate": 123,
"appointments_scheduled": 123
}
}Metrics Summary
Returns aggregated key performance indicators (KPIs) for your interactions. This endpoint provides a high-level overview of your call and conversation volumes, success rates, and other important metrics.Request
GET https://api.getdoppel.ai/api/v1/metrics/summary
Headers
| Header | Required | Description |
|---|---|---|
Authorization | Yes | Bearer token with your API key |
Query Parameters
| Parameter | Type | Default | Description |
|---|---|---|---|
date_from | string | 30 days ago | Start date (ISO 8601) |
date_to | string | Today | End date (ISO 8601) |
clinic_id | string | - | Filter by clinic UUID |
channel | string | - | Filter by channel: voice or whatsapp |
Response
boolean
Whether the request was successful
object
Show properties
Show properties
integer
Total number of interactions in the period
integer
Total voice calls
integer
Total WhatsApp conversations
integer
Total inbound interactions
integer
Total outbound interactions
number
Average call duration in seconds
integer
Total call duration in seconds
number
Percentage of successful outcomes (0-100)
integer
Number of appointments scheduled
Examples
Basic Request
curl -X GET "https://api.getdoppel.ai/api/v1/metrics/summary" \
-H "Authorization: Bearer dpl_live_YOUR_API_KEY"
const response = await fetch('https://api.getdoppel.ai/api/v1/metrics/summary', {
headers: {
'Authorization': 'Bearer dpl_live_YOUR_API_KEY'
}
});
const data = await response.json();
import requests
response = requests.get(
'https://api.getdoppel.ai/api/v1/metrics/summary',
headers={'Authorization': 'Bearer dpl_live_YOUR_API_KEY'}
)
data = response.json()
With Date Range
curl -X GET "https://api.getdoppel.ai/api/v1/metrics/summary?date_from=2024-01-01&date_to=2024-12-31" \
-H "Authorization: Bearer dpl_live_YOUR_API_KEY"
const response = await fetch(
'https://api.getdoppel.ai/api/v1/metrics/summary?date_from=2024-01-01&date_to=2024-12-31',
{
headers: {
'Authorization': 'Bearer dpl_live_YOUR_API_KEY'
}
}
);
import requests
response = requests.get(
'https://api.getdoppel.ai/api/v1/metrics/summary',
params={
'date_from': '2024-01-01',
'date_to': '2024-12-31'
},
headers={'Authorization': 'Bearer dpl_live_YOUR_API_KEY'}
)
Filter by Channel
Get metrics for voice calls only:curl -X GET "https://api.getdoppel.ai/api/v1/metrics/summary?channel=voice" \
-H "Authorization: Bearer dpl_live_YOUR_API_KEY"
const response = await fetch(
'https://api.getdoppel.ai/api/v1/metrics/summary?channel=voice',
{
headers: {
'Authorization': 'Bearer dpl_live_YOUR_API_KEY'
}
}
);
import requests
response = requests.get(
'https://api.getdoppel.ai/api/v1/metrics/summary',
params={'channel': 'voice'},
headers={'Authorization': 'Bearer dpl_live_YOUR_API_KEY'}
)
Response Example
{
"success": true,
"data": {
"total_interactions": 1250,
"total_calls": 800,
"total_conversations": 450,
"inbound_count": 500,
"outbound_count": 750,
"avg_duration_seconds": 180.5,
"total_duration_seconds": 144400,
"success_rate": 72.5,
"appointments_scheduled": 320
},
"request_id": "req_abc123xyz",
"timestamp": "2024-01-15T10:30:00.000Z"
}
Use Cases
Dashboard Overview
Build a KPI dashboard showing key metrics:async function getDashboardMetrics(apiKey) {
const response = await fetch(
'https://api.getdoppel.ai/api/v1/metrics/summary',
{
headers: { 'Authorization': `Bearer ${apiKey}` }
}
);
const { data } = await response.json();
return {
totalInteractions: data.total_interactions,
successRate: `${data.success_rate}%`,
appointmentsBooked: data.appointments_scheduled,
avgCallDuration: `${Math.round(data.avg_duration_seconds / 60)} min`
};
}
Monthly Reports
Generate monthly comparison reports:import requests
from datetime import datetime, timedelta
def get_monthly_metrics(api_key, year, month):
# Calculate month boundaries
start_date = f"{year}-{month:02d}-01"
if month == 12:
end_date = f"{year + 1}-01-01"
else:
end_date = f"{year}-{month + 1:02d}-01"
response = requests.get(
'https://api.getdoppel.ai/api/v1/metrics/summary',
params={
'date_from': start_date,
'date_to': end_date
},
headers={'Authorization': f'Bearer {api_key}'}
)
return response.json()['data']
# Compare Q4 months
for month in [10, 11, 12]:
metrics = get_monthly_metrics('dpl_live_YOUR_API_KEY', 2024, month)
print(f"Month {month}: {metrics['appointments_scheduled']} appointments")
Related Endpoints
Outcome Breakdown
Get detailed breakdown of outcomes.
Daily Metrics
Get day-by-day time series data.