Surveys - Survey Data
Endpoint
/o/surveys/survey/data
Ⓔ Enterprise Only
This API is available exclusively in Countly Enterprise.
Overview
Returns Survey response table data and Survey-specific method branches.
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:
Readpermission.
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 | No | Widget ID (required for some methods) |
method | String | No | meta, results, question, export, exportold |
period | String | No | Period filter |
periodOffset | Number | No | Offset in minutes |
platform | String | No | Platform filter |
version | String | No | App version filter |
sSearch | String | No | Search filter |
iDisplayStart | Number | No | Offset |
iDisplayLength | Number | No | Page size |
Response
Success Response
{
"sEcho": "1",
"iTotalRecords": 250,
"iTotalDisplayRecords": 20,
"aaData": [
{
"ts": 1739557500,
"uid": "u_102",
"platform": "iOS",
"app_version": "2.3.1"
}
]
}
Response Fields
| Field | Type | Description |
|---|---|---|
sEcho | String | Echo value for table requests |
iTotalRecords | Number | Total records count |
iTotalDisplayRecords | Number | Displayed records count |
aaData | Array | Response rows |
Error Responses
- HTTP 400 - Missing required params in selected method:
{
"result": "Missing param 'widget_id'"
}
- HTTP 404 - Widget not found:
{
"result": "Widget not found."
}
Behavior/Processing
- Uses Drill data for
[CLY]_survey; returnsDrill disabledorDrill missingif Drill is unavailable for table-backed modes. - Applies common filters from query parameters:
widget_id,uid,platform,platform_version,version,source,period, anddevice_id. source=defaultfilters responses withoutsg.journeyId; any othersourcevalue matchessg.journeyId.method=metareturns Survey metadata aggregates fromsurveyQueries.fetchSurveyMeta.method=resultsrequireswidget_id, loads the widget, and returns merged per-question totals and answer buckets.method=questionrequireswidget_idandquestion_id, validates the question exists on the widget, and returns a DataTables answer table for that question.method=exportandmethod=exportoldreturn export query descriptor payloads instead of response rows.exportincludes a ClickHouse query descriptor.- Without a special
method, returns DataTables rows from Drill. Withwidget_id, answers are translated using widget question choices; withoutwidget_id, it returns all answered survey rows. filter_questionscan be a JSON object mapping question IDs to exact values ornull;nullmeans answer exists.
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_drill.drill_events | Drill event records | Stores granular event rows queried or updated by this endpoint. |
Examples
/o/surveys/survey/data?api_key=YOUR_API_KEY&app_id=YOUR_APP_ID&widget_id=67b9db56f67aab0012cd8899&iDisplayStart=0&iDisplayLength=20
/o/surveys/survey/data?api_key=YOUR_API_KEY&app_id=YOUR_APP_ID&widget_id=67b9db56f67aab0012cd8899&method=results&period=30days
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