Skip to main content

Surveys - Survey Widgets

Endpoint

/o/surveys/survey/widgets

Enterprise Only
This API is available exclusively in Countly Enterprise.

Overview

Returns paginated Survey widgets table.

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

Request Parameters

ParameterTypeRequiredDescription
api_keyStringYes (or auth_token)API key authentication
auth_tokenStringYes (or api_key)Auth token authentication
app_idStringYesApp ID
statusBoolean/StringNoFilter by active status
sSearchStringNoText search
iDisplayStartNumberNoOffset
iDisplayLengthNumberNoPage size

Response

Success Response

{
"sEcho": "1",
"iTotalRecords": 4,
"iTotalDisplayRecords": 4,
"aaData": [
{
"_id": "67b9db56f67aab0012cd8899",
"name": "Product Feedback",
"type": "survey",
"status": true,
"shown": 142,
"responded": 48,
"rate": 0.34
}
]
}

Response Fields

FieldTypeDescription
sEchoStringEcho value for table requests
iTotalRecordsNumberTotal records count
iTotalDisplayRecordsNumberDisplayed records count
aaDataArrayWidget rows

Error Responses

  • HTTP 500 - Aggregation failure:
{
"result": "<error message>"
}

Behavior/Processing

  • Filters feedback_widgets by type=survey, app_id, and optional status.
  • Applies sSearch as a case-insensitive regex against internalName and name.
  • Supports DataTables sorting through iSortCol_0 / sSortDir_0; sortable columns are status, internalName, targeting, nps, responded, and rate.
  • Calculates rate as responded / total when total is greater than zero.
  • For Survey widgets, enriches each row with responsesByDeliveryMethodIds by checking Drill [CLY]_survey answered events and grouping responses by Journey delivery id or default.

Database Collections

CollectionUsed forData touched by this endpoint
countly.feedback_widgetsEndpoint data sourceStores endpoint-related records this endpoint reads or modifies.
countly_drill.drill_eventsDrill event recordsStores granular event rows queried or updated by this endpoint.

Examples

/o/surveys/survey/widgets?api_key=YOUR_API_KEY&app_id=YOUR_APP_ID&iDisplayStart=0&iDisplayLength=10

Ⓔ 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