Skip to main content
GET
https://api.getdoppel.ai/api/v1
/
api
/
v1
/
metrics
/
outcomes
Outcome Breakdown
curl --request GET \
  --url https://api.getdoppel.ai/api/v1/api/v1/metrics/outcomes \
  --header 'Authorization: Bearer <token>'
{
  "success": true,
  "data": {
    "outcomes": [
      {}
    ],
    "total": 123
  }
}

Outcome Breakdown

Returns a detailed breakdown of interaction outcomes, showing how many interactions resulted in each outcome type. Use this to understand your conversion rates and identify opportunities for improvement.

Request

GET https://api.getdoppel.ai/api/v1/metrics/outcomes

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
typestring-Filter by interaction type

Response

success
boolean
Whether the request was successful
data
object

Outcome Object

FieldTypeDescription
outcomestringOutcome identifier
labelstringHuman-readable outcome name
countintegerNumber of interactions with this outcome
percentagenumberPercentage of total (0-100)

Common Outcomes

Outcome values are UPPERCASE. Use these exact values when filtering interactions.
OutcomeDescription
APPOINTMENT_BOOKEDNew appointment was scheduled
APPOINTMENT_MODIFIEDExisting appointment was rescheduled
APPOINTMENT_CANCELLEDAppointment was cancelled
NO_ANSWERCall was not answered
VOICEMAIL_REACHEDCall went to voicemail
CALLBACK_REQUESTEDPatient requested a callback
DECISION_PENDINGPatient needs more time to decide
OPT_OUTPatient opted out of communications
UNREACHABLEUnable to reach patient

Examples

Basic Request

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

Filter by Channel

Get outcome breakdown for voice calls only:
curl -X GET "https://api.getdoppel.ai/api/v1/metrics/outcomes?channel=voice" \
  -H "Authorization: Bearer dpl_live_YOUR_API_KEY"

Filter by Interaction Type

Get outcomes for campaign outbound calls:
curl -X GET "https://api.getdoppel.ai/api/v1/metrics/outcomes?channel=voice&type=CAMPAIGN_OUTBOUND" \
  -H "Authorization: Bearer dpl_live_YOUR_API_KEY"

Response Example

{
  "success": true,
  "data": {
    "outcomes": [
      {
        "outcome": "APPOINTMENT_BOOKED",
        "label": "Appointment Booked",
        "count": 320,
        "percentage": 25.6
      },
      {
        "outcome": "NO_ANSWER",
        "label": "No Answer",
        "count": 280,
        "percentage": 22.4
      },
      {
        "outcome": "APPOINTMENT_MODIFIED",
        "label": "Appointment Modified",
        "count": 200,
        "percentage": 16.0
      },
      {
        "outcome": "VOICEMAIL_REACHED",
        "label": "Voicemail Reached",
        "count": 150,
        "percentage": 12.0
      },
      {
        "outcome": "CALLBACK_REQUESTED",
        "label": "Callback Requested",
        "count": 100,
        "percentage": 8.0
      },
      {
        "outcome": "DECISION_PENDING",
        "label": "Decision Pending",
        "count": 80,
        "percentage": 6.4
      },
      {
        "outcome": "OPT_OUT",
        "label": "Opt Out",
        "count": 70,
        "percentage": 5.6
      },
      {
        "outcome": "UNREACHABLE",
        "label": "Unreachable",
        "count": 50,
        "percentage": 4.0
      }
    ],
    "total": 1250
  },
  "request_id": "req_abc123xyz",
  "timestamp": "2024-01-15T10:30:00.000Z"
}

Use Cases

Conversion Funnel Analysis

Calculate conversion rates from your outcomes:
async function getConversionMetrics(apiKey, dateFrom, dateTo) {
  const response = await fetch(
    `https://api.getdoppel.ai/api/v1/metrics/outcomes?date_from=${dateFrom}&date_to=${dateTo}`,
    {
      headers: { 'Authorization': `Bearer ${apiKey}` }
    }
  );
  const { data } = await response.json();

  const outcomes = Object.fromEntries(
    data.outcomes.map(o => [o.outcome, o.count])
  );

  const contacted = data.total - (outcomes.NO_ANSWER || 0) - (outcomes.VOICEMAIL_REACHED || 0);
  const converted = outcomes.APPOINTMENT_BOOKED || 0;

  return {
    totalAttempts: data.total,
    contactRate: ((contacted / data.total) * 100).toFixed(1),
    conversionRate: ((converted / data.total) * 100).toFixed(1),
    contactToConversion: ((converted / contacted) * 100).toFixed(1)
  };
}

Compare Channels

Compare outcome performance between voice and WhatsApp:
import requests

def compare_channel_outcomes(api_key):
    channels = ['voice', 'whatsapp']
    results = {}

    for channel in channels:
        response = requests.get(
            'https://api.getdoppel.ai/api/v1/metrics/outcomes',
            params={'channel': channel},
            headers={'Authorization': f'Bearer {api_key}'}
        )
        data = response.json()['data']

        # Find APPOINTMENT_BOOKED outcome
        scheduled = next(
            (o for o in data['outcomes'] if o['outcome'] == 'APPOINTMENT_BOOKED'),
            {'percentage': 0}
        )
        results[channel] = {
            'total': data['total'],
            'conversion_rate': scheduled['percentage']
        }

    return results

# Usage
comparison = compare_channel_outcomes('dpl_live_YOUR_API_KEY')
print(f"Voice conversion: {comparison['voice']['conversion_rate']}%")
print(f"WhatsApp conversion: {comparison['whatsapp']['conversion_rate']}%")