curl --silent --show-error --fail-with-body --request GET \
--url 'https://api.example.com/api/response/thread-analytics' \
--header 'x-widget-token: YOUR_API_KEY'
{
"ok": true,
"generatedAt": "2026-08-31T14:22:05Z",
"orgId": "string",
"agentId": "string",
"limit": 20,
"range": "string",
"since": "2026-08-31T14:22:05Z",
"possiblyTruncated": true,
"analysis": {},
"nextSteps": [
"string"
]
}
Conversation-length analytics over stored responses
Widget identity is verified when signing is configured; tokenless compatibility does not establish tenant ownership…
GET
/
api
/
response
/
thread-analytics
curl --silent --show-error --fail-with-body --request GET \
--url 'https://api.example.com/api/response/thread-analytics' \
--header 'x-widget-token: YOUR_API_KEY'
{
"ok": true,
"generatedAt": "2026-08-31T14:22:05Z",
"orgId": "string",
"agentId": "string",
"limit": 20,
"range": "string",
"since": "2026-08-31T14:22:05Z",
"possiblyTruncated": true,
"analysis": {},
"nextSteps": [
"string"
]
}
Widget identity is verified when signing is configured; tokenless compatibility does not establish tenant ownership. See the authentication and recovery guide for credential and retry rules.
Query parameters
Ignored by the analytics routes (telemetry, response review, thread analytics): their org comes only from the verified widget token, and they answer
401 unauthorized without one (outside production, STATESET_ORG_ID is a logged fallback). Kept for older clients.Agent id hint (also
agent_id, or header x-agent-id). Overridden by the widget token when present; must match it.Response
ThreadAnalyticsReport
Output of
analyzeThreadResponseAnalytics (src/server/threadAnalytics.js): includes singleResponseReasons, multiResponseReasons, daily, pairCountDistribution and, with includeThreads=true, sampled threads. Exact shape is not fixed here.Status codes
| Code | Meaning |
|---|---|
200 | Thread analytics report |
400 | Bad range, or analytics could not run |
401 | Widget token missing, malformed, expired, from the future, or badly signed |
403 | Request org/agent disagrees with the widget token claims |
429 | Too many requests for this IP (scoped by verified org/agent) |
500 | Unhandled error |
502 | Responses store query failed |
Using this contract
Read the source OpenAPI document for declared schemas and alternatives. This page also includes documented corrections from the spec overlays. Example IDs and values are illustrative; replace them with records from your workspace.curl --silent --show-error --fail-with-body --request GET \
--url 'https://api.example.com/api/response/thread-analytics' \
--header 'x-widget-token: YOUR_API_KEY'
{
"ok": true,
"generatedAt": "2026-08-31T14:22:05Z",
"orgId": "string",
"agentId": "string",
"limit": 20,
"range": "string",
"since": "2026-08-31T14:22:05Z",
"possiblyTruncated": true,
"analysis": {},
"nextSteps": [
"string"
]
}
Last modified on November 13, 2026