Surveys - NPS Overview Metrics
Enterprise
This endpoint is part of Countly Enterprise. To get access, contact sales or compare versions. Existing customers can reach the support portal with questions.
Endpoint
/o/surveys/nps/overview
Overview
Returns summary metrics for one NPS widget (widget_id) or aggregated metrics for all NPS widgets.
Authentication
Pass api_key or auth_token as a query parameter, or send countly-token as a header. See Authentication.
Permissions
- Surveys:
Readpermission.
Request Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
api_key | String | Yes (or auth_token) | API key authentication |
auth_token | String | Yes (or api_key) | Auth token authentication |
app_id | String | Yes | App ID |
widget_id | String | No | Widget-specific overview |
status | Boolean/String | No | Status filter for aggregated overview |
calculate_totals | Boolean/String | No | Includes totals-calculated for widget mode |
Examples
/o/surveys/nps/overview?api_key=YOUR_API_KEY&app_id=YOUR_APP_ID&widget_id=67b9db56f67aab0012cd8899
Response
Success Response
{
"_id": "67b9db56f67aab0012cd8899",
"name": "NPS Q1",
"responded": 120,
"shown": 340,
"scores": {
"promoter": 58,
"passive": 24,
"detractor": 18
},
"nps": 40
}
Response Fields
| Field | Type | Description |
|---|---|---|
_id | String | Widget ID (single-widget mode) |
responded | Number | Number of responses |
shown | Number | Number of impressions |
scores | Object | NPS score components |
nps | Number | NPS value (promoter - detractor) |
Error Responses
- HTTP 404 - Widget not found:
{
"result": "Widget not found."
}
Behavior
- With
widget_id, loads one widget, joins creator details frommembers, and returns the widget document. - With
calculate_totals, additionally calculates period totals forshownandrespondedfrom the NPS aggregate model and stores them intotals-calculated. - Without
widget_id, aggregates all matching NPS widgets for the app and optionalstatus. - For NPS widgets with responses, converts promoter/detractor/passive counts to percentages and calculates
npsas promoter percentage minus detractor percentage. - Aggregated overview returns widget status totals plus summed
responded,shown, and NPS score fields.
Related Endpoints
Implementation details
Database Collections
| Collection | Used for | Data touched by this endpoint |
|---|---|---|
countly.feedback_widgets | Endpoint data source | Stores endpoint-related records this endpoint reads or modifies. |
countly.members | Member/account enrichment | Stores member profile fields (for example names/IDs) used to resolve actor metadata. |