---
updatedAt: 2026-11-10T19:50:05.000Z
agentTools:
  projectIndex: https://dev.kevel.com/llms.txt
---

# Create Flight

This API call adds a new flight to a campaign.

## What are Flights?

A flight is a collection of ads grouped under a campaign. Most targeting and delivery rules are set at the flight level. These rules include items such as:

* impression goals
* tracking methods
* dates to run
* targeting

For example, if an advertiser wants to place an advertisement for summer clothing, the best time to display the ad may be in the summer months, and not in the autumn or winter months.

Kevel enables users to create flights by either using the Kevel UI or API. This section describes how to use the *Create Flight* API to create flights.

For more information on flights and how they can be used for optimizing performance using the Kevel UI, please refer to the [Kevel UI Flight documentation](https://dev.kevel.com/docs/flights) overview page.

## API Syntax

When using the *Create Flight* API, 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:

`POST https://api.kevel.co/v1/flight`

Where:

* `POST` - the type of API request being made.
* `https://api.kevel.co` - the URL for the request.
* `v1` - the API version.
* `flight` - the API endpoint being called.

## Flight Fields

There are a number of fields that can be used when creating a flight. These fields are described in detail in the [Flight Fields](https://dev.kevel.com/docs/flights#flight-fields) documentation.

## Geotargeting

Geotargeting is a type of advertising that uses location data to display ads to a user within a specific geographic region. For example, if a user is based in Japan, ads can be directed to users within that region that may be of interest, such as anime, technology, etc.

Although certain assumptions are made about users in a region, geotargeting can be a powerful tool for publishers and advertisers to provide ad inventory to users in different regions and parts of the world.

When a user opts in to location services, this type of advertising allows a publisher or advertiser to be more focused in campaigns to ensure maximum return on investment.

Put simply, geotargeting helps advertisers create more engaging, relevant, targeted advertisements for users, which can result in increased user engagement.

## Behavioral Targeting

The Create Flight API also enables behavior targeting through the use of behavioral objects.

The Behavioral object is used for [Interest/Behavioral Targeting](https://dev.kevel.com/docs/interest-targeting) and [Excluding Ads Based on Behavior](https://dev.kevel.com/docs/behavioral).

The `BehavioralTargeting` object contains six boolean statements, three under `onClick` and three under `onConvert`. All default to `false`. All are optional.

| Property                                                | Description                                                                      |
| :------------------------------------------------------ | :------------------------------------------------------------------------------- |
| `onClick: {"stopShowingAdsFromFlight":XX}`              | Stops showing ads from flight if someone clicks.                                 |
| `onClick: {"stopShowingAdsFromAdvertiser":XX}`          | Stops showing ads from advertiser if someone clicks.                             |
| `onClick: {storeCategoriesFromFlightAsInterest":XX}`    | Saves the category of the flight to UserDB, tied to `user`, based on click.      |
| `onConvert: {"stopShowingAdsFromFlight":XX}`            | Stops showing ads from flight if someone converts.                               |
| `onConvert: {"stopShowingAdsFromAdvertiser":XX}`        | Stops showing ads from advertiser if someone converts.                           |
| `onConvert: {"storeCategoriesFromFlightAsInterest":XX}` | Saves the category of the flight to UserDB, tied to `user`, based on conversion. |

```json
"BehavioralTargeting": {
    "onClick": {
      "stopShowingAdsFromFlight": true,
      "stopShowingAdsFromAdvertiser": true,
      "storeCategoriesFromFlightAsInterest": true
    },
    "onConvert": {
      "stopShowingAdsFromFlight": true,
      "stopShowingAdsFromAdvertiser": true,
      "storeCategoriesFromFlightAsInterest": true
    }
  }
```

## Category Targeting

Use `CategoryTargeting` to limit a Flight to the categories your site or app sends in `placements[].category` on a Decision API request. Each rule has an `Id` and an `IsExclude` flag.

```json
"CategoryTargeting": [
  { "Id": "123", "IsExclude": false },
  { "Id": "Clothing > Women > T-Shirts", "IsExclude": true }
]
```

* `IsExclude: false` is a positive rule. `IsExclude: true` is a negative rule that blocks a matching positive rule.
* If every rule is negative, any valid category that matches no negative rule is eligible. A request with no category is not eligible.
* Matching is exact and ignores capitalization. A parent category does not include its descendants, so use the full category path if your site sends a path.
* An `Id` can appear only once in the list, and two `Id` values that differ only by capitalization count as the same `Id`. Kevel returns a 400 for either. A Flight can hold up to 25 rules unless Kevel raises the limit for your network.
* Send `null` or an empty array for no explicit targeting.
* Category targeting must be enabled for your network. If it isn’t, Kevel ignores the field on writes. See [Set up category targeting](https://dev.kevel.com/docs/set-up-category-targeting).
* An Ad inherits the Flight’s rules unless the Ad has its own `CategoryTargeting`. See [Create Ads](https://dev.kevel.com/reference/create-ads).

To see which categories are available, call [List Category Catalog](https://dev.kevel.com/reference/list-category-catalog).

### Category Bid Modifiers

Add a `Category` match to a bid modifier to change the bid for a category. A category bid modifier changes the bid after an Ad passes all targeting checks. It does not make an Ad eligible to serve, so pair it with `CategoryTargeting` if you also want to limit delivery.

```json
"BidModifiers": [
  {
    "Match": { "Category": { "Id": "Clothing > Women" } },
    "Multiplier": 1.5
  }
]
```

`Category` can be combined with the other supported `Match` fields. Bid modifiers apply to Flights only.

## Segment Targeting

Segment targeting lets you deliver more relevant ads by limiting who sees them based on predefined user groups, or "segments." These segments can be built in Kevel Audience or imported from an external system, such as a customer data platform (CDP). Once set up, you can use segments to target users based on behavior, demographics, shopping habits, or any custom criteria, enabling more personalized and effective ad experiences.

Learn more on the [Segment Targeting knowledge base page](https://dev.kevel.com/docs/segment-targeting).

<br />

# OpenAPI definition

```json
{
  "openapi": "3.1.0",
  "info": {
    "title": "management-api-2",
    "version": "1.0"
  },
  "servers": [
    {
      "url": "https://api.kevel.co"
    }
  ],
  "components": {
    "securitySchemes": {
      "sec0": {
        "type": "apiKey",
        "name": "X-Adzerk-ApiKey",
        "in": "header"
      }
    }
  },
  "security": [
    {
      "sec0": []
    }
  ],
  "paths": {
    "/v1/flight": {
      "post": {
        "summary": "Create Flight",
        "description": "This API call adds a new flight to a campaign.",
        "operationId": "create-flight",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "Name",
                  "StartDateISO",
                  "CampaignId",
                  "PriorityId",
                  "GoalType",
                  "Impressions",
                  "IsActive",
                  "RateType"
                ],
                "properties": {
                  "Name": {
                    "type": "string",
                    "description": "The flight name. Max length is 300 characters."
                  },
                  "StartDateISO": {
                    "type": "string",
                    "description": "UTC start date in ISO 8601 format:  `YYYY-MM-DDTHH:MM:SS.SSSSSSS`. This can also be sent in the format of `YYYY-MM-DD`."
                  },
                  "CampaignId": {
                    "type": "integer",
                    "description": "The ID of the campaign.",
                    "format": "int32"
                  },
                  "PriorityId": {
                    "type": "integer",
                    "description": "The ID of the [Priority](doc:priorities). Here are the [Priority API endpoints](ref:priority).",
                    "format": "int32"
                  },
                  "GoalType": {
                    "type": "integer",
                    "description": "This is the metric that Kevel uses to pace the ads so it hits the desired goal by the end date.  Key follows: `1 = Impressions 2 = Percentage 3 = Click 7 = Conversion 8 = Revenue 9 = Daily Revenue  10 = Monthly Revenue`. Instructions are [here](doc:flights#goals)",
                    "format": "int32"
                  },
                  "Impressions": {
                    "type": "integer",
                    "description": "The goal amount - specifies the number of GoalTypes to aim for during the life of the campaign. For Revenue, Daily Revenue and Monthly Revenue Goal Types the maximum Goal Amount is 500000000. For all other GoalTypes the maximum Goal Amount is 2147483647. Instructions are [here](doc:flights#goals). Note: the field is named Impressions even if Goal Type is not set to Impressions.",
                    "format": "int32"
                  },
                  "IsActive": {
                    "type": "boolean",
                    "description": "Specifies whether campaigns should be active or inactive. Defaults to `false`.",
                    "default": false
                  },
                  "RateType": {
                    "type": "integer",
                    "description": "The Rate value - instructions [here](doc:flights#rateprice). Key: `1 = Flat 2 = CPM 3 = CPC 4 = CPA View 5 = CPA Click 6 = CPA View & Click`.",
                    "format": "int32"
                  },
                  "EndDateISO": {
                    "type": "string",
                    "description": "UTC end date in ISO 8601 format: ``YYYY-MM-DDTHH:MM:SS.SSSSSSS`. You can also send in a standard date of `YYYY-MM-DD`. **Required** if `GoalType` is not `2`, `9` or `10`."
                  },
                  "IsDeleted": {
                    "type": "boolean",
                    "description": "Specifies whether flight should be deleted. Do not use when creating a flight. Defaults to `false`.",
                    "default": false
                  },
                  "Price": {
                    "type": "number",
                    "description": "The Price value - instructions [here](doc:flights#rateprice).",
                    "format": "float"
                  },
                  "CapType": {
                    "type": "integer",
                    "description": "The cap type metric. Instructions [here](doc:flights#caps). Key: `1 = Impressions 2 = Clicks 3 = Conversions 4 = Revenue`. Do not set to `0` - if removing, set to `null`.",
                    "format": "int32"
                  },
                  "DailyCapAmount": {
                    "type": "integer",
                    "description": "The maximum # of `CapType` per day. Instructions [here](doc:flights#caps).",
                    "format": "int32"
                  },
                  "LifetimeCapAmount": {
                    "type": "integer",
                    "description": "The maximum # of `CapType` per lifetime.  Instructions [here](doc:flights#caps).",
                    "format": "int32"
                  },
                  "Keywords": {
                    "type": "string",
                    "description": "Keywords used for targeting. Instructions [here](https://dev.kevel.com/docs/keyword-targeting)."
                  },
                  "CustomTargeting": {
                    "type": "string",
                    "description": "Zerkel string for Custom targeting. Instructions [here](https://dev.kevel.com/docs/custom-targeting). The maximum string length for `CustomTargeting` is 1000 characters."
                  },
                  "CustomFieldsJSON": {
                    "type": "string",
                    "description": "Sets the value of custom fields based on a custom fields schema. Must contact support before use. More info [here](doc:custom-fields)."
                  },
                  "IsFreqCap": {
                    "type": "boolean",
                    "description": "Set to `true` if doing capping. If false or null, then the other Freq fields are ignored. Learn more about FC [here](https://dev.kevel.com/docs/flight-frequency-capping). If not already enabled, you'll need your account manager to enable it."
                  },
                  "FreqCap": {
                    "type": "integer",
                    "description": "The number of times the frequency cap should occur. Cannot be 0 unless `FreqCapType` is None (0).",
                    "format": "int32"
                  },
                  "FreqCapDuration": {
                    "type": "integer",
                    "description": "Specifies how often the frequency cap should occur. Cannot be 0 unless `FreqCapType` is None (0).",
                    "format": "int32"
                  },
                  "FreqCapType": {
                    "type": "integer",
                    "description": "Specifies which unit of time you would like frequency capping to occur. Key: `1 = Hour 2 = Day 3 = Minute`.",
                    "format": "int32"
                  },
                  "DontAffectParentFreqCap": {
                    "type": "boolean",
                    "description": "If true, opts-it out of frequency cap settings imposed at advertiser or campaign level."
                  },
                  "IsCompanion": {
                    "type": "boolean",
                    "description": "If `true`, enables companion ads. `IsCompanion` must be set to `false` when `IsNoDuplicates` is `true`, and vice versa. Learn more [here](doc:additional-display-rules#companion-ads)."
                  },
                  "isNoDuplicates": {
                    "type": "boolean",
                    "description": "If `true`, enables no duplicates. `IsCompanion` must be set to `false` when `IsNoDuplicates` is true, and vice versa."
                  },
                  "DuplicateMode": {
                    "type": "integer",
                    "description": "Indicates which level no duplicates should be enforced on. Key follows: `1: Flight 2: Campaign 3: Advertiser 4: Creative`.",
                    "format": "int32"
                  },
                  "DeliveryStatus": {
                    "type": "integer",
                    "description": "Read-only. Status of the flight. The mapping of the status against the [UI](https://dev.kevel.com/docs/campaigns#flights-and-ads) are in brackets. Key: 0 = Pending (blue) 1 = Healthy (green) 2 = BorderLine (amber) 3 = InDanger (red) 5 = Underdelivered (amber).",
                    "format": "int32"
                  },
                  "IsTrackingConversions": {
                    "type": "boolean",
                    "description": "If `true`, enables conversion tracking endpoints/pixels."
                  },
                  "CanPassback": {
                    "type": "boolean",
                    "description": "Sets whether a flight in an adChained-enabled priority can pass back to the next flight in the adChain."
                  },
                  "PassbackSortOrder": {
                    "type": "integer",
                    "description": "Sets the order of a flight in the adChain. `PassbackSortOrder` is a transient value that can be modified by internal processes in the UI. Although the value may change, the actual sort order of flights in the adChain will remain consistent. Setting two flights to the same `PassbackSortOrder` will cause the flights to be chosen randomly. Setting `PassbackSortOrder` to `0` will cause the flight to appear as `\"--\"` in the UI, but the flight will still be part of the adChain. This is not recommended.",
                    "format": "int32"
                  },
                  "IsECPMOptimized": {
                    "type": "boolean",
                    "description": "Specifies whether `ECPM Optimization` is enabled."
                  },
                  "ECPMOptimizePeriod": {
                    "type": "integer",
                    "description": "Timeframe to optimize for [1 - 90 days].",
                    "format": "int32"
                  },
                  "ECPMMultiplier": {
                    "type": "number",
                    "description": "The final eCPM will be multiplied by this amount. Must be at least 0.01.",
                    "format": "float"
                  },
                  "FloorECPM": {
                    "type": "number",
                    "description": "Minimum eCPM. Must be at least 0.01.",
                    "format": "float"
                  },
                  "CeilingECPM": {
                    "type": "number",
                    "description": "Maximum eCPM. Must be at least 0.01.",
                    "format": "float"
                  },
                  "DefaultECPM": {
                    "type": "number",
                    "description": "This is the eCPM an ad starts at when the Flight begins serving. During burn-in the eCPM moves from this value towards the ad's calculated eCPM as impressions accrue. Must be at least 0.01.",
                    "format": "float"
                  },
                  "ECPMBurnInImpressions": {
                    "type": "integer",
                    "description": "Impressions per creative over which the eCPM moves from the default eCPM to the calculated eCPM [1 - 2147483648].",
                    "format": "int32"
                  },
                  "EffectiveCPMOverride": {
                    "type": "number",
                    "description": "Sets a manual override to a flight's CPM, e.g. so a Flat Rate flight can compete in an auction priority.",
                    "format": "float"
                  },
                  "DatePartingStartTimeISO": {
                    "type": "string",
                    "description": "Targets the flight to certain hours within a day. Use ISO 8601 format: `HH:MM:SS`. *(This parameter is part of Kevel's legacy day parting features. It is still supported, but will be ignored if a Flight has one or more new day parts. Learn more about new day parting features [here](https://dev.kevel.com/docs/day-hour-parting) and about legacy day parts [here](https://dev.kevel.com/docs/day-hour-parting-v1).)*",
                    "default": "Null"
                  },
                  "DatePartingEndTimeISO": {
                    "type": "string",
                    "description": "Targets the flight to certain hours within a day. Use ISO 8601 format: `HH:MM:SS`. *(This parameter is part of Kevel's legacy day parting features. It is still supported, but will be ignored if a Flight has one or more new day parts. Learn more about new day parting features [here](https://dev.kevel.com/docs/day-hour-parting) and about legacy day parts [here](https://dev.kevel.com/docs/day-hour-parting-v1).)*",
                    "default": "Null"
                  },
                  "IsSunday": {
                    "type": "boolean",
                    "description": "If `true`, targets this day. Defaults to `false` if you have filled in the `DateParting` fields. *(This parameter is part of Kevel's legacy day parting features. It is still supported, but will be ignored if a Flight has one or more new day parts. Learn more about new day parting features [here](https://dev.kevel.com/docs/day-hour-parting) and about legacy day parts [here](https://dev.kevel.com/docs/day-hour-parting-v1).)*",
                    "default": false
                  },
                  "IsMonday": {
                    "type": "boolean",
                    "description": "If `true`, targets this day. Defaults to `false` if you have filled in the `DateParting` fields. *(This parameter is part of Kevel's legacy day parting features. It is still supported, but will be ignored if a Flight has one or more new day parts. Learn more about new day parting features [here](https://dev.kevel.com/docs/day-hour-parting) and about legacy day parts [here](https://dev.kevel.com/docs/day-hour-parting-v1).)*",
                    "default": false
                  },
                  "IsTuesday": {
                    "type": "boolean",
                    "description": "If `true`, targets this day. Defaults to `false` if you have filled in the `DateParting` fields. *(This parameter is part of Kevel's legacy day parting features. It is still supported, but will be ignored if a Flight has one or more new day parts. Learn more about new day parting features [here](https://dev.kevel.com/docs/day-hour-parting) and about legacy day parts [here](https://dev.kevel.com/docs/day-hour-parting-v1).)*",
                    "default": false
                  },
                  "IsWednesday": {
                    "type": "boolean",
                    "description": "If `true`, targets this day. Defaults to `false` if you have filled in the `DateParting` fields. *(This parameter is part of Kevel's legacy day parting features. It is still supported, but will be ignored if a Flight has one or more new day parts. Learn more about new day parting features [here](https://dev.kevel.com/docs/day-hour-parting) and about legacy day parts [here](https://dev.kevel.com/docs/day-hour-parting-v1).)*",
                    "default": false
                  },
                  "IsThursday": {
                    "type": "boolean",
                    "description": "If `true`, targets this day. Defaults to `false` if you have filled in the `DateParting` fields. *(This parameter is part of Kevel's legacy day parting features. It is still supported, but will be ignored if a Flight has one or more new day parts. Learn more about new day parting features [here](https://dev.kevel.com/docs/day-hour-parting) and about legacy day parts [here](https://dev.kevel.com/docs/day-hour-parting-v1).)*",
                    "default": false
                  },
                  "IsFriday": {
                    "type": "boolean",
                    "description": "If `true`, targets this day. Defaults to `false` if you have filled in the `DateParting` fields. *(This parameter is part of Kevel's legacy day parting features. It is still supported, but will be ignored if a Flight has one or more new day parts. Learn more about new day parting features [here](https://dev.kevel.com/docs/day-hour-parting) and about legacy day parts [here](https://dev.kevel.com/docs/day-hour-parting-v1).)*",
                    "default": false
                  },
                  "IsSaturday": {
                    "type": "boolean",
                    "description": "If `true`, targets this day. Defaults to `false` if you have filled in the `DateParting` fields. *(This parameter is part of Kevel's legacy day parting features. It is still supported, but will be ignored if a Flight has one or more new day parts. Learn more about new day parting features [here](https://dev.kevel.com/docs/day-hour-parting) and about legacy day parts [here](https://dev.kevel.com/docs/day-hour-parting-v1).)*",
                    "default": false
                  },
                  "IsArchived": {
                    "type": "boolean",
                    "description": "Specifies whether flight is archived.",
                    "default": false
                  },
                  "RequireStrictLocation": {
                    "type": "boolean",
                    "description": "If true, the ad request needs exact longitude and latitude in order to use GeoDistance targeting settings.",
                    "default": false
                  },
                  "TimeZone": {
                    "type": "string",
                    "description": "Sets a [supported IANA time zone string](https://dev.kevel.com/docs/time-zones-1#available-time-zones-strings) to be used for the flight's daily caps, daily goals, and day parting. Note that even if a non-UTC  `TimeZone` is set, start and end dates will still be in UTC.",
                    "default": "\"UTC\""
                  },
                  "IsTargetingOptimization": {
                    "type": "boolean",
                    "description": "Legacy parameter"
                  },
                  "TargetingOptimizationType": {
                    "type": "integer",
                    "description": "Legacy parameter",
                    "format": "int32"
                  },
                  "TargetingOptimizationTargetType": {
                    "type": "integer",
                    "description": "Legacy parameter",
                    "format": "int32"
                  },
                  "TargetingOptimizationTarget": {
                    "type": "number",
                    "description": "Legacy parameter",
                    "format": "float"
                  },
                  "TargetingOptimizationBurnIn": {
                    "type": "integer",
                    "description": "Legacy parameter",
                    "format": "int32"
                  },
                  "TargetingOptimizationCanMiss": {
                    "type": "boolean",
                    "description": "Legacy parameter"
                  },
                  "TargetROAS": {
                    "type": "number",
                    "description": "For CPC/CPA/CPM auctions, a target return can be selected on ad spend (ROAS) goal and the decision engine will automatically adjust the CPC/CPA/CPM bid to try to achieve the goal set. Acceptable values are expressed as a decimal between 0.01–99.99. This is equivalent to 1%–9,999%.",
                    "default": null,
                    "format": "float"
                  },
                  "BidModifiers": {
                    "type": "array",
                    "description": "See [Bid Modifiers documentation](https://dev.kevel.com/docs/bid-modifiers#how-to-configure-bid-modifiers-using-the-management-api) for example usage.",
                    "items": {
                      "properties": {
                        "Match": {
                          "type": "object",
                          "properties": {
                            "Keyword": {
                              "type": "string"
                            },
                            "Site": {
                              "type": "integer",
                              "format": "int32"
                            },
                            "Zone": {
                              "type": "integer",
                              "format": "int32"
                            },
                            "Segment": {
                              "type": "integer",
                              "format": "int32"
                            },
                            "SearchTerm": {
                              "type": "object",
                              "properties": {
                                "Term": {
                                  "type": "string"
                                }
                              }
                            },
                            "Category": {
                              "type": "object",
                              "description": "Match the category the ad request sends in `placements[].category`. The match ignores capitalization and is otherwise exact, after Kevel trims spaces from the start and end. A parent category does not match its children. A category match never makes an Ad eligible: it changes the bid of an Ad that is already eligible. Kevel accepts and applies a category match whether or not category targeting is enabled for your network.",
                              "required": [
                                "Id"
                              ],
                              "properties": {
                                "Id": {
                                  "type": "string",
                                  "description": "The category, a string of 1 to 200 characters after trimming."
                                }
                              }
                            }
                          }
                        }
                      },
                      "type": "object"
                    }
                  },
                  "SiteZoneTargeting": {
                    "type": "array",
                    "items": {
                      "properties": {
                        "SiteID": {
                          "type": "integer",
                          "description": "ID of targeted site",
                          "format": "int32"
                        },
                        "ZoneID": {
                          "type": "integer",
                          "description": "ID of targeted zone",
                          "format": "int32"
                        },
                        "IsExclude": {
                          "type": "boolean",
                          "description": "Whether or not the site is included or excluded"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "Geotargeting": {
                    "type": "array",
                    "items": {
                      "properties": {
                        "CountryCode": {
                          "type": "string",
                          "description": "The 2-3 character string that denotes the country you want to target"
                        },
                        "Region": {
                          "type": "string",
                          "description": "The 2-3 character string that denotes the region (or state) that you want to target"
                        },
                        "MetroCode": {
                          "type": "integer",
                          "description": "The 3 digit number that denotes the metropolitan area you want to target. US only.",
                          "format": "int32"
                        },
                        "City": {
                          "type": "string",
                          "description": "The name of the city you want to target"
                        },
                        "CityGeonameId": {
                          "type": "integer",
                          "description": "The numeric geoname ID that denotes the city you want to target. This is the value matched for city targeting. Retrieve valid IDs from the List Cities in Region endpoint.",
                          "format": "int32"
                        },
                        "IsExclude": {
                          "type": "boolean",
                          "description": "If leave blank, this will default to `false/null` and target the country. If you want to exclude it instead, use `true`",
                          "default": false
                        }
                      },
                      "type": "object"
                    }
                  },
                  "SegmentTargeting": {
                    "type": "array",
                    "items": {
                      "properties": {
                        "SegmentId": {
                          "type": "integer",
                          "format": "int32",
                          "description": "ID of the targeted Segment"
                        },
                        "IsExclude": {
                          "type": "boolean",
                          "default": "false"
                        }
                      },
                      "type": "object"
                    }
                  },
                  "CategoryTargeting": {
                    "type": "array",
                    "description": "The category targeting rules for the Flight. Each entry has an `Id`, the category to match, and `IsExclude`, which is `true` for an exclude rule and `false` for an include rule. Both keys are required. An `Id` can appear only once in the list, including once as an include and once as an exclude, otherwise the request returns a 400 with \"CategoryTargeting includes duplicate Id values, or it may be null.\" A Flight can hold up to 25 rules unless Kevel raises the limit for your network. A longer list returns a 400 with \"Your account has exceeded the limit for CategoryTargeting on this flight. Please contact support.\" Set the field to `null` or `[]` to remove the rules. If category targeting is not enabled for your network, Kevel ignores the field on writes and leaves it out of responses, and a malformed value still returns a 400. See [Set up category targeting](doc:set-up-category-targeting).",
                    "items": {
                      "type": "object",
                      "required": [
                        "Id",
                        "IsExclude"
                      ],
                      "properties": {
                        "Id": {
                          "type": "string",
                          "description": "The category to match, written exactly as your ad requests send it in `placements[].category`. Kevel trims spaces from the start and end when it saves the value, and matching is exact and ignores capitalization. A parent category does not match its children. The value is a string of 1 to 200 characters."
                        },
                        "IsExclude": {
                          "type": "boolean",
                          "description": "`true` for an exclude rule, `false` for an include rule."
                        }
                      }
                    }
                  },
                  "AttributionView": {
                    "type": "object",
                    "description": "The post-view attribution settings for this Flight. Set to `null` to disable. Learn more about [Kevel's attribution functionality](doc:attribution-overview).",
                    "properties": {
                      "MatchType": {
                        "type": "string",
                        "description": "The relationship between the purchased and advertised product. This choice represents the broadest acceptable match. Kevel will attempt to match purchases at the most specific level first (same product) and then look for broader shopper touch points up to this value.",
                        "enum": [
                          "SameProduct",
                          "SameCategoryBrand",
                          "SameBrand",
                          "SameMerchant"
                        ]
                      },
                      "LookbackWindow": {
                        "type": "string",
                        "description": "The eligible time period (days) between a sales transaction and an ad event.",
                        "enum": [
                          "1",
                          "7",
                          "14",
                          "30"
                        ]
                      },
                      "MatchMerchant": {
                        "type": "boolean",
                        "description": "If true, Kevel will only attribute sales that align with the selected `MatchType` _and_ the merchant(s) set via `AttributableItems` on Ads in this Flight must also match.",
                        "default": false
                      }
                    }
                  },
                  "AttributionClick": {
                    "type": "object",
                    "description": "The post-click attribution settings for this Flight. Set to `null` to disable. Learn more about [Kevel's attribution functionality](doc:attribution-overview).",
                    "properties": {
                      "MatchType": {
                        "type": "string",
                        "description": "The relationship between the purchased and advertised product. This choice represents the broadest acceptable match. Kevel will attempt to match purchases at the most specific level first (same product) and then look for broader shopper touch points up to this value.",
                        "enum": [
                          "SameProduct",
                          "SameCategoryBrand",
                          "SameBrand",
                          "SameMerchant"
                        ]
                      },
                      "LookbackWindow": {
                        "type": "string",
                        "description": "The eligible time period (days) between a sales transaction and an ad event.",
                        "enum": [
                          "1",
                          "7",
                          "14",
                          "30"
                        ]
                      },
                      "MatchMerchant": {
                        "type": "boolean",
                        "description": "If true, Kevel will only attribute sales that align with the selected `MatchType` _and_ the merchant(s) set via `AttributableItems` on Ads in this Flight must also match.",
                        "default": false
                      }
                    }
                  },
                  "SearchTerms": {
                    "type": "object",
                    "description": "See [Search Term Targeting](doc:search-term-targeting).",
                    "properties": {
                      "Term": {
                        "type": "string",
                        "description": "The term to match against"
                      },
                      "IsExclude": {
                        "type": "boolean",
                        "description": "Indicate whether the term should positively (false) or negatively (true)",
                        "default": false
                      },
                      "MatchType": {
                        "type": "string",
                        "default": "\"Broad\"",
                        "enum": [
                          "\"Broad\"",
                          "\"Strict\"",
                          "\"Exact\""
                        ]
                      }
                    }
                  },
                  "AttributionSettings": {
                    "type": "object",
                    "description": "Specify the products, categories, brands, and/or merchants that make a purchase eligible for attribution to Ads in this Flight. See [Attribution Overview](doc:attribution-overview) for more details.",
                    "properties": {
                      "AttributableItems": {
                        "type": "array"
                      }
                    }
                  }
                }
              },
              "examples": {
                "JSON": {
                  "value": {
                    "Name": "Basic Flight",
                    "StartDateISO": "2017-05-01",
                    "EndDateISO": "2017-12-31",
                    "CampaignId": 1234,
                    "PriorityId": 1234,
                    "GoalType": 1,
                    "Impressions": 10000,
                    "RateType": 2,
                    "Price": 5,
                    "CapType": 1,
                    "DailyCapAmount": 5000,
                    "LifetimeCapAmount": 50000,
                    "IsActive": true,
                    "Keywords": "exercise",
                    "CustomTargeting": null,
                    "GeoTargeting": null,
                    "SiteZoneTargeting": null,
                    "IsFreqCap": true,
                    "FreqCap": 2,
                    "FreqCapDuration": 10,
                    "FreqCapType": 1,
                    "DontAffectParentFreqCap": true,
                    "IsCompanion": true,
                    "IsNoDuplicates": false,
                    "IsTrackingConversions": true,
                    "CanPassback": true,
                    "PassbackSortOrder": 1,
                    "IsArchived": false,
                    "IsSunday": true,
                    "IsMonday": false,
                    "IsTuesday": false,
                    "IsWednesday": false,
                    "IsThursday": false,
                    "IsFriday": false,
                    "IsSaturday": true,
                    "TimeZone": "America/New_York",
                    "IsECPMOptimized": true,
                    "ECPMOptimizePeriod": 30,
                    "ECPMMultiplier": 1.25,
                    "FloorECPM": 0.15,
                    "CeilingECPM": 0.35,
                    "DefaultECPM": 0.28,
                    "ECPMBurnInImpressions": 1000,
                    "BehavioralTargeting": {
                      "onClick": {
                        "stopShowingAdsFromFlight": true,
                        "stopShowingAdsFromAdvertiser": true,
                        "storeCategoriesFromFlightAsInterest": true
                      },
                      "onConvert": {
                        "stopShowingAdsFromFlight": true,
                        "stopShowingAdsFromAdvertiser": true,
                        "storeCategoriesFromFlightAsInterest": true
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "200",
            "content": {
              "application/json": {
                "examples": {
                  "Result": {
                    "value": "{\n  \"Id\": 1234,\n  \"StartDateISO\": \"2017-05-01T00:00:00.0000000\",\n  \"EndDateISO\": \"2017-12-31T00:00:00.0000000\",\n  \"NoEndDate\": false,\n  \"Price\": 5,\n  \"Impressions\": 10000,\n  \"IsNoDuplicates\": false,\n  \"IsCompanion\": true,\n  \"Keywords\": \"exercise\",\n  \"Name\": \"Basic Flight\",\n  \"IsFreqCap\": true,\n  \"CampaignId\": 1234,\n  \"PriorityId\": 1234,\n  \"DeliveryStatus\": 0,\n  \"IsDeleted\": false,\n  \"IsActive\": true,\n  \"GeoTargeting\": [\n    {\n      \"CountryCode\": \"US\",\n      \"Region\": \"NC\",\n      \"MetroCode\": 560,\n      \"City\": \"Durham\",\n      \"CityGeonameId\": 4464368,\n      \"IsExclude\": false\n    }\n  ],\n  \"SiteZoneTargeting\": [\n    {\n      \"SiteId\": 123,\n      \"ZoneId\": 321,\n      \"IsExclude\": false\n    }\n  ],\n  \"CustomTargeting\": null,\n  \"SegmentTargting\": [\n    {\n      \"FlightId\": 1234,\n      \"SegmentId\": 567,\n      \"IsExclude\": false,\n      \"Id\": 5195,\n      \"Segment\": {\n        \"Description\": \"\",\n        \"Reach\": null,\n        \"Id\": 567,\n        \"Source\": null,\n        \"Name\": \"Age 25-34\",\n        \"Category\": \"Age Demographics\"\n      }\n    }\n  ],\n  \"GoalType\": 1,\n  \"RateType\": 2,\n  \"IsECPMOptimized\": true,\n  \"ECPMOptimizePeriod\": 30,\n  \"ECPMMultiplier\": 1.25,\n  \"FloorECPM\": 0.15,\n  \"CeilingECPM\": 0.35,\n  \"DefaultECPM\": 0.28,\n  \"ECPMBurnInImpressions\": 1000,\n  \"EffectiveCPMOverride\": null,\n  \"DatePartingStartTimeISO\": null,\n  \"DatePartingEndTimeISO\": null,\n  \"IsSunday\": true,\n  \"IsMonday\": false,\n  \"IsTuesday\": false,\n  \"IsWednesday\": false,\n  \"IsThursday\": false,\n  \"IsFriday\": false,\n  \"IsSaturday\": true,\n  \"TimeZone\": \"America/New_York\",\n  \"FreqCap\": 2,\n  \"FreqCapDuration\": 10,\n  \"FreqCapType\": 1,\n  \"CapType\": 1,\n  \"DailyCapAmount\": 5000,\n  \"LifetimeCapAmount\": 50000,\n  \"CustomFieldsJson\": null,\n  \"BehavioralTargeting\": {\n    \"onClick\": {\n      \"stopShowingAdsFromFlight\": true,\n      \"stopShowingAdsFromAdvertiser\": true,\n      \"storeCategoriesFromFlightAsInterest\": true\n    },\n    \"onConvert\": {\n      \"stopShowingAdsFromFlight\": true,\n      \"stopShowingAdsFromAdvertiser\": true,\n      \"storeCategoriesFromFlightAsInterest\": true\n    }\n  },\n  \"IsArchived\": null,\n  \"IsTrackingConversions\": true,\n  \"RequireStrictLocation\": false,\n  \"CanPassback\": true,\n\"PassbackSortOrder\":[\n  }              "
                  }
                },
                "schema": {
                  "type": "object",
                  "properties": {
                    "Id": {
                      "type": "integer",
                      "example": 1234,
                      "default": 0
                    },
                    "StartDateISO": {
                      "type": "string",
                      "example": "2017-05-01T00:00:00.0000000"
                    },
                    "EndDateISO": {
                      "type": "string",
                      "example": "2017-12-31T00:00:00.0000000"
                    },
                    "NoEndDate": {
                      "type": "boolean",
                      "example": false,
                      "default": true
                    },
                    "Price": {
                      "type": "integer",
                      "example": 5,
                      "default": 0
                    },
                    "Impressions": {
                      "type": "integer",
                      "example": 10000,
                      "default": 0
                    },
                    "IsNoDuplicates": {
                      "type": "boolean",
                      "example": false,
                      "default": true
                    },
                    "IsCompanion": {
                      "type": "boolean",
                      "example": true,
                      "default": true
                    },
                    "Keywords": {
                      "type": "string",
                      "example": "exercise"
                    },
                    "Name": {
                      "type": "string",
                      "example": "Basic Flight"
                    },
                    "IsFreqCap": {
                      "type": "boolean",
                      "example": true,
                      "default": true
                    },
                    "CampaignId": {
                      "type": "integer",
                      "example": 1234,
                      "default": 0
                    },
                    "PriorityId": {
                      "type": "integer",
                      "example": 1234,
                      "default": 0
                    },
                    "DeliveryStatus": {
                      "type": "integer",
                      "example": 0,
                      "default": 0
                    },
                    "IsDeleted": {
                      "type": "boolean",
                      "example": false,
                      "default": true
                    },
                    "IsActive": {
                      "type": "boolean",
                      "example": true,
                      "default": true
                    },
                    "GeoTargeting": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "CountryCode": {
                            "type": "string",
                            "example": "US"
                          },
                          "Region": {
                            "type": "string",
                            "example": "NC"
                          },
                          "MetroCode": {
                            "type": "integer",
                            "example": 560,
                            "default": 0
                          },
                          "City": {
                            "type": "string",
                            "example": "Durham"
                          },
                          "CityGeonameId": {
                            "type": "integer",
                            "example": 4464368,
                            "default": 0
                          },
                          "IsExclude": {
                            "type": "boolean",
                            "example": false,
                            "default": true
                          }
                        }
                      }
                    },
                    "SiteZoneTargeting": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "SiteId": {
                            "type": "integer",
                            "example": 123,
                            "default": 0
                          },
                          "ZoneId": {
                            "type": "integer",
                            "example": 321,
                            "default": 0
                          },
                          "IsExclude": {
                            "type": "boolean",
                            "example": false,
                            "default": true
                          }
                        }
                      }
                    },
                    "CustomTargeting": {},
                    "SegmentTargeting": {
                      "type": "array",
                      "items": {
                        "properties": {
                          "Id": {
                            "type": "integer",
                            "format": "int32"
                          },
                          "FlightId": {
                            "type": "integer",
                            "format": "int32"
                          },
                          "SegmentId": {
                            "type": "integer",
                            "format": "int32"
                          },
                          "IsExclude": {
                            "type": "boolean",
                            "default": "false"
                          },
                          "Segment": {
                            "type": "object",
                            "properties": {},
                            "description": "Details of the targeted Segment"
                          }
                        },
                        "type": "object"
                      }
                    },
                    "GoalType": {
                      "type": "integer",
                      "example": 1,
                      "default": 0
                    },
                    "RateType": {
                      "type": "integer",
                      "example": 2,
                      "default": 0
                    },
                    "IsECPMOptimized": {
                      "type": "boolean",
                      "example": true,
                      "default": true
                    },
                    "ECPMOptimizePeriod": {
                      "type": "integer",
                      "example": 30,
                      "default": 0
                    },
                    "ECPMMultiplier": {
                      "type": "number",
                      "example": 1.25,
                      "default": 0
                    },
                    "FloorECPM": {
                      "type": "number",
                      "example": 0.15,
                      "default": 0
                    },
                    "CeilingECPM": {
                      "type": "number",
                      "example": 0.35,
                      "default": 0
                    },
                    "DefaultECPM": {
                      "type": "number",
                      "example": 0.28,
                      "default": 0
                    },
                    "ECPMBurnInImpressions": {
                      "type": "integer",
                      "example": 1000,
                      "default": 0
                    },
                    "EffectiveCPMOverride": {
                      "type": "number"
                    },
                    "DatePartingStartTimeISO": {},
                    "DatePartingEndTimeISO": {},
                    "IsSunday": {
                      "type": "boolean",
                      "example": true,
                      "default": true
                    },
                    "IsMonday": {
                      "type": "boolean",
                      "example": false,
                      "default": true
                    },
                    "IsTuesday": {
                      "type": "boolean",
                      "example": false,
                      "default": true
                    },
                    "IsWednesday": {
                      "type": "boolean",
                      "example": false,
                      "default": true
                    },
                    "IsThursday": {
                      "type": "boolean",
                      "example": false,
                      "default": true
                    },
                    "IsFriday": {
                      "type": "boolean",
                      "example": false,
                      "default": true
                    },
                    "IsSaturday": {
                      "type": "boolean",
                      "example": true,
                      "default": true
                    },
                    "TimeZone": {
                      "type": "string",
                      "example": "America/New_York"
                    },
                    "FreqCap": {
                      "type": "integer",
                      "example": 2,
                      "default": 0
                    },
                    "FreqCapDuration": {
                      "type": "integer",
                      "example": 10,
                      "default": 0
                    },
                    "FreqCapType": {
                      "type": "integer",
                      "example": 1,
                      "default": 0
                    },
                    "CapType": {
                      "type": "integer",
                      "example": 1,
                      "default": 0
                    },
                    "DailyCapAmount": {
                      "type": "integer",
                      "example": 5000,
                      "default": 0
                    },
                    "LifetimeCapAmount": {
                      "type": "integer",
                      "example": 50000,
                      "default": 0
                    },
                    "CustomFieldsJson": {},
                    "BehavioralTargeting": {
                      "type": "object",
                      "properties": {
                        "onClick": {
                          "type": "object",
                          "properties": {
                            "stopShowingAdsFromFlight": {
                              "type": "boolean",
                              "example": true,
                              "default": true
                            },
                            "stopShowingAdsFromAdvertiser": {
                              "type": "boolean",
                              "example": true,
                              "default": true
                            },
                            "storeCategoriesFromFlightAsInterest": {
                              "type": "boolean",
                              "example": true,
                              "default": true
                            }
                          }
                        },
                        "onConvert": {
                          "type": "object",
                          "properties": {
                            "stopShowingAdsFromFlight": {
                              "type": "boolean",
                              "example": true,
                              "default": true
                            },
                            "stopShowingAdsFromAdvertiser": {
                              "type": "boolean",
                              "example": true,
                              "default": true
                            },
                            "storeCategoriesFromFlightAsInterest": {
                              "type": "boolean",
                              "example": true,
                              "default": true
                            }
                          }
                        }
                      }
                    },
                    "IsArchived": {},
                    "IsTrackingConversions": {
                      "type": "boolean",
                      "example": true,
                      "default": true
                    },
                    "RequireStrictLocation": {
                      "type": "boolean",
                      "example": false,
                      "default": true
                    },
                    "CanPassback": {
                      "type": "boolean",
                      "example": true,
                      "default": true
                    },
                    "PassbackSortOrder": {
                      "type": "integer",
                      "example": 1,
                      "default": 0
                    },
                    "CategoryTargeting": {
                      "type": "array",
                      "description": "The category targeting rules saved on the Flight, each with an `Id` and `IsExclude`. Left out when category targeting is not enabled for your network.",
                      "items": {
                        "type": "object",
                        "properties": {
                          "Id": {
                            "type": "string",
                            "description": "The category the rule matches."
                          },
                          "IsExclude": {
                            "type": "boolean",
                            "description": "`true` for an exclude rule, `false` for an include rule."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "deprecated": false,
        "x-readme": {
          "code-samples": [
            {
              "language": "curl",
              "code": "# The example below is a minimally viable flight that has no End Date and is set with a Percentage Goal of 100. \ncurl -X POST \\\n     -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \\\n     -H \"Content-Type:application/json\" \\\n     \"https://api.kevel.co/v1/flight\" \\\n     --data-binary '{\"Name\":\"Basic Flight\",\"StartDateISO\":\"2017-05-01\",\"CampaignId\":123456,\"PriorityId\":12345,\"GoalType\":2,\"RateType\":2,\"Impressions\":100,\"IsActive\":true}'"
            },
            {
              "language": "javascript",
              "code": "const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function createFlight() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let flight = await client.run(\"flight\", \"create\", {\n    name: \"Flight Name\",\n    isActive: true,\n    startDateIso: \"2020-01-01\",\n    priorityId: 207820,\n    campaignId: 1752671,\n    goalType: Adzerk.GoalType.Percentage,\n    impressions: 100, // 100% goal\n    rateType: Adzerk.RateType.Cpm, \n    price: 0.25, // $0.25 for thousand impressions\n  });\n\n  console.log(flight);\n}\n\ncreateFlight();"
            },
            {
              "language": "ruby",
              "code": "require \"adzerk\"\n\ndef create_flight()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    data = {\n        name: \"Flight Name\",\n        is_active: true,\n        start_date_iso: \"2020-01-01\",\n        priority_id: 12345,\n        campaign_id: 67890,\n        goal_type: 2, # Percentage goal\n        impressions: 100, # 100% goal\n        rate_type: 2, # CPM: \"cost per mille\", i.e. cost per thousand impressions\n        price: 0.25, # $0.25 for thousand impressions\n    }\n    pp client.flights.create(data)\nend\ncreate_flight()"
            }
          ],
          "samples-languages": [
            "curl",
            "javascript",
            "ruby"
          ]
        }
      }
    }
  },
  "x-readme": {
    "headers": [
      {
        "key": "X-Adzerk-Sdk-Version",
        "value": "Readme.io:ManagementAPI2"
      }
    ],
    "explorer-enabled": false,
    "proxy-enabled": true
  },
  "x-readme-fauxas": true
}
```