Skip to content
Get started

Get campaign statistics

campaigns.statistics(strid) -> CampaignStatisticsResponse
GET/campaigns/{id}/statistics

Retrieve the "Statistiques" report for a campaign: the four-tile cascade funnel (appelés → eus en ligne → réels échanges → leads chauds), two secondary tiles, the distribution of exchanges by outcome, the list of hot leads, and data-extraction coverage. All counts are over distinct E.164-normalized phone numbers, and the outcome-based categories derive exclusively from calls.outcome. Cascade percentages are null when their denominator is zero.

ParametersExpand Collapse
id: str
ReturnsExpand Collapse
class CampaignStatisticsResponse:
statistics: Statistics
campaign: StatisticsCampaign
id: str
agent_name: Optional[str]
first_activity_at: object
has_activity: bool
is_cancelled: bool
last_activity_at: object
max_attempts_per_contact: Optional[float]
name: str
status: Literal["draft", "running", "paused", "completed"]
One of the following:
"draft"
"running"
"paused"
"completed"
timezone: str
data_extraction: Optional[StatisticsDataExtraction]
fields: List[str]
intro: str
effort: StatisticsEffort
calls_total: float
inbound_calls: float
outbound_attempts: float
funnel: StatisticsFunnel
called: StatisticsFunnelCalled
count: float
imported_rows: float
hot_leads: StatisticsFunnelHotLeads
count: float
pct_of_reached: Optional[float]
reached: StatisticsFunnelReached
count: float
inbound: float
outbound: float
overlap: float
pct_of_called: Optional[float]
real_exchanges: StatisticsFunnelRealExchanges
count: float
pct_of_reached: Optional[float]
hot_lead_outcomes: List[str]
inbound: StatisticsInbound
unique_callers: float
leads: StatisticsLeads
hot: List[StatisticsLeadsHot]
attempt_id: Optional[str]
call_id: str
direction: Literal["inbound", "outbound"]
One of the following:
"inbound"
"outbound"
email: Optional[str]
last_activity_at: object
name: str
phone: str
summary: Optional[str]
warm: List[StatisticsLeadsWarm]
attempt_id: Optional[str]
call_id: str
direction: Literal["inbound", "outbound"]
One of the following:
"inbound"
"outbound"
email: Optional[str]
last_activity_at: object
name: str
phone: str
summary: Optional[str]
outcome_breakdown: List[StatisticsOutcomeBreakdown]
count: float
label: str
outcome: str

Get campaign statistics

import os
from revox import Revox

client = Revox(
    api_key=os.environ.get("REVOX_API_KEY"),  # This is the default and can be omitted
)
response = client.campaigns.statistics(
    "id",
)
print(response.statistics)
{
  "statistics": {
    "campaign": {
      "id": "id",
      "agent_name": "agent_name",
      "first_activity_at": {},
      "has_activity": true,
      "is_cancelled": true,
      "last_activity_at": {},
      "max_attempts_per_contact": 0,
      "name": "name",
      "status": "draft",
      "timezone": "timezone"
    },
    "data_extraction": {
      "fields": [
        "string"
      ],
      "intro": "intro"
    },
    "effort": {
      "calls_total": 0,
      "inbound_calls": 0,
      "outbound_attempts": 0
    },
    "funnel": {
      "called": {
        "count": 0,
        "imported_rows": 0
      },
      "hot_leads": {
        "count": 0,
        "pct_of_reached": 0
      },
      "reached": {
        "count": 0,
        "inbound": 0,
        "outbound": 0,
        "overlap": 0,
        "pct_of_called": 0
      },
      "real_exchanges": {
        "count": 0,
        "pct_of_reached": 0
      }
    },
    "hot_lead_outcomes": [
      "string"
    ],
    "inbound": {
      "unique_callers": 0
    },
    "leads": {
      "hot": [
        {
          "attempt_id": "attempt_id",
          "call_id": "call_id",
          "direction": "inbound",
          "email": "email",
          "last_activity_at": {},
          "name": "name",
          "phone": "phone",
          "summary": "summary"
        }
      ],
      "warm": [
        {
          "attempt_id": "attempt_id",
          "call_id": "call_id",
          "direction": "inbound",
          "email": "email",
          "last_activity_at": {},
          "name": "name",
          "phone": "phone",
          "summary": "summary"
        }
      ]
    },
    "outcome_breakdown": [
      {
        "count": 0,
        "label": "label",
        "outcome": "outcome"
      }
    ]
  }
}
Returns Examples
{
  "statistics": {
    "campaign": {
      "id": "id",
      "agent_name": "agent_name",
      "first_activity_at": {},
      "has_activity": true,
      "is_cancelled": true,
      "last_activity_at": {},
      "max_attempts_per_contact": 0,
      "name": "name",
      "status": "draft",
      "timezone": "timezone"
    },
    "data_extraction": {
      "fields": [
        "string"
      ],
      "intro": "intro"
    },
    "effort": {
      "calls_total": 0,
      "inbound_calls": 0,
      "outbound_attempts": 0
    },
    "funnel": {
      "called": {
        "count": 0,
        "imported_rows": 0
      },
      "hot_leads": {
        "count": 0,
        "pct_of_reached": 0
      },
      "reached": {
        "count": 0,
        "inbound": 0,
        "outbound": 0,
        "overlap": 0,
        "pct_of_called": 0
      },
      "real_exchanges": {
        "count": 0,
        "pct_of_reached": 0
      }
    },
    "hot_lead_outcomes": [
      "string"
    ],
    "inbound": {
      "unique_callers": 0
    },
    "leads": {
      "hot": [
        {
          "attempt_id": "attempt_id",
          "call_id": "call_id",
          "direction": "inbound",
          "email": "email",
          "last_activity_at": {},
          "name": "name",
          "phone": "phone",
          "summary": "summary"
        }
      ],
      "warm": [
        {
          "attempt_id": "attempt_id",
          "call_id": "call_id",
          "direction": "inbound",
          "email": "email",
          "last_activity_at": {},
          "name": "name",
          "phone": "phone",
          "summary": "summary"
        }
      ]
    },
    "outcome_breakdown": [
      {
        "count": 0,
        "label": "label",
        "outcome": "outcome"
      }
    ]
  }
}