Daily Metrics
curl --request GET \
--url https://api.getdoppel.ai/api/v1/api/v1/metrics/daily \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.getdoppel.ai/api/v1/api/v1/metrics/daily"
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/daily', 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/daily",
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/daily"
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/daily")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getdoppel.ai/api/v1/api/v1/metrics/daily")
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": {
"daily": [
{}
]
}
}Metrics
Daily Metrics
Get day-by-day time series metrics
GET
/
api
/
v1
/
metrics
/
daily
Daily Metrics
curl --request GET \
--url https://api.getdoppel.ai/api/v1/api/v1/metrics/daily \
--header 'Authorization: Bearer <token>'import requests
url = "https://api.getdoppel.ai/api/v1/api/v1/metrics/daily"
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/daily', 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/daily",
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/daily"
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/daily")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getdoppel.ai/api/v1/api/v1/metrics/daily")
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": {
"daily": [
{}
]
}
}Daily Metrics
Returns daily time series data for your interactions. Use this endpoint to build trend charts, identify patterns, and track performance over time.Request
GET https://api.getdoppel.ai/api/v1/metrics/daily
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 |
type | string | - | Filter by interaction type |
Response
boolean
Whether the request was successful
Daily Object
| Field | Type | Description |
|---|---|---|
date | string | Date (YYYY-MM-DD) |
total | integer | Total interactions |
calls | integer | Voice calls |
conversations | integer | WhatsApp conversations |
inbound | integer | Inbound interactions |
outbound | integer | Outbound interactions |
appointments_scheduled | integer | Appointments booked |
success_rate | number | Success rate percentage |
avg_duration_seconds | number | Average call duration |
Examples
Basic Request
curl -X GET "https://api.getdoppel.ai/api/v1/metrics/daily" \
-H "Authorization: Bearer dpl_live_YOUR_API_KEY"
const response = await fetch('https://api.getdoppel.ai/api/v1/metrics/daily', {
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/daily',
headers={'Authorization': 'Bearer dpl_live_YOUR_API_KEY'}
)
data = response.json()
Get Last 7 Days
curl -X GET "https://api.getdoppel.ai/api/v1/metrics/daily?date_from=2024-12-29&date_to=2025-01-05" \
-H "Authorization: Bearer dpl_live_YOUR_API_KEY"
// Calculate dates
const today = new Date();
const weekAgo = new Date(today);
weekAgo.setDate(weekAgo.getDate() - 7);
const params = new URLSearchParams({
date_from: weekAgo.toISOString().split('T')[0],
date_to: today.toISOString().split('T')[0]
});
const response = await fetch(
`https://api.getdoppel.ai/api/v1/metrics/daily?${params}`,
{
headers: {
'Authorization': 'Bearer dpl_live_YOUR_API_KEY'
}
}
);
import requests
from datetime import datetime, timedelta
today = datetime.now()
week_ago = today - timedelta(days=7)
response = requests.get(
'https://api.getdoppel.ai/api/v1/metrics/daily',
params={
'date_from': week_ago.strftime('%Y-%m-%d'),
'date_to': today.strftime('%Y-%m-%d')
},
headers={'Authorization': 'Bearer dpl_live_YOUR_API_KEY'}
)
Filter by Channel
Get daily metrics for voice calls only:curl -X GET "https://api.getdoppel.ai/api/v1/metrics/daily?channel=voice" \
-H "Authorization: Bearer dpl_live_YOUR_API_KEY"
const response = await fetch(
'https://api.getdoppel.ai/api/v1/metrics/daily?channel=voice',
{
headers: {
'Authorization': 'Bearer dpl_live_YOUR_API_KEY'
}
}
);
import requests
response = requests.get(
'https://api.getdoppel.ai/api/v1/metrics/daily',
params={'channel': 'voice'},
headers={'Authorization': 'Bearer dpl_live_YOUR_API_KEY'}
)
Response Example
{
"success": true,
"data": {
"daily": [
{
"date": "2024-12-29",
"total": 45,
"calls": 30,
"conversations": 15,
"inbound": 20,
"outbound": 25,
"appointments_scheduled": 12,
"success_rate": 71.1,
"avg_duration_seconds": 175
},
{
"date": "2024-12-30",
"total": 52,
"calls": 35,
"conversations": 17,
"inbound": 22,
"outbound": 30,
"appointments_scheduled": 15,
"success_rate": 73.5,
"avg_duration_seconds": 182
},
{
"date": "2024-12-31",
"total": 28,
"calls": 18,
"conversations": 10,
"inbound": 12,
"outbound": 16,
"appointments_scheduled": 8,
"success_rate": 68.2,
"avg_duration_seconds": 165
},
{
"date": "2025-01-01",
"total": 15,
"calls": 10,
"conversations": 5,
"inbound": 8,
"outbound": 7,
"appointments_scheduled": 4,
"success_rate": 66.7,
"avg_duration_seconds": 155
},
{
"date": "2025-01-02",
"total": 58,
"calls": 40,
"conversations": 18,
"inbound": 25,
"outbound": 33,
"appointments_scheduled": 18,
"success_rate": 75.2,
"avg_duration_seconds": 190
}
]
},
"request_id": "req_abc123xyz",
"timestamp": "2025-01-05T10:30:00.000Z"
}
Use Cases
Build a Trend Chart
Use the daily data to create visualizations:async function getChartData(apiKey, days = 30) {
const today = new Date();
const startDate = new Date(today);
startDate.setDate(startDate.getDate() - days);
const response = await fetch(
`https://api.getdoppel.ai/api/v1/metrics/daily?date_from=${startDate.toISOString().split('T')[0]}&date_to=${today.toISOString().split('T')[0]}`,
{
headers: { 'Authorization': `Bearer ${apiKey}` }
}
);
const { data } = await response.json();
// Format for charting libraries (Chart.js, Recharts, etc.)
return {
labels: data.daily.map(d => d.date),
datasets: [
{
label: 'Total Interactions',
data: data.daily.map(d => d.total)
},
{
label: 'Appointments Scheduled',
data: data.daily.map(d => d.appointments_scheduled)
}
]
};
}
Calculate Week-over-Week Growth
import requests
from datetime import datetime, timedelta
def calculate_wow_growth(api_key):
today = datetime.now()
# This week
this_week_end = today
this_week_start = today - timedelta(days=7)
# Last week
last_week_end = this_week_start
last_week_start = last_week_end - timedelta(days=7)
def get_week_total(start, end):
response = requests.get(
'https://api.getdoppel.ai/api/v1/metrics/daily',
params={
'date_from': start.strftime('%Y-%m-%d'),
'date_to': end.strftime('%Y-%m-%d')
},
headers={'Authorization': f'Bearer {api_key}'}
)
daily = response.json()['data']['daily']
return sum(d['total'] for d in daily)
this_week = get_week_total(this_week_start, this_week_end)
last_week = get_week_total(last_week_start, last_week_end)
if last_week > 0:
growth = ((this_week - last_week) / last_week) * 100
else:
growth = 0
return {
'this_week': this_week,
'last_week': last_week,
'growth_percentage': round(growth, 1)
}
# Usage
growth = calculate_wow_growth('dpl_live_YOUR_API_KEY')
print(f"Week-over-week growth: {growth['growth_percentage']}%")
Identify Busy Days
Find your busiest days of the week:async function analyzeDayPatterns(apiKey) {
const today = new Date();
const startDate = new Date(today);
startDate.setDate(startDate.getDate() - 90); // Last 90 days
const response = await fetch(
`https://api.getdoppel.ai/api/v1/metrics/daily?date_from=${startDate.toISOString().split('T')[0]}&date_to=${today.toISOString().split('T')[0]}`,
{
headers: { 'Authorization': `Bearer ${apiKey}` }
}
);
const { data } = await response.json();
const dayNames = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
const dayTotals = new Array(7).fill(0);
const dayCounts = new Array(7).fill(0);
data.daily.forEach(d => {
const dayOfWeek = new Date(d.date).getDay();
dayTotals[dayOfWeek] += d.total;
dayCounts[dayOfWeek]++;
});
const dayAverages = dayNames.map((name, i) => ({
day: name,
average: dayCounts[i] > 0 ? Math.round(dayTotals[i] / dayCounts[i]) : 0
}));
return dayAverages.sort((a, b) => b.average - a.average);
}
// Usage
const patterns = await analyzeDayPatterns('dpl_live_YOUR_API_KEY');
console.log('Busiest days:', patterns.slice(0, 3));
Related Endpoints
Metrics Summary
Get aggregated totals instead of daily breakdown.
Outcome Breakdown
See how outcomes distribute across all interactions.