Skip to main content

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: Update permission.

Request Parameters

ParameterTypeRequiredDescription
api_keyStringYes (or auth_token)API key authentication
auth_tokenStringYes (or api_key)Auth token authentication
app_idStringYesApp ID
widget_idStringYesWidget ID
msgString (JSON Object)NoNPS message config
appearanceString (JSON Object)NoAppearance config
statusBoolean/StringNoActive status
followUpTypeStringNoFollow-up mode

Response

Success Response

{
"result": "Success"
}

Response Fields

FieldTypeDescription
resultStringUpdate 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, and targeting.
  • Updates feedback_widgets by widget_id. Appearance fields are stored under appearance.<field>.
  • If delete_logo is set and no new logo file is uploaded, deletes the stored logo and clears appearance.logo.
  • If targeting changes, updates, creates, or deletes the linked cohort and recalculates cohort steps when needed.
  • Returns Success after widget/cohort updates, or specific cohort/upload error messages when follow-up work fails.
  • Emits surveys_widget_edited and, when applicable, cohort_edited system log actions.

Database Collections

CollectionUsed forData touched by this endpoint
countly.feedback_widgetsEndpoint data sourceStores endpoint-related records this endpoint reads or modifies.
countly.cohortsEndpoint data sourceStores 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

Ⓔ 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