Skip to main content

/i/campaign/delete

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/campaign/delete

Overview

Deletes a campaign and removes associated attribution records.

Authentication

Pass api_key or auth_token as a query parameter, or send countly-token as a header. See Authentication.

Permissions

  • Attribution Delete permission for the target app.

Request Parameters

ParameterTypeRequiredDescription
api_keyStringYes (or use auth_token)Dashboard API key.
auth_tokenStringYes (or use api_key)Dashboard auth token.
app_idStringYesTarget app ID.
argsJSON String (Object)YesMust include campaign _id.

Example

/i/campaign/delete?api_key=YOUR_API_KEY&app_id=6991c75b024cb89cdc04efd2&args={"_id":"campaign-summer-2026"}

Response

Success Response

{
"result": "Success"
}

Error Responses

Status Code: 200 OK

{
"result": "Error deleting campaign"
}

Behavior

  • Removes the campaign from countly.campaigns.
  • Removes campaign click records from countly.attribution.
  • Removes matching campaign-user records from every campaign_users{appId} collection found across apps.
Implementation details

Database Collections

CollectionUsed forData touched by this endpoint
countly.campaignsCampaign storageDeletes the campaign document.
countly.attributionClick attribution storageDeletes rows with the campaign id.
countly.campaign_users{appId}Per-app campaign-user trackingDeletes matching campaign-user rows across apps.