pingx.aiAPI docs Markdown

Analytics reference

Every Analytics endpoint with parameters, request and response fields, required scope and a curl example.

Every Analytics endpoint. Base URL https://api.pingx.ai; send Authorization: Bearer <API key>. Read endpoints need analytics:read (or :write), write endpoints need analytics:write; the bare analytics scope grants both. See Authentication and conventions. Machine-readable: openapi.json.

4 endpoints

MethodPathOperationScope
GET/analytics/v1/branch-leaderboardGetBranchLeaderboardread
GET/analytics/v1/call-volumeGetCallVolumeread
GET/analytics/v1/custom-metricsGetCustomMetricsread
GET/analytics/v1/nps-trendGetNpsTrendread

#GET /analytics/v1/branch-leaderboard

GetBranchLeaderboard · needs analytics:read (or write)

Returns every branch's NPS over the whole lookback window (not per day), best NPS first, with its response and detractor counts. Use it to find the best and worst performing branches/locations. Read-only and idempotent.

Query parameters

NameTypeDescription
daysintegerLookback window in calendar days ending today (inclusive). <= 0 means 30; maximum 180 (larger values are clamped).

Response GetBranchLeaderboardResponse

FieldTypeDescription
rowsBranchLeaderboardRow[]Branches, best NPS first.
rows[].branchstringBranch (location) name as recorded on the survey responses.
rows[].npsnumberNPS over the whole lookback window (not per day), from -100 to 100.
rows[].responsesintegerNumber of NPS responses in the window.
rows[].detractorsintegerNumber of detractor responses in the window.
daysintegerThe effective lookback window in days after defaulting/clamping.
curl "https://api.pingx.ai/analytics/v1/branch-leaderboard" \
  -H "Authorization: Bearer $PINGX_API_KEY"

#GET /analytics/v1/call-volume

GetCallVolume · needs analytics:read (or write)

Returns how many calls were placed and how many completed in the last "days" days. Read-only and idempotent. For individual calls use the voice API.

Query parameters

NameTypeDescription
daysintegerLookback window in calendar days ending today (inclusive). <= 0 means 30; maximum 180 (larger values are clamped).

Response GetCallVolumeResponse

FieldTypeDescription
callsPlacedintegerCalls placed (attempted) in the window, across AI personas, human operators and feedback calls.
callsDoneintegerCalls that completed in the window.
daysintegerThe effective lookback window in days after defaulting/clamping.
curl "https://api.pingx.ai/analytics/v1/call-volume" \
  -H "Authorization: Bearer $PINGX_API_KEY"

#GET /analytics/v1/custom-metrics

GetCustomMetrics · needs analytics:read (or write)

Returns the organization's custom metrics: numeric fields the AI extracts from every call according to the organization's custom-field configuration (for example "customer satisfaction 1-5"), as daily average series per AI agent (persona) or for human operators, together with AI-generated "what is working / what is not" insights where enough calls exist. Filter to one agent with agentId, or to human operators with humanOperatorsOnly. Read-only and idempotent.

Query parameters

NameTypeDescription
daysintegerLookback window in calendar days ending today (inclusive). <= 0 means 30; maximum 180 (larger values are clamped).
agentIdstring (int64)Restrict to the series produced by one AI agent (persona). The id comes from the agents API. 0 (default) means every scope ("all personas").
humanOperatorsOnlybooleanWhen true, restrict to the series produced for human operators (calls handled by people rather than AI agents).

Response GetCustomMetricsResponse

FieldTypeDescription
seriesCustomMetricSeries[]One series per (scope, custom field).
series[].scopeTypestringWhich kind of caller produced the values: "agent" or "human_operators".
series[].agentNamestringAI agent (persona) name; empty for human operators.
series[].fieldKeystringStable machine key of the custom field, e.g. "csat".
series[].fieldLabelstringHuman-readable label of the custom field, e.g. "Customer satisfaction".
series[].minValueintegerLowest value the field can take (scale lower bound).
series[].maxValueintegerHighest value the field can take (scale upper bound).
series[].pointsCustomMetricPoint[]Daily average values, oldest first.
series[].insightGoodstring[]AI-written bullets on what is working well. Empty when no insight has been generated yet or the sample is below the threshold.
series[].insightBadstring[]AI-written bullets on what is not going well. Same emptiness rule.
series[].insightGeneratedAtstringWhen the insight was generated, RFC 3339; empty when none exists yet.
series[].insightSampleSizeintegerNumber of calls the insight was (or would be) computed from; 0 when no insight exists yet.
daysintegerThe effective lookback window in days after defaulting/clamping.
curl "https://api.pingx.ai/analytics/v1/custom-metrics" \
  -H "Authorization: Bearer $PINGX_API_KEY"

#GET /analytics/v1/nps-trend

GetNpsTrend · needs analytics:read (or write)

Returns the organization's Net Promoter Score (NPS) as a daily time series for the last "days" days, aggregated across all branches, oldest day first. NPS ranges from -100 to 100 (percent promoters minus percent detractors). Days with no survey responses are reported with responses = 0 and nps = 0; check "responses" before treating an nps of 0 as a real score. Read-only and idempotent.

Query parameters

NameTypeDescription
daysintegerLookback window in calendar days ending today (inclusive). <= 0 means 30; maximum 180 (larger values are clamped).

Response GetNpsTrendResponse

FieldTypeDescription
pointsNpsTrendPoint[]Daily points, oldest first.
points[].datestringThe day, as an RFC 3339 timestamp (day granularity).
points[].npsnumberNet Promoter Score for that day aggregated across all branches, from -100 to 100. 0 when responses = 0 (no data) — check "responses" first.
points[].responsesintegerNumber of NPS survey responses collected that day across all branches.
daysintegerThe effective lookback window in days after defaulting/clamping.
curl "https://api.pingx.ai/analytics/v1/nps-trend" \
  -H "Authorization: Bearer $PINGX_API_KEY"