Delete Flights

Why Delete a Flight?

You may find a time comes when you would like to delete a flight because it is no relevant or useful to a campaign. Deleting a flight does not delete a campaign, only the association with that campaign.

đŸ“˜

Note

To delete a Flight, use the Update Flight endpoint and set isDeleted to true

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

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

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

deleteFlight();
require "adzerk"

def delete_flight()
    client = Adzerk::Client.new(ENV["ADZERK_API_KEY"])
    flight_id = 12345
    pp client.flights.delete(flight_id)
end
delete_flight()