Languages: every operation supports cURL, Node.js (TypeScript), Python, Go, Ruby, and PHP. The first 15 operations on this page show all six languages; the remaining 61 show cURL and TypeScript — the two most-used.
Analytics API
Analytics endpoints exposed by the Devotel CPaaS API Base path:/api/v1
Endpoint count: 76
title: “Worked analytics queries” description: “KPI summary with filters, cursor-paged breakdown rows, prebuilt scheduled-report reads, the zeroed-period shape, and validation/role errors.”
Worked analytics queries
Every operation below is documented on this page with its parameters, but the bodies you branch on — the KPI envelope, the breakdown rows, the totals line — are easiest to learn as one reader chain: pick a metric/summary endpoint → filter by period and channel → page through the breakdown rows → read the totals row. The samples below walk that chain end to end and show the full response envelope at each step. Scope of this overlay:- Per the language note above, these samples show cURL and TypeScript — the two most-requested languages. The other four tabs appear on the endpoint blocks themselves.
- The full endpoint catalogue with every filter combination lives at the stats API guide; recurring email delivery of the same data (schedule, recipients, cadence) is covered in scheduled reports. This overlay stays envelope-accurate: request, response, and the errors that decide what you branch on — nothing else.
200 — during a transient storage
blip, so a poll loop or an always-on dashboard never flashes a 5xx; design
your polling against that contract.
1. Pull a KPI summary
GET /api/v1/analytics/messages returns the headline KPIs for a period —
sent, delivered, failed, read, the derived rates, and the average delivery
time — plus a bucketed time series for charting. Filter the window with
start_date / end_date (or a days lookback) and narrow to one channel
with channel.
200
data.totals, chartable buckets under data.time_series (or a named
breakdown array), and the echoed granularity under data.group_by. The
cost counterpart — GET /api/v1/analytics/costs — answers with the same
totals + time_series envelope plus a by_channel breakdown.
2. Page a breakdown series
Breakdown endpoints return the counters you just read, re-sliced per dimension — channel, destination country, or error code behind failures. Page through the list endpoints that carry a cursor (for example goals): keep the same filters, pass the previous page’snextCursor back as
cursor, and stop when it comes back null.
GET /api/v1/analytics/goals
200
cursor=cur_8Kw2mQ1z; when this page’s nextCursor is null
you have the full set:
200
GET /api/v1/analytics/messages/by-channel,
/by-country, and /messages/errors — are single-response reads with no
cursor; each returns its full ranked array (channels, countries,
errors) so you render them directly.
3. Prebuilt report read (and the empty-period shape)
GET /api/v1/analytics/scheduled-reports lists the recurring reports
already scheduled for your organization — the prebuilt views the scheduler
emails on a cadence — with each report’s type, frequency, recipients, and
its last- and next-send timestamps.
200
200 with zeroed totals and an empty series — test
your client against this shape so a quiet period never parses as a failure:
200
4. Errors
Two branches cover the mistakes callers actually hit on this surface. Validation — unrecognized filter value. Query params are validated before any query runs. A failed validation returns422 VALIDATION_ERROR
with error.details.issues listing each rejected field — for example a
group_by outside the allowed set (hour / day / week / month):
422
403 INSUFFICIENT_PERMISSIONS and a message naming the accepted roles:
403
422 needs a corrected filter
before you re-send, and a 403 will not succeed until the role changes.
Multi-touch marketing attribution (first/last/linear model picker)
GET /api/v1/analytics/attributionfirst_touch (100% to the oldest touchpoint), last_touch (100% to the newest), or linear (even split across every touchpoint). Returns by_channel + by_campaign credit buckets (conversions + value_cents + share) alongside totals and the unattributed-conversions count. Query params: model (first_touch|last_touch|linear, default last_touch), goal_id (restrict to one goal’s conversions, optional), window_days (conversions within trailing N days, 1-365, default 30), lookback_days (per-conversion touchpoint lookback, 1-365, default 30). Restricted to owner/admin/developer/viewer; read-only, rate-limited, 60s cached.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Compare your rates against cross-tenant benchmark cohorts
GET /api/v1/analytics/benchmarkschannel, metric, messageType, country (ISO alpha-2). Use it to see how your deliverability stacks up against comparable senders. Responds available: false before the first nightly snapshot exists. Read-only; owner/admin/developer/viewer.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Estimated CO2e footprint per channel
GET /api/v1/analytics/carbonstart_date / end_date (YYYY-MM-DD) or a trailing days number (default 30). Read-only; owner/admin/developer/viewer. For a downloadable report use GET /analytics/carbon/export.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Download a CSV carbon sustainability report
GET /api/v1/analytics/carbon/exporttext/csv), ready to attach to a procurement sustainability questionnaire. Optional filters: start_date / end_date (YYYY-MM-DD) or trailing days, plus optional format. Read-only; owner/admin/developer/viewer.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Aggregated contact-reason volume analytics
GET /api/v1/analytics/contact-reasonswindow, optionally channel, category, reason. Use it for CX portfolio reporting and to close the voice-vs-text parity gap (voice has the equivalent under /voice/intelligence/trends). Read-only; owner/admin/developer/viewer; 60s cached.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Top conversations by telco cost-to-serve
GET /api/v1/analytics/cost-per-conversationstart / end (ISO datetime with offset, end strictly after start); optional limit (1–500, default 100). Use it for P&L on high-volume support threads. Read-only; owner/admin/developer/viewer.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Cost analytics with time-series and channel breakdown
GET /api/v1/analytics/costsstart_date / end_date (YYYY-MM-DD), optional channel, and group_by (day|hour|week|month, default day). Read-only; any authenticated member with analytics:read.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.List the widget catalog for custom dashboards
GET /api/v1/analytics/dashboards/widgetssource endpoint, default visualization and size, accepted params) plus the grid constraints the builder enforces (default column count, max widgets per dashboard). Drives the palette of the no-code dashboard builder; each widget fetches its own already tenant-scoped source endpoint, so this catalog is stateless. Read-only; owner/admin/developer/viewer.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Per-channel deliverability dashboard
GET /api/v1/analytics/deliverabilitychannel (sms | whatsapp | email | rcs | telegram | viber | voice); window (7d default) and optional groupBy. Series buckets are computed in the tenant’s billing timezone, echoed as timezone. Read-only; owner/admin/developer/viewer; 60s cached.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Cross-channel deliverability and sender-reputation cockpit
GET /api/v1/analytics/deliverability-health-centerissues remediation list with its root cause and what to do about it. Optional query days (1-90, default 7) sizes the SMS route-quality slice. Read-only; owner/admin/developer/viewer; 60s cached.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Per-queue/campaign outbound delivery funnel
GET /api/v1/analytics/delivery-waterfallgroup (queue|campaign, default queue), channel (sms), window (24h|7d|30d, default 7d), page (1-indexed), pageSize (1-100, default 25). Use it to say ‘the VIP-support queue lost 40% at the provider hop, not at the campaign hop’. Read-only; owner/admin/developer/viewer; 60s cached.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Carrier rejection codes behind a funnel drop-off
GET /api/v1/analytics/funnel/{step}/drop-reasonsstep: sent (sent but never delivered) carries the reasons; delivered / read / queued are reserved and currently return an empty list. Query params: date range (start_date / end_date, else days), channel, and limit (1-20, default 5). Use it to answer ‘why did this funnel bar drop?’ inline. Read-only.
string
required
—
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.List conversion goals
GET /api/v1/analytics/goalslimit (1-200, default 50) and offset. For pixel_fire goals each entry includes its signed pixel URL. Read-only.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Get one conversion goal
GET /api/v1/analytics/goals/{id}pixel_fire goals — the signed pixel URL to embed on your site. Responds 404 when the goal does not exist. Read-only.
string
required
—
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.List a goal’s conversions
GET /api/v1/analytics/goals/{id}/conversionslimit (1-500, default 100). Use it to inspect exactly which conversions a goal recorded instead of only the aggregated counts. Read-only.
string
required
—
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Aggregate conversion stats for one goal
GET /api/v1/analytics/goals/{id}/statswindow_days (1-365, default 30). Use it to see which of your sends actually drive conversions. Read-only.
string
required
—
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Cross-channel customer-journey path (Sankey) analytics
GET /api/v1/analytics/journey-pathsnodes (a channel occupying an ordered stage), links (stage-to-stage transitions with a journey count), stages (per-stage reached/continued/dropped/drop_off_rate), and top_paths (the most-walked full channel sequences with their share), alongside total_journeys, total_touchpoints, channels, and the echoed window/entry_channel/current_since. Query params: window (24h|7d|30d|90d, default 30d), entry_channel (keep only journeys whose first touchpoint was this channel), max_stages (2-10, default 6), min_journeys (prune links carried by fewer journeys, default 1). Restricted to owner/admin/developer/viewer; read-only, rate-limited, 60s cached.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.List self-serve KPI alert rules
GET /api/v1/analytics/kpi-alert-rules{ data, meta } envelope with data.items + data.total.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.List fired KPI alert events
GET /api/v1/analytics/kpi-alert-rules/events{ data, meta } envelope with data.items + data.total.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Aggregate message delivery metrics with time series
GET /api/v1/analytics/messagesstart_date / end_date (YYYY-MM-DD or ISO datetime; else days lookback, max 365), channel (sms|whatsapp|rcs|email|viber|voice|push|messenger|telegram), status, campaign_id, group_by (hour|day|week|month, default day), phone_number_id (narrow a WhatsApp breakdown to one WABA connection). Time-bucketed rows carry a tenant-local period_date for calendar alignment. Use this for the overview volume chart on the analytics dashboard.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Delivery metrics broken down by channel
GET /api/v1/analytics/messages/by-channelphone_number_id narrows the outbound breakdown to one WhatsApp WABA connection. Use this for the per-channel KPI cards on the analytics dashboard.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Delivery metrics broken down by destination country
GET /api/v1/analytics/messages/by-countrychannel filter. Use this to surface which destinations hold the volume and where delivery lags.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Message failure analysis by carrier error code
GET /api/v1/analytics/messages/errorschannel filter. Use this to triage quality issues before they become a deliverability problem.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Account-level messaging health score
GET /api/v1/analytics/messaging-health-scoreinsufficient tier instead of a misleading score. Query params: window (24h|7d|30d, default 7d) and optional minSampleSize override. Read-only, open to owner/admin/developer/viewer, 60s cached.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Messaging insights — carrier, country, and error breakdowns
GET /api/v1/analytics/messaging-insightschannel (sms|whatsapp|rcs|email|viber|push|messenger|telegram), window (24h|7d|30d), and optional carrier / country / errorCode drill-downs; each dimension capped at the top 25 buckets. Owner/admin only — the carrier-side filtering signal is withheld from viewer scope. Read-only, 60s cached.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Per-carrier (MNO) delivery truth with silent-drop inference
GET /api/v1/analytics/per-mno-deliverybuckets array exposes silent_drop_suspected per carrier and totals aggregate the suspicion count. Restricted to owner/admin/developer/viewer; read-only, rate-limited, 60s cached.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Per-carrier-connector (route-level) delivery breakdown
GET /api/v1/analytics/per-route-deliverymetadata._attempt_carrier when present, else the original provider) — and reports terminal/delivered/failed/undelivered counts with delivery, failure and undelivered rates per route. Use it when per-country or per-MNO deliverability degrades and you need to know which of YOUR connector paths is failing, not which destination operator. Paginated (page/pageSize); the totals.degraded counter covers ALL routes (not just the page) so a low-volume route past the row cap still surfaces. Restricted to owner/admin/developer/viewer; read-only, rate-limited, 60s cached.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Per-route DLR-rate anomaly classification (drop/normal/insufficient_data)
GET /api/v1/analytics/route-dlr-anomalyprovider × destination country) against a learned 14-day baseline (z-score with a floored stddev, plus relative-ratio and absolute-points guards) and flags it drop, normal or insufficient_data. Use it to catch a carrier silently degrading one route — a blocked sender, a filtering change, an upstream wholesale outage — before customers open a ticket; the daily webhook-worker scheduler pages on the same classification. No query parameters. Restricted to owner/admin/developer/viewer; read-only, rate-limited, 60s cached.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Per-route delivery-latency + silent-failure SLO status (ok/breach/insufficient_data)
GET /api/v1/analytics/route-latency-sloprovider × destination country) and classifies it against the delivery-latency SLO (p50/p95 of delivered_at − sent_at) and the silent-failure SLO (share of sends past the 15-min receipt grace still stuck non-terminal — the DLR that never arrived). Use it when a route keeps delivering ~100% but has slowed to minutes, or has silently stopped returning DLRs — the two blind spots the DLR-rate detector cannot see; the hourly webhook-worker sweep pages on the same thresholds. No query parameters. Restricted to owner/admin/developer/viewer; read-only, rate-limited, 60s cached.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.List satisfaction goals (CSAT / NPS / CES targets + progress)
GET /api/v1/analytics/satisfaction-goalswindow_days lookback, so the surface never reports a stale figure. Use it to power a CX OKR widget; any authenticated member with analytics:read scope.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Get one satisfaction goal with live progress
GET /api/v1/analytics/satisfaction-goals/{id}analytics:read scope.
string
required
—
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.List scheduled analytics reports
GET /api/v1/analytics/scheduled-reportslast_sent_at, the display next_send_at and whether it is enabled. Keyset-paginated: pass cursor (the opaque nextCursor from the previous page) and limit (1–200, default 200). Any authenticated member with analytics:read scope.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Portfolio-level conversation sentiment analytics
GET /api/v1/analytics/sentimenttotals roll-up, a chronological trend (hour buckets for 24h, day buckets otherwise), and breakdowns by_channel, by_agent, by_language, and by_resolution — each bucket carrying total, avg_score, the label counts, and a net_sentiment index in [-100, 100]. Query params: window (24h|7d|30d|90d, default 7d), optional channel and optional language (BCP-47 short code, e.g. en, es; unknown matches pre-enrichment messages). Use it to monitor experience week-on-week and find which channel, agent, or locale is degrading. Read-only; owner/admin/developer/viewer; 60s cached.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.SMS click-through reporting parity panel
GET /api/v1/analytics/sms-click-throughgroup (campaign|queue, default campaign), window (24h|7d|30d, default 7d), page + pageSize (≤100, default 25). CTR denominators only count sends that actually carried a tracked link; click_rate is null when the bucket carried no tracked sends. Read-only; owner/admin/developer/viewer; 60s cached.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Telegram-specific KPIs
GET /api/v1/analytics/telegramtotals (total_outbound, bot_blocked_count/rate — the share of sends the Bot API rejected with a 403 user-blocked/chat-not-found family error — and custom_emoji_count/rate), group_vs_dm (DM vs non-DM volume plus a per-chat-type breakdown over private/group/supergroup/channel), and a daily trend keyed by period. Accepts the shared date-range params (start_date/end_date or days). Use it for the Telegram KPI cards on the analytics dashboard. Read-only; owner/admin/developer/viewer; 60s cached.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Cross-channel topic & contact-reason intelligence
GET /api/v1/analytics/topic-intelligencecurrent_since, previous_since), the current-window conversation count, and up to 50 trending topics — each with current vs prior volume, change_pct, a rising/falling/stable trend direction, the per-channel volume split, outcome rollups (avg_csat, deflection_rate, avg_aht_seconds), and up to 5 linked example threads. Query params: window (24h|7d|30d|90d, default 30d) and optional channel (voice|sms|whatsapp|email|web_chat). Read-only; owner/admin/developer/viewer; 60s cached.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Aggregate usage & delivery anomaly snapshot
GET /api/v1/analytics/usage-anomaliesspike or drop. Each metric entry carries the current value, baseline mean/stddev, signed z-score, ratio, sample size, a status (spike|drop|normal|insufficient_data), and an anomalous flag; the snapshot also echoes computed_at, bucket_start, baseline_hours, and a summary count block. Use it to catch a tenant-wide traffic stall (broken integration) or a runaway cost surge that per-route detectors are too narrow to see. Read-only; owner/admin/developer/viewer; 60s cached.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Recent activity feed
GET /api/v1/stats/activity?limit= to size the feed (default 20, max 100) and ?since_hours to bound the server-side query to the trailing N hours (max 8760) so time-range controls re-query real history instead of re-slicing a fixed top-100 feed. An always-on widget — transient database availability degrades to an empty feed (200) rather than an error.
integer
Number of recent activity items to return (default 20, max 100).
integer
Optional window bound — only return activity from the trailing N hours.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Agent and conversation statistics
GET /api/v1/stats/agentsstring (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Advanced message analytics
GET /api/v1/stats/analytics?days= (default 30, max 365) or an explicit start_date / end_date pair to select the window. Requires the advanced-analytics feature flag; otherwise returns 403.
integer
Trailing window in days (default 30, capped at 365). An explicit
start_date / end_date pair takes precedence over days.string
Window start date in YYYY-MM-DD local tenant time. Must be used together with
end_date.string
Window end date in YYYY-MM-DD local tenant time. Must be used together with
start_date.string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Per-channel analytics breakdown
GET /api/v1/stats/analytics/channels?days= (default 30, max 365) or an explicit start_date / end_date pair to select the window. Requires the advanced-analytics feature flag; otherwise returns 403.
integer
Trailing window in days (default 30, capped at 365). An explicit
start_date / end_date pair takes precedence over days.string
Window start date in YYYY-MM-DD local tenant time. Must be used together with
end_date.string
Window end date in YYYY-MM-DD local tenant time. Must be used together with
start_date.string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Delivery funnel for the window
GET /api/v1/stats/analytics/delivery?days= (default 30, max 365) or an explicit start_date / end_date pair to select the window. Requires the advanced-analytics feature flag; otherwise returns 403.
integer
Trailing window in days (default 30, capped at 365). An explicit
start_date / end_date pair takes precedence over days.string
Window start date in YYYY-MM-DD local tenant time. Must be used together with
end_date.string
Window end date in YYYY-MM-DD local tenant time. Must be used together with
start_date.string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Analytics summary for the window
GET /api/v1/stats/analytics/summary?days= (default 30, max 365) or an explicit start_date / end_date pair to select the window; only the counts you need are returned — cheaper than the full analytics payload. Requires the advanced-analytics feature flag; otherwise returns 403.
integer
Trailing window in days (default 30, capped at 365). An explicit
start_date / end_date pair takes precedence over days.string
Window start date in YYYY-MM-DD local tenant time. Must be used together with
end_date.string
Window end date in YYYY-MM-DD local tenant time. Must be used together with
start_date.string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Daily message volume timeline
GET /api/v1/stats/analytics/volume?days= (default 30, max 365) or an explicit start_date / end_date pair to select the window. Requires the advanced-analytics feature flag; otherwise returns 403.
integer
Trailing window in days (default 30, capped at 365). An explicit
start_date / end_date pair takes precedence over days.string
Window start date in YYYY-MM-DD local tenant time. Must be used together with
end_date.string
Window end date in YYYY-MM-DD local tenant time. Must be used together with
start_date.string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Per-channel operational health
GET /api/v1/stats/channel-healthstring (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Contact count and growth statistics
GET /api/v1/stats/contactsstring (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Conversation intelligence analytics
GET /api/v1/stats/conversation-intelligence?days= query param (default 30, max 365) to widen or narrow the trailing window. Powers the dashboard Conversation Intelligence page; a handled 200 with empty aggregates renders like a fresh tenant.
integer
Trailing window in days (default 30, capped at 365).
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Unified home-overview dashboard
GET /api/v1/stats/dashboard?days= query param (default 30, max 365) for the usage-timeline window. Prefer this over polling the four widget routes individually — each leg shares cache keys with those routes. An always-on read — transient database availability degrades to a zero-valued payload (200) rather than an error.
integer
Usage-timeline window in days (default 30, capped at 365).
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Flow execution statistics
GET /api/v1/stats/flowsstring (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.SMS gateway operational health
GET /api/v1/stats/gateway/smsstring (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Phone number inventory statistics
GET /api/v1/stats/numbersstring (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.API request logs for the tenant
GET /api/v1/stats/request-logsmethod, status, path, api_key (API-key prefix), or request_id; bound the window with days or a start_date / end_date pair; page with cursor (and limit, max 100, default 50). Each entry carries timestamp, method, path, status, latency in ms, caller IP, user agent, request id, response size, and the W3C trace id for cross-system correlation.
integer
Page size (default 50, max 100).
string
Pagination cursor from a previous response’s
next_cursor.string
HTTP method filter (e.g. GET, POST).
string
HTTP status filter (e.g. 200, 4xx, 5xx).
string
Request path substring filter.
integer
Trailing window in days (capped at 365). An explicit
start_date / end_date pair takes precedence.string
Window start date in YYYY-MM-DD. Must be used together with
end_date.string
Window end date in YYYY-MM-DD. Must be used together with
start_date.string
API-key prefix filter — only requests made with keys matching this prefix.
string
Exact request correlation id — drill down to a single request.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.SMS channel statistics
GET /api/v1/stats/smsstring (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Dashboard summary cards
GET /api/v1/stats/summarystring (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Per-day usage timeline
GET /api/v1/stats/usage?days= (default 30, max 365) or an explicit start_date / end_date pair — the explicit pair takes precedence. Each row carries date plus one counter key per channel. An always-on read — transient database availability degrades to an empty timeline (200) rather than an error.
integer
Trailing window in days (default 30, capped at 365). An explicit
start_date / end_date pair takes precedence over days.string
Window start date in YYYY-MM-DD. Must be used together with
end_date.string
Window end date in YYYY-MM-DD. Must be used together with
start_date.string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Voice call statistics
GET /api/v1/stats/voicestring (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.WhatsApp channel statistics
GET /api/v1/stats/whatsappstring (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Resolve a plain-English question to a governed widget
POST /api/v1/analytics/copilot/askquestion, up to 500 chars) about messaging / voice / CDP data into a governed resolution: which dashboard-widget-catalog chart answers it and the resolved params to fetch it with. Deterministic — resolved to a pre-approved widget, never a synthesised query — so the answer always maps to an existing tenant-scoped read endpoint. Read-only (POST only because the question is a body); owner/admin/developer/viewer.
string
Stripe-style idempotency token. Pass a stable, client-generated value (1-255 chars) to dedupe retries on transient timeouts. The same key+credential+path replays the original response for 24h on 2xx (5min on 4xx, 30s on 5xx). Returns 409 if a concurrent request with the same key is already in flight; replayed responses include the
Idempotency-Replay: true response header.string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Mint a signed embeddable dashboard share link
POST /api/v1/analytics/dashboards/sharettl_days clamps the link lifetime. Body: the validate-layout shape, optionally wrapped as { layout, ttl_days, title }. Minting a public link to tenant analytics is gated to owner/admin.
string
Stripe-style idempotency token. Pass a stable, client-generated value (1-255 chars) to dedupe retries on transient timeouts. The same key+credential+path replays the original response for 24h on 2xx (5min on 4xx, 30s on 5xx). Returns 409 if a concurrent request with the same key is already in flight; replayed responses include the
Idempotency-Replay: true response header.string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Validate and normalise a dashboard layout
POST /api/v1/analytics/dashboards/validatestring
Stripe-style idempotency token. Pass a stable, client-generated value (1-255 chars) to dedupe retries on transient timeouts. The same key+credential+path replays the original response for 24h on 2xx (5min on 4xx, 30s on 5xx). Returns 409 if a concurrent request with the same key is already in flight; replayed responses include the
Idempotency-Replay: true response header.string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Create a conversion goal
POST /api/v1/analytics/goalspixel_fire, webhook_hit, manual, tag_added, or custom_event), optionally a value per conversion, a lookback window (1-180 days, default 7), and an attribution model (last_touch default — also first_touch, linear, time_decay). For pixel_fire goals the response includes the signed pixel URL to embed. Owner/admin/developer role required.
string
Stripe-style idempotency token. Pass a stable, client-generated value (1-255 chars) to dedupe retries on transient timeouts. The same key+credential+path replays the original response for 24h on 2xx (5min on 4xx, 30s on 5xx). Returns 409 if a concurrent request with the same key is already in flight; replayed responses include the
Idempotency-Replay: true response header.string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Create backfill
POST /api/v1/analytics/goals/{id}/backfillstring
required
—
string
Stripe-style idempotency token. Pass a stable, client-generated value (1-255 chars) to dedupe retries on transient timeouts. The same key+credential+path replays the original response for 24h on 2xx (5min on 4xx, 30s on 5xx). Returns 409 if a concurrent request with the same key is already in flight; replayed responses include the
Idempotency-Replay: true response header.string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Record a conversion on a goal
POST /api/v1/analytics/goals/{id}/recordAuthorization: HMAC <contact_id>:<signature>) — the signature is verified against the body’s contact id, otherwise the authenticated dashboard session supplies it. Optional body fields: contact_id, value_cents, metadata. Responds 401 when the HMAC check fails.
string
required
—
string
Stripe-style idempotency token. Pass a stable, client-generated value (1-255 chars) to dedupe retries on transient timeouts. The same key+credential+path replays the original response for 24h on 2xx (5min on 4xx, 30s on 5xx). Returns 409 if a concurrent request with the same key is already in flight; replayed responses include the
Idempotency-Replay: true response header.string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Create a KPI alert rule
POST /api/v1/analytics/kpi-alert-rules{ name, metric, mode, comparator?, threshold?, window_days?, notify_channels?, cooldown_hours?, enabled? }. Use mode: "threshold" for an explicit cutoff (needs comparator + threshold, e.g. < 80 on CSAT) or mode: "anomaly" to let the rule train on its own z-score baseline. Capped at 50 rules per organization (422 above that); the evaluator runs on a schedule and notifies via the requested channels. Owner/admin/developer role required; audit-logged. Returns the created rule (201).
string
Stripe-style idempotency token. Pass a stable, client-generated value (1-255 chars) to dedupe retries on transient timeouts. The same key+credential+path replays the original response for 24h on 2xx (5min on 4xx, 30s on 5xx). Returns 409 if a concurrent request with the same key is already in flight; replayed responses include the
Idempotency-Replay: true response header.string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Evaluate KPI alert rules on demand
POST /api/v1/analytics/kpi-alert-rules/evaluatestring
Stripe-style idempotency token. Pass a stable, client-generated value (1-255 chars) to dedupe retries on transient timeouts. The same key+credential+path replays the original response for 24h on 2xx (5min on 4xx, 30s on 5xx). Returns 409 if a concurrent request with the same key is already in flight; replayed responses include the
Idempotency-Replay: true response header.string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Create a satisfaction goal
POST /api/v1/analytics/satisfaction-goalsname (≤160 chars), metric (csat | nps | ces), target (range-checked against the metric’s native scale — CSAT 0–100, NPS −100..100, CES 0–10), optional survey_id (UUID; when set it must point at a LIVE survey whose type matches the metric, else 422 — a mismatched pointer would silently report zero forever; omit it for the tenant-wide aggregate over all surveys of that type), optional window_days (1–365, default 30) and enabled (default true). A tenant may hold at most 50 goals (they live on the org settings blob, not a table). The metric’s current value at creation is captured as the baseline — the progress origin. Requires owner / admin / developer; returns 201 with the created goal.
string
Stripe-style idempotency token. Pass a stable, client-generated value (1-255 chars) to dedupe retries on transient timeouts. The same key+credential+path replays the original response for 24h on 2xx (5min on 4xx, 30s on 5xx). Returns 409 if a concurrent request with the same key is already in flight; replayed responses include the
Idempotency-Replay: true response header.string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Create a scheduled analytics report
POST /api/v1/analytics/scheduled-reportsname (≤120 chars), type (messaging_volume | deliverability | top_contacts | spend | custom — custom runs the saved query in filters.saved_query, and filters.dataset may select a non-messaging dataset such as queue_performance), frequency (daily | weekly | monthly), recipients (array of emails or a single comma-separated string), optional filters, enabled (default true) and timezone (IANA zone the 09:00 cadence anchors to). The first send is scheduled on the next cadence tick. Requires owner/admin; returns 201 with the created report.
string
Stripe-style idempotency token. Pass a stable, client-generated value (1-255 chars) to dedupe retries on transient timeouts. The same key+credential+path replays the original response for 24h on 2xx (5min on 4xx, 30s on 5xx). Returns 409 if a concurrent request with the same key is already in flight; replayed responses include the
Idempotency-Replay: true response header.string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Send a scheduled report immediately
POST /api/v1/analytics/scheduled-reports/{id}/send-nowlast_sent_at to show delivery progress. The report is owned by the caller’s organization; returns 200 with { id, queued: true }, 404 when the id does not resolve. Supports the Idempotency-Key header. Requires owner/admin.
string
required
—
string
Stripe-style idempotency token. Pass a stable, client-generated value (1-255 chars) to dedupe retries on transient timeouts. The same key+credential+path replays the original response for 24h on 2xx (5min on 4xx, 30s on 5xx). Returns 409 if a concurrent request with the same key is already in flight; replayed responses include the
Idempotency-Replay: true response header.string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Update a goal
PATCH /api/v1/analytics/goals/{id}string
required
—
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Update a KPI alert rule
PATCH /api/v1/analytics/kpi-alert-rules/{id}mode is “threshold” must keep a comparator and a finite threshold (422 otherwise); a bare empty body is rejected (422). Returns the updated rule DTO with registry display metadata. Owner/admin/developer role required; audit-logged.
string
required
—
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Update a satisfaction goal
PATCH /api/v1/analytics/satisfaction-goals/{id}name, target, survey_id, window_days and enabled are all optional but at least one must be provided. metric is immutable: a goal’s metric fixes its scale and the baseline captured at creation, so changing it would silently invalidate stored progress. The new target is range-checked against the STORED metric; a (re)pointed survey_id must resolve to a live survey of the same type, exactly as on create. Returns 404 for an unknown id. Requires owner / admin / developer; returns the updated goal with live progress.
string
required
—
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Update a scheduled analytics report
PATCH /api/v1/analytics/scheduled-reports/{id}frequency re-anchors the cadence from the last send; the derived next tick can never land in the past. Requires owner/admin; returns the updated report.
string
required
—
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Delete a goal
DELETE /api/v1/analytics/goals/{id}string
required
—
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Delete a KPI alert rule
DELETE /api/v1/analytics/kpi-alert-rules/{id}{ id, deleted: true } in the standard { data, meta } envelope, 404 when the id is unknown. Owner/admin/developer role required; audit-logged.
string
required
—
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Delete a satisfaction goal
DELETE /api/v1/analytics/satisfaction-goals/{id}{ id, deleted: true }; 404 when the id does not resolve to one of the org’s goals. Requires owner / admin / developer.
string
required
—
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.Delete a scheduled analytics report
DELETE /api/v1/analytics/scheduled-reports/{id}{ id, deleted: true }; 404 when the id does not resolve to one of the org’s reports. Requires owner/admin.
string
required
—
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests. Set to
true to route the call through the test-mode pipeline: no real provider delivery, no credits deducted, response meta.test_mode: true. Ignored for live API keys (dv_live_sk_*) — server-to-server clients must use a test-prefixed key (dv_test_sk_*) to exercise sandbox. Test-prefixed keys unconditionally enable sandbox regardless of this header.