Skip to main content

Star Rating - Edit Widget

Endpoint

/i/feedback/widgets/edit

Overview

Updates an existing star-rating widget definition.

Authentication

Countly API supports three authentication methods:

  1. api_key=YOUR_API_KEY
  2. auth_token=YOUR_AUTH_TOKEN
  3. countly-token: YOUR_AUTH_TOKEN

Permissions

Requires star_rating Update permission.

Request Parameters

ParameterTypeRequiredDescription
api_keyStringConditionalRequired if auth_token is not provided.
auth_tokenStringConditionalRequired if api_key is not provided.
widget_idStringYesTarget widget ObjectID.
app_idStringYesApp ID in widget payload validation schema.
statusBoolean/StringYesActive flag for widget.
target_pagesArray/StringNoJSON array string is preprocessed to array (fallback ['/']).
targetingObject/StringNoJSON object string for cohort targeting.
linksArray/StringNoJSON array string for links.
ratings_textsArray/StringNoJSON array string for rating labels.

Additional optional widget fields are validated using the server-side widget schema.

Response

Success Response

{
"result": "Success"
}

Response Fields

FieldTypeDescription
resultStringSuccess when widget update path completes.

Error Responses

  • 500
{
"result": "Invalid widget id."
}
  • 400
{
"result": "Invalid params: ..."
}
  • 404
{
"result": "Widget not found"
}
  • 400
{
"result": "widget updated. Error to update cohort"
}
  • 400
{
"result": "widget updated. Error to create cohort"
}

Standard authentication/authorization errors from update validation can also be returned.

Behavior/Processing

  • Converts widget_id to ObjectID and validates full widget payload.
  • Applies widget field preprocessors before validation (target_pages, targeting, links, ratings_texts, status, hide_sticker).
  • Updates feedback_widgets document via findAndModify.
  • If Cohorts plugin is enabled and targeting changed:
    • updates existing cohort,
    • or deletes cohort,
    • or creates new cohort and links cohortID.
  • Emits cohort_edited system log when cohort update branch runs.

Impact on Other Data

  • Updates one widget in countly.feedback_widgets.
  • May update/create/delete related cohort documents in countly.cohorts.

Database Collections

CollectionUsed forData touched by this endpoint
countly.feedback_widgetsWidget storageReads and updates target widget document.
countly.cohortsTargeting cohortsMay update/create/delete cohort records (when cohorts plugin enabled).
countly.systemlogsAudit trailReceives cohort_edited in cohort-update branch.

Examples

Edit widget status and text

/i/feedback/widgets/edit?
api_key=YOUR_API_KEY&
widget_id=67a3d2f5c1a23b0f4d6c0201&
app_id=6991c75b024cb89cdc04efd2&
status=true&
popup_header_text=How was your experience?&
target_pages=["/","/pricing"]

Last Updated

2026-03-07