Insights API
Insights endpoints exposed by the Devotel CPaaS API Base path:/api/v1/insights
Endpoint count: 42
title: “Worked insights queries” description: “LLM-spend drill-downs, anomaly rollups, agent benchmarks, attribution chains, containment trends, and quality evals — each as a full send → envelope → drill-in chain.”
Worked insights queries
Every operation below is catalogued on this page, but the values you branch on — a spend spike’s driver, a containment trend, an anomaly scope — are easiest to learn as reader chains. The chains below answer a real operator question end to end and show the exact{ data, meta } envelope at each
step so you can slice the field path you actually need.
Scope of this overlay:
- Chains 1–6 cover the most-used reads head-first. Chains 7–11 pick up the GET operations those chains did not name — the remaining LLM-spend reads (overview, timeseries, top-conversations, by-feature, by-model, budget, model-caps), the agent comparison and per-language quality reads, and conversation P&L — each with the same send → envelope → drill-in shape.
- All samples show cURL and TypeScript — the generated operations above show all six languages on the first 15 blocks, cURL and TypeScript on the rest.
- Samples use a sandbox key (
dv_test_sk_your_test_key_here). A test-prefixed key unconditionally runs in sandbox and deducts no credits; swap to yourdv_live_sk_*key in production. See Sandbox. - All reads are tenant-scoped, read-only analytic aggregates over your own data. No provider account or compliance scope is touched; the tenant controls every filter, window, and scope parameter.
Insights envelope responses share one shape: data carries the
payload, meta.request_id and meta.timestamp identify the read. Chain on
data, log meta.request_id when you report a discrepancy to support. The
worked envelopes below use req_insights_* placeholders — a real response
returns a server-issued id in the same shape.
1. Which model drove the LLM spend spike
Start from the period summary, drill into the breakdown by model, then confirm against cost-economics so you see spend in the same window as your other AI economics.GET /api/v1/insights/llm-spend/summary
200
GET /api/v1/insights/llm-spend/by-model breaks
spend per model; GET /api/v1/insights/llm-spend/by-feature breaks it per
feature surface. Slice data.models[] (or data.features[]) for the rows
that moved.
200
GET /api/v1/insights/cost-economics returns the platform side (provider
and inference cost per conversation) so you can reconcile the spike against
what those conversations actually cost the whole platform, not only the
model tier.
200
2. Compare anomaly scopes and page history rollups
The anomaly surface answers “where did the spike come from?” —GET /api/v1/insights/anomaly-insights/by-scope ranks the affected scopes
(feature, model, agent, channel) so you slice against the right dimension
before paging the ledger.
200
GET /api/v1/insights/anomaly-insights/history
returns a cursor-paged list. Pass the previous page’s next token back as
cursor until it comes back null.
200
3. Benchmark and QA sample queries
Score before/after comparisons on a benchmark —GET /api/v1/insights/ agent-benchmarks returns a ranked list of quality/funnel scores so you
compare two AI agents, two model versions, or your agent against a human
queue.
200
GET /api/v1/insights/agent-quality/by-language
endpoint breaks the same score down per conversation language, and
GET /api/v1/insights/language-quality ranks phrasing/coverage issues —
slice data.rows[] to the sample conversations you want to re-check.
4. Attribution: funnel steps → journey paths → conversion goal
Attribution chains answer “which step dropped the funnel?” —GET /api/v1/insights/call-attribution attributes conversion credit to
call and message touches, GET /api/v1/insights/automation-opportunities
ranks the funnel steps where automation covers the drop, and
GET /api/v1/insights/agent-roi/timeseries trends goal conversion over
the window.
200
GET /api/v1/insights/automation- opportunities — it returns candidate funnel steps ranked by the recoverable
volume per step.
200
GET /api/v1/insights/agent-roi/timeseries —
data.points[] carries the per-bucket conversion so you can chart the
recovery against the anomaly window you paged in chain 2.
5. Containment trend + talk ratio
Containment answers “how many conversations resolve without a human?” —GET /api/v1/insights/containment returns the current rate, then
GET /api/v1/insights/containment/timeseries trends the same metric over
the window so you see whether a prompt or KB change moved it.
200
200
6. Quality eval scores
Voice and conversation quality evals answer “is the agent answering well?” —GET /api/v1/insights/sales-conversation-intelligence returns the latest
scored conversations and their eval dimensions (rapport, coverage, objection
handling). Pair with GET /api/v1/insights/containment from chain 5 to see
whether a low eval score also pushed the transfer rate up. For segment-level
eval detail, follow with GET /api/v1/insights/agent-quality/by-language
(chain 8) — it breaks rubric pass-rate, containment, and sentiment down per
detected language so you can isolate a quality gap to one locale.
200
7. Read the LLM-spend header, trend, and leaderboard
The LLM-spend header chain answers “where do I stand right now?” — the chain 1 aggregates answered “what drove the spike?”; this one reads the header cards, the trend buckets, and the expensive-conversation leaderboard that the overview page renders. Start with the header:GET /api/v1/insights/llm-spend/overview returns
today’s spend, the month-to-date total with a month-end projection, and the
trailing-7-day average — three fields intentionally return null when a
value is not computable (no daily cap configured, no prior-period baseline,
no spend history), so branch on null before you chart.
200
GET /api/v1/insights/llm-spend/timeseries — bucketed
hourly or daily, in the org’s billing timezone:
200
GET /api/v1/insights/llm-spend/top-conversations — a per-conversation
leaderboard for the window, cheapest drill for “one thread ate my budget”:
200
GET /api/v1/insights/llm-spend/by-feature — it also returns your budget
config and any per-channel threshold breaches in the same envelope:
200
8. Compare agents and isolate a quality gap by language
The comparison chain answers “which of my agents is the better value?” —GET /api/v1/insights/agent-comparison ranks two or more agents side by
side against the org average on cost, attributed revenue, margin,
containment, resolution, and escalation. Pass agentIds as a comma-
separated list of at least two agents.
200
GET /api/v1/insights/agent-quality/by-language (rubric eval pass-rate,
containment, sentiment, CSAT per detected language) — or with the
window-level GET /api/v1/insights/language-quality when you want the
same segmentation without the per-agent filter (chain 3 named it; the
worked envelope here applies to both):
200
9. Read the spend caps before you raise them
The config reads answer “what caps are in force?” —GET /api/v1/insights/ llm-spend/budget returns the persisted budget blob (monthly/daily caps,
per-channel thresholds, the soft-alert percentage, and the automatic model
downshift toggle), GET /api/v1/insights/llm-spend/model-caps returns the
per-model spend caps, and GET /api/v1/insights/agent-roi/config /
GET /api/v1/insights/conversation-pnl/config /
GET /api/v1/insights/cost-economics/config return the per-surface
config the PUT endpoints on this page write. Read the config before you
compose a PUT body — every PUT on this page is a read-merge-write against
its GET envelope.
200
200
10. Cost to serve: conversation P&L
GET /api/v1/insights/conversation-pnl blends telco, LLM, and human-agent
labour into one cost-to-serve per conversation, per resolution, and per
conversion — answer “what does a conversation actually cost me to run?”
with a blended number, not a channel invoice. The labour rate comes from
GET /api/v1/insights/conversation-pnl/config (the PUT on this page sets
it), and the unit economics divide the SAME blended total by each volume
denominator.
200
11. Platform-side economics to pair with spend
GET /api/v1/insights/cost-economics returns the platform cost side
(provider telephony + inference per conversation) in the same window, so a
margin report pairs the revenue surfaces (chains 4 and 10) against what the
traffic costs the platform. Rate overwrites live under
GET/PUT /api/v1/insights/cost-economics/config.
200
Pagination and envelope rules
- Config writes echo the config.
PUTon a*/configroute (and on the LLM-spendbudget/model-capsroutes) returns the new config object in the same shapeGETreports, not an empty body —data.human_agent_cost_per_hour_cents,data.model_caps_cents, or the fulldata.configblock. Some OpenAPI documenters show a202for an accepted PATCH/PUT with no payload; chain ondatafrom the response shown on this page, which the generator fills from the route’s actual controller echo even when the spec carries only2xx. - Cursor pages. Ledger-style list endpoints return
data.items+data.next. Passcursor=<next>to fetch the following page;nullterminates the sequence. Page size defaults are stated on each operation; keep the same filters across pages. - Slice fields. Filter parameters are the tenant surface:
window_days,metric,scope,goal,bucket. Chain 2 shows the cursor loop; every other chain shows the filter-slice. - The
{ data, meta }envelope. Branch ondata; logmeta.request_idwhen a value looks wrong — support can replay it.
Error shapes: scope gap vs parameter issue
Failures come back in the{ error, meta } envelope — branch on
error.code, and quote meta.request_id when you escalate. Two
non-success shapes recur across every Insights operation:
403
422
The dashboard views and per-surface readings live in Insight dashboards, Real-time analytics, Insight costs, and the LLM spend guide. This overlay is envelope-accurate: request, response, and the drill-in call — nothing else.For the dashboard-side walkthrough of the surfaces these endpoints feed, see the Insights guides. Compliance notes: every filter and scope on this page is a tenant-owned control — nothing here touches provider account scope or sends traffic.
Benchmark agents against the org population
GET /api/v1/insights/agent-benchmarksfrom/to, max 365 days); pass agentIds to restrict the comparison population.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests — see Test mode explained for the full credential-header matrix and worked samples. 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 AI agents side by side
GET /api/v1/insights/agent-comparisonagentIds as a comma-separated list of at least two agents; the window defaults to the last 30 days and from/to accept ISO 8601 datetimes bounded to 365 days.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests — see Test mode explained for the full credential-header matrix and worked samples. 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 quality segmented by detected language
GET /api/v1/insights/agent-quality/by-languagefrom/to, max 365 days); limit bounds the displayed language rows (totals are always computed across the full set).
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests — see Test mode explained for the full credential-header matrix and worked samples. 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 per-agent ROI summary
GET /api/v1/insights/agent-roifrom/to ISO datetimes, max 365 days); limit caps the agent rows (≤200).
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests — see Test mode explained for the full credential-header matrix and worked samples. 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 ROI attribution configuration
GET /api/v1/insights/agent-roi/confignull default, empty overrides), so a settings form always renders a stable shape.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests — see Test mode explained for the full credential-header matrix and worked samples. 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 the daily ROI trend
GET /api/v1/insights/agent-roi/timeseriesfrom/to ISO datetimes, max 365 days); pass agentId to scope the trend to one agent instead of the org-wide aggregate.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests — see Test mode explained for the full credential-header matrix and worked samples. 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 anomaly ledger by scope
GET /api/v1/insights/anomaly-insights/by-scope?scope=wallet|webhook; the window defaults to the last 30 days (days, or from/to ISO datetimes, up to 365 days).
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests — see Test mode explained for the full credential-header matrix and worked samples. 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 anomaly ledger items
GET /api/v1/insights/anomaly-insights/history?scope=wallet|webhook and page with ?limit (≤100 per page); the window defaults to the last 30 days (days, or from/to ISO datetimes, up to 365 days).
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests — see Test mode explained for the full credential-header matrix and worked samples. 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.Anomaly counts over time
GET /api/v1/insights/anomaly-insights/timeseries?scope=wallet|webhook; the window defaults to the last 30 days (days, or from/to ISO datetimes, up to 365 days).
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests — see Test mode explained for the full credential-header matrix and worked samples. 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 ranked automation opportunities
GET /api/v1/insights/automation-opportunities/automation-opportunities/config. The window defaults to the last 30 days (from/to, max 365 days); limit caps the returned opportunity count.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests — see Test mode explained for the full credential-header matrix and worked samples. 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 automation ROI assumptions
GET /api/v1/insights/automation-opportunities/configstring (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests — see Test mode explained for the full credential-header matrix and worked samples. 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 inbound-call marketing attribution
GET /api/v1/insights/call-attributionfrom/to ISO datetimes, max 365 days).
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests — see Test mode explained for the full credential-header matrix and worked samples. 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 AI-agent containment summary
GET /api/v1/insights/containmentfrom/to ISO datetimes, max 365 days); limit caps the agent rows (≤200).
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests — see Test mode explained for the full credential-header matrix and worked samples. 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 the daily containment trend
GET /api/v1/insights/containment/timeseriesfrom/to ISO datetimes, max 365 days); pass agentId to scope the trend to one agent instead of the org-wide aggregate.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests — see Test mode explained for the full credential-header matrix and worked samples. 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 blended cost-to-serve summary
GET /api/v1/insights/conversation-pnlfrom/to ISO datetimes, max 365 days).
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests — see Test mode explained for the full credential-header matrix and worked samples. 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 P&L labour-rate configuration
GET /api/v1/insights/conversation-pnl/confignull, meaning the platform default applies, so the settings form always renders a stable shape.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests — see Test mode explained for the full credential-header matrix and worked samples. 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 cross-channel unit economics
GET /api/v1/insights/cost-economicsnull when the channel’s volume is zero. The window defaults to the last 30 days (from/to ISO datetimes, max 365 days).
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests — see Test mode explained for the full credential-header matrix and worked samples. 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 cost-economics rate configuration
GET /api/v1/insights/cost-economics/confignull, meaning the platform reference rate applies.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests — see Test mode explained for the full credential-header matrix and worked samples. 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 KB auto-draft configuration
GET /api/v1/insights/kb-auto-draft/configstring (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests — see Test mode explained for the full credential-header matrix and worked samples. 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 language-segmented quality summary
GET /api/v1/insights/language-qualityfrom/to ISO datetimes, max 365 days).
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests — see Test mode explained for the full credential-header matrix and worked samples. 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 AI budget configuration
GET /api/v1/insights/llm-spend/budgetstring (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests — see Test mode explained for the full credential-header matrix and worked samples. 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 AI spend by feature
GET /api/v1/insights/llm-spend/by-featurefrom/to ISO datetimes, max 365 days).
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests — see Test mode explained for the full credential-header matrix and worked samples. 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 AI spend by model
GET /api/v1/insights/llm-spend/by-modelfrom/to ISO datetimes, max 365 days).
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests — see Test mode explained for the full credential-header matrix and worked samples. 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 per-model spend caps
GET /api/v1/insights/llm-spend/model-capsstring (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests — see Test mode explained for the full credential-header matrix and worked samples. 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 AI-spend headline stats
GET /api/v1/insights/llm-spend/overviewstring (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests — see Test mode explained for the full credential-header matrix and worked samples. 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 grouped AI-spend summary
GET /api/v1/insights/llm-spend/summaryfrom/to ISO datetimes, max 365 days); groupBy picks the grouping (default agent) and limit (≤200) caps the group rows. All money fields are integer cents.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests — see Test mode explained for the full credential-header matrix and worked samples. 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 AI-spend trend buckets
GET /api/v1/insights/llm-spend/timeseriesgranularity=day for longer ranges (max 365 days). The window defaults to 30 days at day-grain or 7 days at hour-grain. All money fields are integer cents.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests — see Test mode explained for the full credential-header matrix and worked samples. 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 top-spending conversations
GET /api/v1/insights/llm-spend/top-conversationsfrom/to ISO datetimes, max 365 days); limit (≤50) caps the returned rows. All money fields are integer cents.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests — see Test mode explained for the full credential-header matrix and worked samples. 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 no-match miner configuration
GET /api/v1/insights/no-match-questions/configenabled: false), so the settings form always renders a stable shape.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests — see Test mode explained for the full credential-header matrix and worked samples. 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 sales conversation intelligence summary
GET /api/v1/insights/sales-conversation-intelligence?days (1–90, default 30). Configure the feature flag and competitor tracker terms via /sales-conversation-intelligence/config.
string (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests — see Test mode explained for the full credential-header matrix and worked samples. 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 sales intelligence configuration
GET /api/v1/insights/sales-conversation-intelligence/configstring (enum: true|false)
Sandbox opt-in for Clerk-session-authenticated requests — see Test mode explained for the full credential-header matrix and worked samples. 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.Run the KB auto-draft miner
POST /api/v1/insights/kb-auto-draft/runstring
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 — see Test mode explained for the full credential-header matrix and worked samples. 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.Run the no-match query miner
POST /api/v1/insights/no-match-questions/runstring
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 — see Test mode explained for the full credential-header matrix and worked samples. 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 ROI attribution configuration
PUT /api/v1/insights/agent-roi/configdefault_outcome_value_cents: null to clear the default and per_rubric_value_cents as a rubric-id → integer-cents map (≤500 overrides). No money moves on this call — the values only change how outcome revenue is attributed. The updated, persisted configuration is returned.
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 — see Test mode explained for the full credential-header matrix and worked samples. 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.integer
Default attributed value of one resolved outcome, in integer cents (null clears the default).
object
Per-rubric attributed values in integer cents, keyed by rubric id (at most 500 overrides).
Update automation ROI assumptions
PUT /api/v1/insights/automation-opportunities/configstring
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 — see Test mode explained for the full credential-header matrix and worked samples. 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.integer
Human agent cost per hour, integer cents.
integer
Automation cost per handled contact, integer cents.
number
Target deflection rate as a fraction between 0 and 1.
integer
Default average handle time in seconds used when no measured value exists.
integer
Minimum monthly contact volume a reason needs to qualify as an opportunity.
Update P&L labour-rate configuration
PUT /api/v1/insights/conversation-pnl/confignull clears the override back to the platform default. The updated, persisted configuration is returned.
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 — see Test mode explained for the full credential-header matrix and worked samples. 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.integer
Hourly rate used to price human-agent handle time, in integer cents (null clears the override).
Update cost-economics rate configuration
PUT /api/v1/insights/cost-economics/confignull falls back to the platform reference rate. The updated, persisted configuration is returned.
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 — see Test mode explained for the full credential-header matrix and worked samples. 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.integer
SMS cost per message, integer cents (null clears the override).
integer
WhatsApp cost per message, integer cents (null clears the override).
integer
Voice cost per minute, integer cents (null clears the override).
integer
AI cost per 1,000 tokens, integer cents (null clears the override).
integer
Video cost per minute, integer cents (null clears the override).
Update KB auto-draft configuration
PUT /api/v1/insights/kb-auto-draft/configenabled to toggle the miner, max_drafts_per_run to bound the drafts per run; omitted fields keep their current values and the updated, persisted configuration is returned.
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 — see Test mode explained for the full credential-header matrix and worked samples. 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.boolean
Whether the auto-draft miner runs for this workspace.
integer
Maximum draft articles filed per run.
Update AI budget configuration
PUT /api/v1/insights/llm-spend/budgetnull to remove a cap), alert threshold percentage, and the automatic model-downshift policy. Send a partial body; omitted fields keep their current values (read-merge-write). The updated, persisted configuration is returned.
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 — see Test mode explained for the full credential-header matrix and worked samples. 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.integer
Monthly AI-spend cap in integer cents (null removes the cap).
integer
Daily AI-spend cap in integer cents (null removes the cap).
integer
Advisory monthly cap for speech-to-text spend, integer cents (null removes it).
object
Per-channel threshold map (channel name → integer cents).
integer
Percentage of cap at which an alert trips (1–100).
object
—
number
required
Hard daily spend ceiling in USD cents. Refuses LLM enqueue past the threshold; 200 = $2.00/day.
number
Optional monthly ceiling in USD cents (resets on the 1st). When omitted, only the daily cap applies.
number
Percent (10–99) at which a budget-exhausting advisory webhook fires before the hard cap.
Update per-model spend caps
PUT /api/v1/insights/llm-spend/model-capsmodel_caps_cents is omitted the currently persisted caps are kept (read-merge-write). The updated, persisted configuration is returned.
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 — see Test mode explained for the full credential-header matrix and worked samples. 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.object
Map of model id → cap in integer cents. Omitted keeps the current caps.
Update no-match miner configuration
PUT /api/v1/insights/no-match-questions/configenabled toggles the scheduled miner, min_volume and min_cluster_volume set the floors a no-match reason or unknown-topic cluster must reach to surface, max_suggestions (≤50) bounds the results per run; omitted fields keep their current values and the updated, persisted configuration is returned.
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 — see Test mode explained for the full credential-header matrix and worked samples. 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.boolean
Whether the no-match miner runs for this workspace (default
false).integer
Conversation volume a mapped reason must reach before it surfaces.
integer
Distinct transcripts an unknown-topic cluster needs before it surfaces.
integer
Maximum clusters and suggestions returned per run (≤50).
Update sales intelligence configuration
PUT /api/v1/insights/sales-conversation-intelligence/configenabled toggles the per-call analyzer, competitor_trackers is the list of competitor terms matched against transcripts (≤50 terms, ≤64 characters each); omitted fields keep their current values and the updated, persisted configuration is returned.
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 — see Test mode explained for the full credential-header matrix and worked samples. 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.boolean
Whether the per-call sales-intelligence analyzer runs for this workspace.
string[]
Competitor tracker terms matched against call transcripts (≤50 terms, ≤64 characters each).