PPactDocs
Administration

Survey detail

The per-survey results view: raw responses, the score summary (NPS/CSAT/CES), the time-bucketed trend, and an intelligence panel with themes, sentiment, anomalies, and an AI-or-templated executive summary.

Survey detail

The survey detail view turns a stream of responses into a scored, trended, and summarized picture of sentiment. Everything is served from the survey's own endpoints under /v1/surveys/{survey_id}, all tenant-scoped.

Responses

code
GET /v1/surveys/{survey_id}/responses?limit=50&offset=0

Lists raw responses newest-first with a total count — the score, the optional verbatim comment, the band, and when it came in.

Score summary

code
GET /v1/surveys/{survey_id}/summary

Aggregate score and a full distribution across the type's scale. The headline metric is computed the standard way for each instrument:

  • NPS = % promoters (9–10) − % detractors (0–6). The payload also breaks out promoters, passives (7–8), and detractors.
  • CSAT = % satisfied, where "satisfied" is the top-2 box (4–5 on a 1–5 scale).
  • CES = mean score on the 1–7 scale, plus an "easy" top-2-box rate (6–7).

Trend

code
GET /v1/surveys/{survey_id}/trend?days=90&bucket=week

A time-bucketed series (by day or week) over the window. Each bucket carries the response count and the type-appropriate headline score; empty buckets are still emitted (with count = 0) so the chart draws a continuous line.

Intelligence

code
GET /v1/surveys/{survey_id}/intelligence?days=30

A single payload the results page renders into its Intelligence section (core/surveys/intelligence.py):

  • Themes — keyword/phrase extraction over verbatim comments (extract_themes).
  • Sentiment — a positive/neutral/negative breakdown (sentiment_breakdown).
  • Anomalies — statistical detection of unusual shifts (detect_anomalies).
  • Executive summary — a narrative recap plus a source field.

AI summary degrades gracefully

Theme, sentiment, and anomaly extraction are fully deterministic — they need no AI provider and always run. The executive summary uses the tenant's configured AI provider when available, but falls back to a templated summary (and reports source: "template") when no provider is configured, the AI call errors, or a kill switch is active. The templated summary is honest about being templated — it surfaces the data without pretending to be generated prose. Per Pact's credentials rule, AI keys live in tenant_integration_credentials and are set through the UI, never in a request.

From insight to action

A detractor comment surfaced here is not just a data point — if the detractor-to-task rule is enabled, that same response already created a save task for the account owner. Use the intelligence panel for the pattern; rely on closed-loop automation for the per-response follow-up.