Surveys - Edit NPS
Endpoint
/i/surveys/nps/edit
Ⓔ Enterprise Only
This API is available exclusively in Countly Enterprise.
Overview
Updates an existing NPS widget.
Authentication
Authentication methods:
- API Key (parameter):
api_key=YOUR_API_KEY - Auth Token (parameter):
auth_token=YOUR_AUTH_TOKEN - Auth Token (header):
countly-token: YOUR_AUTH_TOKEN
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 |
widget_id | String | Yes | Widget ID |
msg | String (JSON Object) | No | NPS message config |
appearance | String (JSON Object) | No | Appearance config |
status | Boolean/String | No | Active status |
followUpType | String | No | Follow-up mode |
Response
Success Response
{
"result": "Success"
}
Response Fields
| Field | Type | Description |
|---|---|---|
result | String | Update status |
Error Responses
- HTTP 400 - Invalid parameters:
{
"result": "Invalid params: ..."
}
- HTTP 404 - Unknown widget:
{
"result": "Widget not found"
}
Behavior/Processing
- Parses and preprocesses widget properties such as
msg,appearance, andtargeting. - Updates
feedback_widgetsbywidget_id. Appearance fields are stored underappearance.<field>. - If
delete_logois set and no new logo file is uploaded, deletes the stored logo and clearsappearance.logo. - If
targetingchanges, updates, creates, or deletes the linked cohort and recalculates cohort steps when needed. - Returns
Successafter widget/cohort updates, or specific cohort/upload error messages when follow-up work fails. - Emits
surveys_widget_editedand, when applicable,cohort_editedsystem log actions.
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.cohorts | Endpoint data source | Stores endpoint-related records this endpoint reads or modifies. |
Examples
/i/surveys/nps/edit?api_key=YOUR_API_KEY&app_id=YOUR_APP_ID&widget_id=67b9db56f67aab0012cd8899&name=NPS Q2
Related Endpoints
Ⓔ Enterprise
This feature is part of Countly Enterprise.
Get Access:
Already a Customer? Use support portal if you have any questions.
Last Updated
2026-04-18