---
title: "Create Flight"
method: POST
path: "/v1/flight"
---

# Create Flight

`POST /v1/flight`

## Request

- Base URL: `https://api.kevel.co`
- URL: `https://api.kevel.co/v1/flight`
- Auth: API key in header `X-Adzerk-ApiKey`

This API call adds a new flight to a campaign.

## Request body

- object
  - `Name` string, required: The flight name. Max length is 300 characters.
  - `StartDateISO` string, required: 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` integer, required: The ID of the campaign.
  - `PriorityId` integer, required: The ID of the [Priority](doc:priorities). Here are the [Priority API endpoints](ref:priority).
  - `GoalType` integer, required: 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)
  - `Impressions` integer, required: 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.
  - `IsActive` boolean, required: Specifies whether campaigns should be active or inactive. Defaults to `false`.
  - `RateType` integer, required: 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`.
  - `EndDateISO` string: 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` boolean: Specifies whether flight should be deleted. Do not use when creating a flight. Defaults to `false`.
  - `Price` number, float: The Price value - instructions [here](doc:flights#rateprice).
  - `CapType` integer: 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`.
  - `DailyCapAmount` integer: The maximum # of `CapType` per day. Instructions [here](doc:flights#caps).
  - `LifetimeCapAmount` integer: The maximum # of `CapType` per lifetime. Instructions [here](doc:flights#caps).
  - `Keywords` string: Keywords used for targeting. Instructions [here](https://dev.kevel.com/docs/keyword-targeting).
  - `CustomTargeting` string: Zerkel string for Custom targeting. Instructions [here](https://dev.kevel.com/docs/custom-targeting). The maximum string length for `CustomTargeting` is 1000 characters.
  - `CustomFieldsJSON` string: Sets the value of custom fields based on a custom fields schema. Must contact support before use. More info [here](doc:custom-fields).
  - `IsFreqCap` boolean: 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` integer: The number of times the frequency cap should occur. Cannot be 0 unless `FreqCapType` is None (0).
  - `FreqCapDuration` integer: Specifies how often the frequency cap should occur. Cannot be 0 unless `FreqCapType` is None (0).
  - `FreqCapType` integer: Specifies which unit of time you would like frequency capping to occur. Key: `1 = Hour 2 = Day 3 = Minute`.
  - `DontAffectParentFreqCap` boolean: If true, opts-it out of frequency cap settings imposed at advertiser or campaign level.
  - `IsCompanion` boolean: 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` boolean: If `true`, enables no duplicates. `IsCompanion` must be set to `false` when `IsNoDuplicates` is true, and vice versa.
  - `DuplicateMode` integer: Indicates which level no duplicates should be enforced on. Key follows: `1: Flight 2: Campaign 3: Advertiser 4: Creative`.
  - `DeliveryStatus` integer: 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).
  - `IsTrackingConversions` boolean: If `true`, enables conversion tracking endpoints/pixels.
  - `CanPassback` boolean: Sets whether a flight in an adChained-enabled priority can pass back to the next flight in the adChain.
  - `PassbackSortOrder` integer: 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.
  - `IsECPMOptimized` boolean: Specifies whether `ECPM Optimization` is enabled.
  - `ECPMOptimizePeriod` integer: Timeframe to optimize for [1 - 90 days].
  - `ECPMMultiplier` number, float: The final eCPM will be multiplied by this amount. Must be at least 0.01.
  - `FloorECPM` number, float: Minimum eCPM. Must be at least 0.01.
  - `CeilingECPM` number, float: Maximum eCPM. Must be at least 0.01.
  - `DefaultECPM` number, float: 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.
  - `ECPMBurnInImpressions` integer: Impressions per creative over which the eCPM moves from the default eCPM to the calculated eCPM [1 - 2147483648].
  - `EffectiveCPMOverride` number, float: Sets a manual override to a flight's CPM, e.g. so a Flat Rate flight can compete in an auction priority.
  - `DatePartingStartTimeISO` string: 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).)*
  - `DatePartingEndTimeISO` string: 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).)*
  - `IsSunday` boolean: 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).)*
  - `IsMonday` boolean: 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).)*
  - `IsTuesday` boolean: 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).)*
  - `IsWednesday` boolean: 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).)*
  - `IsThursday` boolean: 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).)*
  - `IsFriday` boolean: 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).)*
  - `IsSaturday` boolean: 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).)*
  - `IsArchived` boolean: Specifies whether flight is archived.
  - `RequireStrictLocation` boolean: If true, the ad request needs exact longitude and latitude in order to use GeoDistance targeting settings.
  - `TimeZone` string: 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.
  - `IsTargetingOptimization` boolean: Legacy parameter
  - `TargetingOptimizationType` integer: Legacy parameter
  - `TargetingOptimizationTargetType` integer: Legacy parameter
  - `TargetingOptimizationTarget` number, float: Legacy parameter
  - `TargetingOptimizationBurnIn` integer: Legacy parameter
  - `TargetingOptimizationCanMiss` boolean: Legacy parameter
  - `TargetROAS` number, float: 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%.
  - `BidModifiers` object[]: See [Bid Modifiers documentation](https://dev.kevel.com/docs/bid-modifiers#how-to-configure-bid-modifiers-using-the-management-api) for example usage.
    - `Match` object
      - `Keyword` string
      - `Site` integer
      - `Zone` integer
      - `Segment` integer
      - `SearchTerm` object
        - `Term` string
      - `Category` object: Match the category the ad request sends in `placements[].category`. The match is exact and case-sensitive after Kevel trims spaces from the start and end, and 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.
        - `Id` string, required: The category, a string of 1 to 200 characters after trimming.
  - `SiteZoneTargeting` object[]
    - `SiteID` integer: ID of targeted site
    - `ZoneID` integer: ID of targeted zone
    - `IsExclude` boolean: Whether or not the site is included or excluded
  - `Geotargeting` object[]
    - `CountryCode` string: The 2-3 character string that denotes the country you want to target
    - `Region` string: The 2-3 character string that denotes the region (or state) that you want to target
    - `MetroCode` integer: The 3 digit number that denotes the metropolitan area you want to target. US only.
    - `City` string: The name of the city you want to target
    - `CityGeonameId` integer: 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.
    - `IsExclude` boolean: If leave blank, this will default to `false/null` and target the country. If you want to exclude it instead, use `true`
  - `SegmentTargeting` object[]
    - `SegmentId` integer: ID of the targeted Segment
    - `IsExclude` boolean
  - `CategoryTargeting` object[]: 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).
    - `Id` string, required: 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 case-sensitive. A parent category does not match its children. The value is a string of 1 to 200 characters.
    - `IsExclude` boolean, required: `true` for an exclude rule, `false` for an include rule.
  - `AttributionView` object: The post-view attribution settings for this Flight. Set to `null` to disable. Learn more about [Kevel's attribution functionality](doc:attribution-overview).
    - `MatchType` 'SameProduct' | 'SameCategoryBrand' | 'SameBrand' | 'SameMerchant': 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.
    - `LookbackWindow` '1' | '7' | '14' | '30': The eligible time period (days) between a sales transaction and an ad event.
    - `MatchMerchant` boolean: 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.
  - `AttributionClick` object: The post-click attribution settings for this Flight. Set to `null` to disable. Learn more about [Kevel's attribution functionality](doc:attribution-overview).
    - `MatchType` 'SameProduct' | 'SameCategoryBrand' | 'SameBrand' | 'SameMerchant': 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.
    - `LookbackWindow` '1' | '7' | '14' | '30': The eligible time period (days) between a sales transaction and an ad event.
    - `MatchMerchant` boolean: 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.
  - `SearchTerms` object: See [Search Term Targeting](doc:search-term-targeting).
    - `Term` string: The term to match against
    - `IsExclude` boolean: Indicate whether the term should positively (false) or negatively (true)
    - `MatchType` '"Broad"' | '"Strict"' | '"Exact"'
  - `AttributionSettings` object: 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.
    - `AttributableItems` unknown[]
      - unknown

## Response `200`

200

- object
  - `Id` integer
  - `StartDateISO` string
  - `EndDateISO` string
  - `NoEndDate` boolean
  - `Price` integer
  - `Impressions` integer
  - `IsNoDuplicates` boolean
  - `IsCompanion` boolean
  - `Keywords` string
  - `Name` string
  - `IsFreqCap` boolean
  - `CampaignId` integer
  - `PriorityId` integer
  - `DeliveryStatus` integer
  - `IsDeleted` boolean
  - `IsActive` boolean
  - `GeoTargeting` object[]
    - `CountryCode` string
    - `Region` string
    - `MetroCode` integer
    - `City` string
    - `CityGeonameId` integer
    - `IsExclude` boolean
  - `SiteZoneTargeting` object[]
    - `SiteId` integer
    - `ZoneId` integer
    - `IsExclude` boolean
  - `CustomTargeting` unknown
  - `SegmentTargeting` object[]
    - `Id` integer
    - `FlightId` integer
    - `SegmentId` integer
    - `IsExclude` boolean
    - `Segment` object: Details of the targeted Segment
  - `GoalType` integer
  - `RateType` integer
  - `IsECPMOptimized` boolean
  - `ECPMOptimizePeriod` integer
  - `ECPMMultiplier` number
  - `FloorECPM` number
  - `CeilingECPM` number
  - `DefaultECPM` number
  - `ECPMBurnInImpressions` integer
  - `EffectiveCPMOverride` number
  - `DatePartingStartTimeISO` unknown
  - `DatePartingEndTimeISO` unknown
  - `IsSunday` boolean
  - `IsMonday` boolean
  - `IsTuesday` boolean
  - `IsWednesday` boolean
  - `IsThursday` boolean
  - `IsFriday` boolean
  - `IsSaturday` boolean
  - `TimeZone` string
  - `FreqCap` integer
  - `FreqCapDuration` integer
  - `FreqCapType` integer
  - `CapType` integer
  - `DailyCapAmount` integer
  - `LifetimeCapAmount` integer
  - `CustomFieldsJson` unknown
  - `BehavioralTargeting` object
    - `onClick` object
      - `stopShowingAdsFromFlight` boolean
      - `stopShowingAdsFromAdvertiser` boolean
      - `storeCategoriesFromFlightAsInterest` boolean
    - `onConvert` object
      - `stopShowingAdsFromFlight` boolean
      - `stopShowingAdsFromAdvertiser` boolean
      - `storeCategoriesFromFlightAsInterest` boolean
  - `IsArchived` unknown
  - `IsTrackingConversions` boolean
  - `RequireStrictLocation` boolean
  - `CanPassback` boolean
  - `PassbackSortOrder` integer
  - `CategoryTargeting` object[]: 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.
    - `Id` string: The category the rule matches.
    - `IsExclude` boolean: `true` for an exclude rule, `false` for an include rule.

---

[API](https://skmtc.dev/kevel/apis/management-api-2.md) - [All operations](https://skmtc.dev/kevel/apis/management-api-2/llms.txt) - [OpenAPI document](https://skmtc.dev/kevel/apis/management-api-2/revisions/fe6c8716ca08?raw)
