Delete Campaigns

const Adzerk = require('@adzerk/management-sdk');
const apiKey = process.env.ADZERK_API_KEY;

async function deleteCampaign() {
  let specifications = await Adzerk.fetchSpecifications();
  let client = await Adzerk.buildClient({apiKey, specifications});

  let campaign = await client.run("campaign", "update", {id: 12345, isDeleted: true});
  console.log(campaign);
}

deleteCampaign();
require "adzerk"

def delete_campaign()
    client = Adzerk::Client.new(ENV["ADZERK_API_KEY"])
    campaign_id = 12345
    pp client.campaigns.delete(campaign_id)
end
delete_campaign()

Why Delete a Campaign?

Occasionally, you may find it useful to delete a campaign from your network. The Kevel API enables you to quickly and easily delete any campaign from your network using the Update Campaigns API endpoint. When using this endpoint, simply set the isDelete boolean value to true. The campaign will be deleted from your network.

API Syntax

When using the Update Campaigns API endpoint to delete a campaign, it is important to understand the syntax required to make the request. Because the Kevel API is a RESTful API, there is a specific request format that must be followed to ensure the endpoint can process the request. The format is:

PUT https://api.kevel.co/v1/campaign/{CampaignID}

Where:

  • PUT - the type of API request being made.
  • https://api.kevel.co - the URL for the request.
  • v1 - the API version.
  • campaign - the API endpoint being called.
  • CampaignID - the ID associated with the campaign.

📘

Note

Remember to set the isDeleted boolean value to true.