Skip to main content

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

Request Parameters

ParameterTypeRequiredDescription
api_keyStringYes (or auth_token)API key authentication
auth_tokenStringYes (or api_key)Auth token authentication
app_idStringYesApp ID
dataString (JSON Object)YesWidget 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

FieldTypeDescription
resultStringStatus update result

Error Responses

  • HTTP 500 - Invalid data payload:
{
"result": "Invalid paramerer 'data'"
}
  • HTTP 400 - Nothing to update:
{
"result": "Nothing to update"
}

Behavior

  • Parses data as a JSON object mapping widget IDs to desired status values.
  • Values true and "true" set status=true; all other values set status=false.
  • Executes updates as an unordered bulk operation against feedback_widgets.
  • Returns Nothing to update when the parsed object has no keys.
  • Emits surveys_widget_status system log action on success.
Implementation details

Database Collections

CollectionUsed forData touched by this endpoint
countly.feedback_widgetsEndpoint data sourceStores endpoint-related records this endpoint reads or modifies.