Skip to content

Stats & usage

Generated from DialerDigital/core commit 6e9f026f0a72 — spec openapi/dialer-v1.yaml v0.36.0. Do not edit by hand; see How this reference is built. Download the OpenAPI spec.

Operational counters, blocked-dial rollups, usage metering.

Endpoints

MethodPathSummary
GET/v1/stats/summaryToday's operational counters (UTC day)
GET/v1/stats/promisesPTP pipeline summary
GET/v1/stats/penetrationPerson-level penetration analytics
GET/v1/stats/blockedDurable blocked-dial rollup
GET/v1/stats/capacityTenant capacity ceilings + live usage (ADR
GET/v1/stats/ai-usageVoice-AI minute metering (invoicing read)
GET/v1/stats/sms-usageSMS segment metering (invoicing read)

Today's operational counters (UTC day)

http
GET /v1/stats/summary

Computed from the append-only CDR + live seat registry — reconstructible truth, not cached state.

Responses

200

Today's counters.

FieldTypeRequiredDescription
datestring (date)no
window"utc_day"no
calls_todayintegerno
connected_todayintegerno
connect_ratenumberno
agents_onlineintegerno
agents_availableintegerno
campaigns_runningintegerno
json
{
  "date": "2026-07-05",
  "window": "utc_day",
  "calls_today": 412,
  "connected_today": 67,
  "connect_rate": 0.1626,
  "agents_online": 5,
  "agents_available": 3,
  "campaigns_running": 2
}

401 — Unauthorized

Missing, unknown or revoked API key (or, on /v1/admin/*, a bad/unset admin token; on webhooks, a bad/missing signature).

json
{
  "error": {
    "code": "unauthorized",
    "message": "invalid or revoked API key"
  }
}

PTP pipeline summary

http
GET /v1/stats/promises

Currencies never sum together; kept_rate_30d is null when nothing resolved in the window.

Responses

200

Pipeline summary.

FieldTypeRequiredDescription
openobjectno
open.countintegerno
open.amount_centsobjectnoPer-currency sums — currencies never sum together.
kept_rate_30dnumber | nullnoOver promises RESOLVED with promised_date in the last 30 days; null = none resolved.
window_daysintegerno
json
{
  "open": {
    "count": 4,
    "amount_cents": {
      "USD": 50000,
      "MXN": 120000
    }
  },
  "kept_rate_30d": 0.75,
  "window_days": 30
}

401 — Unauthorized

Missing, unknown or revoked API key (or, on /v1/admin/*, a bad/unset admin token; on webhooks, a bad/missing signature).

json
{
  "error": {
    "code": "unauthorized",
    "message": "invalid or revoked API key"
  }
}

Person-level penetration analytics

http
GET /v1/stats/penetration

Person-level dedup (each debt counts once): attempted = at least one original attempt, reached = any non-failed disposition or conversation, effective_contact = answered_human or conversation. campaign_ids is required (max 100; campaign_id= also accepted).

Parameters

NameInTypeRequiredDescription
campaign_idsquerystringyesComma-separated campaign UUIDs (max 100).
fromquerystring (date-time)noRFC 3339 lower bound (endpoint-specific field; default trailing 30 UTC days where noted).
toquerystring (date-time)noRFC 3339 upper bound.

Responses

200

Penetration totals + per-campaign rows.

FieldTypeRequiredDescription
totalsobject (PenetrationRow)no
totals.campaign_idstring (uuid) | nullno
totals.unique_accountsintegerno
totals.unique_consumersintegerno
totals.attemptedintegerno
totals.reachedintegerno
totals.effective_contactintegerno
totals.attempted_pctnumberno
totals.reached_pctnumberno
totals.effective_contact_pctnumberno
by_campaignarray of PenetrationRowno
by_campaign[].campaign_idstring (uuid) | nullno
by_campaign[].unique_accountsintegerno
by_campaign[].unique_consumersintegerno
by_campaign[].attemptedintegerno
by_campaign[].reachedintegerno
by_campaign[].effective_contactintegerno
by_campaign[].attempted_pctnumberno
by_campaign[].reached_pctnumberno
by_campaign[].effective_contact_pctnumberno
json
{
  "totals": {
    "campaign_id": null,
    "unique_accounts": 4,
    "unique_consumers": 4,
    "attempted": 2,
    "reached": 1,
    "effective_contact": 1,
    "attempted_pct": 50,
    "reached_pct": 25,
    "effective_contact_pct": 25
  },
  "by_campaign": [
    {
      "campaign_id": "3f2c1b0a-9d8e-4c7b-a6f5-4e3d2c1b0a99",
      "unique_accounts": 4,
      "unique_consumers": 4,
      "attempted": 2,
      "reached": 1,
      "effective_contact": 1,
      "attempted_pct": 50,
      "reached_pct": 25,
      "effective_contact_pct": 25
    }
  ]
}

400 — BadRequest

Malformed request (shape/type errors, invalid filters, bad timestamps).

json
{
  "error": {
    "code": "bad_request",
    "message": "from must be RFC-3339"
  }
}

401 — Unauthorized

Missing, unknown or revoked API key (or, on /v1/admin/*, a bad/unset admin token; on webhooks, a bad/missing signature).

json
{
  "error": {
    "code": "unauthorized",
    "message": "invalid or revoked API key"
  }
}

Durable blocked-dial rollup

http
GET /v1/stats/blocked

Reads the durable, APPEND-ONLY gate_blocks evidence: one row per (debt, gate, campaign, UTC day) the compliance engine REFUSED to dial. Every number is a count of distinct refusals, never an estimate. Defaults: trailing 30 UTC days.

Parameters

NameInTypeRequiredDescription
fromquerystring (date-time)noRFC 3339 lower bound (endpoint-specific field; default trailing 30 UTC days where noted).
toquerystring (date-time)noRFC 3339 upper bound.
campaign_idquerystring (uuid)no

Responses

200

Blocked-dial rollup.

FieldTypeRequiredDescription
fromstring (date-time)no
tostring (date-time)no
campaign_idstring (uuid) | nullno
totalintegerno
by_gateobjectnoKeys are the ComplianceGate vocabulary.
dailyarray of objectno
daily[].datestring (date)no
daily[].totalintegerno
daily[].by_gateobjectno
json
{
  "from": "2026-06-05T00:00:00Z",
  "to": "2026-07-05T00:00:00Z",
  "campaign_id": null,
  "total": 5,
  "by_gate": {
    "quiet_hours": 4,
    "dnc_listed": 1
  },
  "daily": [
    {
      "date": "2026-06-01",
      "total": 3,
      "by_gate": {
        "quiet_hours": 2,
        "dnc_listed": 1
      }
    }
  ]
}

400 — BadRequest

Malformed request (shape/type errors, invalid filters, bad timestamps).

json
{
  "error": {
    "code": "bad_request",
    "message": "from must be RFC-3339"
  }
}

401 — Unauthorized

Missing, unknown or revoked API key (or, on /v1/admin/*, a bad/unset admin token; on webhooks, a bad/missing signature).

json
{
  "error": {
    "code": "unauthorized",
    "message": "invalid or revoked API key"
  }
}

Tenant capacity ceilings + live usage (ADR

http
GET /v1/stats/capacity

The tenant's admin-set capacity ceilings (max_cps, max_concurrent_channels; null = no ceiling) plus live usage read from the capacity gate. limits: null = the ceilings could not be read AND were never cached — the exact condition the gate fails CLOSED on; surfaced honestly, never fabricated as "unlimited".

supervision is a SECOND, independent ceiling (ADR #37): live-call supervision legs originate outside the dial choke point, so they are counted in their own quota. Neither lane can exhaust the other — the dialing floor can be at its ceiling while supervision still admits, and vice versa.

Responses

200

Capacity ceilings + live usage.

FieldTypeRequiredDescription
limitsobject | nullnoAdmin-set ceilings, or null when the gate fails closed (ceilings unreadable and never cached). Each ceiling is null when unset.
channels_in_useintegerno
dials_last_secondintegerno
supervisionobjectnoThe SECOND ceiling (ADR #37): concurrent live-call supervision sessions, counted and bounded separately from the dialing lane so neither can starve the other. limit is the deploy-time max_supervision_channels; in_use counts (call, supervisor) sessions, so a listen → barge switch on one call counts once.
supervision.limitintegerno
supervision.in_useintegerno
json
{
  "limits": {
    "max_cps": 10,
    "max_concurrent_channels": 50
  },
  "channels_in_use": 3,
  "dials_last_second": 2,
  "supervision": {
    "limit": 20,
    "in_use": 1
  }
}

401 — Unauthorized

Missing, unknown or revoked API key (or, on /v1/admin/*, a bad/unset admin token; on webhooks, a bad/missing signature).

json
{
  "error": {
    "code": "unauthorized",
    "message": "invalid or revoked API key"
  }
}

Voice-AI minute metering (invoicing read)

http
GET /v1/stats/ai-usage

Off the durable exactly-once ai_usage feed (one row per answered AI call, billed EXACTLY ONCE on call_uuid). Each row snapshots the per-minute rate it was metered under — changing the configured rate never reprices history. The window is half-open — from inclusive, to EXCLUSIVE — so a call answered exactly at a billing cut belongs to one period only (the one starting at that instant), never to both sides of the cut. ?format=csv (or Accept: text/csv) returns the billing artifact with its own X-Artifact-SHA256.

Parameters

NameInTypeRequiredDescription
fromquerystring (date-time)noRFC 3339 lower bound (endpoint-specific field; default trailing 30 UTC days where noted).
toquerystring (date-time)noRFC 3339 upper bound.
campaign_idquerystring (uuid)no
formatquerycsvnocsv for the downloadable artifact (equivalent: Accept: text/csv).

Responses

200

Metering stats (JSON) or the CSV billing artifact.

FieldTypeRequiredDescription
fromstring (date-time)no
tostring (date-time)no
campaign_idstring (uuid) | nullno
minute_rate_usdnumberno
callsintegerno
billable_secondsintegerno
billable_minutesnumberno
estimated_cost_usdnumberno
dailyarray of objectno
daily[].datestring (date)no
daily[].callsintegerno
daily[].billable_secondsintegerno
daily[].billable_minutesnumberno
daily[].minute_rate_usdnumberno
daily[].estimated_cost_usdnumberno
json
{
  "from": "2026-06-05T00:00:00Z",
  "to": "2026-07-05T00:00:00Z",
  "campaign_id": null,
  "minute_rate_usd": 0.25,
  "calls": 3,
  "billable_seconds": 270,
  "billable_minutes": 4.5,
  "estimated_cost_usd": 1.13,
  "daily": [
    {
      "date": "2026-06-01",
      "calls": 2,
      "billable_seconds": 180,
      "billable_minutes": 3,
      "minute_rate_usd": 0.25,
      "estimated_cost_usd": 0.75
    }
  ]
}

400 — BadRequest

Malformed request (shape/type errors, invalid filters, bad timestamps).

json
{
  "error": {
    "code": "bad_request",
    "message": "from must be RFC-3339"
  }
}

401 — Unauthorized

Missing, unknown or revoked API key (or, on /v1/admin/*, a bad/unset admin token; on webhooks, a bad/missing signature).

json
{
  "error": {
    "code": "unauthorized",
    "message": "invalid or revoked API key"
  }
}

SMS segment metering (invoicing read)

http
GET /v1/stats/sms-usage

Straight off the unified ledger: sms_segment billable events, exactly-once at provider ACCEPT, each priced at its region-rate snapshot. JSON, or ?format=csv / Accept: text/csv for the billing artifact.

Parameters

NameInTypeRequiredDescription
fromquerystring (date-time)noRFC 3339 lower bound (endpoint-specific field; default trailing 30 UTC days where noted).
toquerystring (date-time)noRFC 3339 upper bound.
campaign_idquerystring (uuid)no
formatquerycsvnocsv for the downloadable artifact (equivalent: Accept: text/csv).

Responses

200

Metering stats (JSON) or the CSV billing artifact.

FieldTypeRequiredDescription
fromstring (date-time)no
tostring (date-time)no
campaign_idstring (uuid) | nullno
segment_rates_usdobjectnoPer-region rate currently in force (what new sends will snapshot).
messagesintegerno
segmentsstringnoDecimal as string.
amount_usdstringnoDecimal as string.
dailyarray of objectno
daily[].datestring (date)no
daily[].messagesintegerno
daily[].segmentsstringno
daily[].segment_rate_usdstringno
daily[].amount_usdstringno
json
{
  "from": "2026-06-05T00:00:00Z",
  "to": "2026-07-05T00:00:00Z",
  "campaign_id": null,
  "segment_rates_usd": {
    "us": "0.0100",
    "mx": "0.0300",
    "eu": "0.0500"
  },
  "messages": 2,
  "segments": "3",
  "amount_usd": "0.03",
  "daily": [
    {
      "date": "2026-07-01",
      "messages": 2,
      "segments": "3",
      "segment_rate_usd": "0.0100",
      "amount_usd": "0.03"
    }
  ]
}

400 — BadRequest

Malformed request (shape/type errors, invalid filters, bad timestamps).

json
{
  "error": {
    "code": "bad_request",
    "message": "from must be RFC-3339"
  }
}

401 — Unauthorized

Missing, unknown or revoked API key (or, on /v1/admin/*, a bad/unset admin token; on webhooks, a bad/missing signature).

json
{
  "error": {
    "code": "unauthorized",
    "message": "invalid or revoked API key"
  }
}

Nothing in these docs is legal advice — always confirm compliance posture with your own counsel.