## Why List Flights For A Campaign?

When you want to review an existing campaign to assess its performance, or make changes to the campaign, it is helpful to have a list of campaigns associated with that campaign. This API call enables you to return an array of all flights that are associated with a specific campaign.

> ### Caution
> If a flight contains ads, only the first 200 ads in the flight will be listed in the response. To view all the ads in a flight, use the [List Ads for Flight](https://dev.kevel.com/reference/list-ads) endpoint.

For details of the `filter` query parameter, see [List Flights](https://dev.kevel.com/reference/list-flights).

## API Syntax

When using the _List Flights for Campaign_ API call, 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:

`GET https://api.kevel.co/v1/campaign/{CampaignID}/flight`

Where:

- `GET` - 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 for the specific campaign you want to return.
- `flight` - the value to return from the campaign.

### Parameters

| Parameter  | Type     | Description |
|------------|----------|-------------|
| CampaignID | int32   | required ID of the Campaign |
| filter      | string  | enum - Limit the set of returned flights. Omission is equivalent to not-archived. Allowed: `not-archived`, `archived`, `active`, `inactive` |
| isActive    | boolean | DEPRECATED. If true, returns only active flights. Deprecated: will be removed in the future. Use filter in preference. |
| excludeAds  | boolean | Defaults to false. If true, the endpoint returns only the flight data without ad objects |

### Response

```shell
curl -X GET \
     -H "X-Adzerk-ApiKey:[0m$ADZERK_API_KEY" \
     "https://api.kevel.co/v1/campaign/1234/flight"
```

```json
{
    "items":[
        {
            "Id":12345,
            "NoEndDate":null,
            "Price":0.000,
            "Impressions":100,
            "IsNoDuplicates":true,
            "DuplicateMode":4,
            "Keywords":"",
            "Name":"The Great API Flight",
            "WeightOverride":null,
            "IsFreqCap":null,
            "IsCompanion":false,
            "CampaignId":1234,
            "PriorityId":1234,
            "IsDeleted":false,
            "IsActive":true,
            "GeoTargeting":null,
            "SiteZoneTargeting":null,
            "CustomTargeting":"",
            "GoalType":2,
            "RateType":1,
            "IsECPMOptimized":null,
            "ECPMOptimizePeriod":null,
            "ECPMMultiplier":null,
            "FloorECPM":null,
            "CeilingECPM":null,
            "DefaultECPM":null,
            "ECPMBurnInImpressions":null,
            "EffectiveCPMOverride":null,
            "DatePartingStartTimeISO":null,
            "DatePartingEndTimeISO":null,
            "IsSunday":true,
            "IsMonday":true,
            "IsTuesday":true,
            "IsWednesday":true,
            "IsThursday":true,
            "IsFriday":true,
            "IsSaturday":true,
            "FreqCap":0,
            "FreqCapDuration":0,
            "FreqCapType":0,
            "CapType":1,
            "DailyCapAmount":null,
            "LifetimeCapAmount":null,
            "DeliveryStatus":1,
            "CustomFieldsJson":null,
            "BehavioralTargeting":null,
            "IsTargetingOptimization":null,
            "TargetingOptimizationType":null,
            "TargetingOptimizationTargetType":null,
            "TargetingOptimizationTarget":null,
            "TargetingOptimizationBurnIn":null,
            "TargetingOptimizationCanMiss":null,
            "IsArchived":null,
            "CanPassback":true,
            "PassbackSortOrder":1,
            "StartDateISO":"2017-06-08T00:00:00.0000000",
            "EndDateISO":"2017-12-08T00:00:00.0000000",
            "Created":"2022-03-08T12:34:56.123Z",
            "LastModified":"2022-03-08T12:34:56.123Z",
            "Version":4
        }
    ],
    "page": 1
}
```

Updated 9 months ago
