Skip to main content
GET
https://api.getdoppel.ai/api/v1
/
api
/
v1
/
metrics
/
summary
Metrics Summary
curl --request GET \
  --url https://api.getdoppel.ai/api/v1/api/v1/metrics/summary \
  --header 'Authorization: Bearer <token>'
{
  "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

HeaderRequiredDescription
AuthorizationYesBearer token with your API key

Query Parameters

ParameterTypeDefaultDescription
date_fromstring30 days agoStart date (ISO 8601)
date_tostringTodayEnd date (ISO 8601)
clinic_idstring-Filter by clinic UUID
channelstring-Filter by channel: voice or whatsapp

Response

success
boolean
Whether the request was successful
data
object

Examples

Basic Request

curl -X GET "https://api.getdoppel.ai/api/v1/metrics/summary" \
  -H "Authorization: Bearer dpl_live_YOUR_API_KEY"

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"

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"

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")