Surveys - Update NPS Status
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
/i/surveys/nps/status
Overview
Bulk-updates NPS widget active status.
Authentication
Pass api_key or auth_token as a query parameter, or send countly-token as a header. See Authentication.
Permissions
- Surveys:
Updatepermission.
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 |
data | String (JSON Object) | Yes | Widget ID to status map |
Examples
/i/surveys/nps/status?api_key=YOUR_API_KEY&app_id=YOUR_APP_ID&data={"67b9db56f67aab0012cd8899":false}
Response
Success Response
{
"result": "Success"
}
Response Fields
| Field | Type | Description |
|---|---|---|
result | String | Status update result |
Error Responses
- HTTP 500 - Invalid
datapayload:
{
"result": "Invalid paramerer 'data'"
}
- HTTP 400 - Nothing to update:
{
"result": "Nothing to update"
}
Behavior
- Parses
dataas a JSON object mapping widget IDs to desired status values. - Values
trueand"true"setstatus=true; all other values setstatus=false. - Executes updates as an unordered bulk operation against
feedback_widgets. - Returns
Nothing to updatewhen the parsed object has no keys. - Emits
surveys_widget_statussystem log action on success.
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. |