## 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](https://dev.kevel.co/v1.0/reference/flight#update-flights) and set `isDeleted` to `true`

### JavaScript
```javascript
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();
```

### Ruby
```ruby
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()
```
