Skip to main content

Surveys - Delete Survey

Endpoint

/i/surveys/survey/delete

Enterprise Only
This API is available exclusively in Countly Enterprise.

Overview

Deletes a Survey widget. Optionally removes linked response data.

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: Delete 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
with_dataBoolean/StringNoAlso remove widget response data

Response

Success Response

{
"result": "Success"
}

Response Fields

FieldTypeDescription
resultStringDelete status

Error Responses

  • HTTP 404 - Widget not found:
{
"result": "Widget not found"
}

Behavior/Processing

  • Loads the widget from feedback_widgets by widget_id; missing widgets return Widget not found.
  • Deletes the widget logo file when appearance.logo is set.
  • Removes the widget document from feedback_widgets.
  • Deletes the linked cohort when cohortID exists.
  • If with_data is set, also removes related widget response/aggregate data; success emits surveys_removed_with_data.
  • Without with_data, only the widget record is removed; success emits surveys_widget_removed.

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.
countly_drill.drill_eventsDrill event recordsStores granular event rows queried or updated by this endpoint.

Examples

/i/surveys/survey/delete?api_key=YOUR_API_KEY&app_id=YOUR_APP_ID&widget_id=67b9db56f67aab0012cd8899

Ⓔ 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