---
title: "Create Campaign V2"
method: POST
path: "/v2/campaign"
---

# Create Campaign V2

`POST /v2/campaign`

Create a Campaign and nested Flights/Creatives/Ads

## Request body

- object
  - `AdvertiserId` integer, required — The advertiser's ID for the campaign.
  - `Name` string, required — The campaign name. Max 200 characters.
  - `Flights` object[] — You can pass an array of flights, a blank array, or not include. See [Create Flight](https://dev.kevel.com/v1.0/reference/flight#create-flight) endpoint.
    - `Ads` object[]
      - `Creative` object — An object containing the attributes of the Creative which should be created.
        - `AdTypeId` integer, required — The ad size's ID. More info [here](https://dev.kevel.com/docs/ad-sizes).
        - `IsActive` boolean, required — Specifies whether creative is eligible to serve.
        - `Title` string — A short description of creative (in UI, it is called 'Friendly Name'). Max 500 characters.
        - `ImageName` string — The file name as it is stored in our database. It is not needed to create a creative, but it will be passed back in the result view. If the string is manually entered, it will result in a null string.
        - `Body` string — This is the body text associated with AdType 1 (in UI it's called "Text"). If AdType1 is not being used, pass an empty string: `""`.
        - `Url` string — The click URL. Max length is 2000 characters. Must not contain leading or trailing spaces.
        - `Alt` string — Alt text.
        - `IsHTMLJS` boolean — Specifies whether to override image with HTML or JavaScript ad. If `true` = the `ScriptBody` field should have value.
        - `ScriptBody` string — If `IsHTMLJS` = `true`, then this field needs to be filled with a HTML/JavaScript ad.
        - `Metadata` string — Adds custom [metadata](https://dev.adzerk.com/docs/creatives#section-metadata-field) to your creative. Note that this should be a JSON **object** in a string, for example: `{ ... "Metadata": "{ \"foo\":1234 }" }` The entire Metadata string must be url encoded to support URLs and special characters that can break the JSON object. Maximum character limit of 1000 characters.
        - `ImageLink` string — The URL of an image hosted remotely. Use if you are serving an image file without uploading it to Kevel's CDN or calling it in the `ScriptBody`
        - `SaveEmptyCreative` boolean — If set to `true`, this allows you to save or update a creative that contains no `ScriptBody` or `Metadata`. Note that `SaveEmptyCreative` is not a database field on the creative object, but is instead an option when creating or updating creatives. This means that the `SaveEmptyCreative` parameter will always be returned as `null` once a creative has been created.
        - `IsNoTrack` boolean — Indicates that a creative originating from a third-party (i.e. it uses third-party ad tags) is EFF Do Not Track compliant. Can only be used if DNT is enabled for your account.
        - `IsNetworkAd` boolean — Indicates that a creative originates from a third-party source (such as an ad network) that will serve multiple ads. (BETA)
        - `TemplateId` integer — If you are using a creative template, specifies which template to use. IDs can be retrieved from the Creative Template API.
        - `TemplateValues` string — If you are using a creative template, sets the values for the fields in the creative. Fields must match the TemplateId and the object must be wrapped in a string. For example: `"{\"ctString\":\"A string goes here\",\"ctExternalFile\":\"http://cdn.com/ad.gif\"}"`
      - `IsActive` boolean — Whether ad should be eligible to serve. Defaults to `false`
      - `ExternalMetadata` object — Object containing key/value pairs for customer's use. Max length when serialized of 512 characters.
      - `FreqCapType` integer — The enum value for how often frequency capping should occur. 1 = Hour 2 = Day 3 = Minute.
      - `FreqCap` integer — The number of times the frequency cap should occur.
      - `FreqCapDuration` integer — Specifies how often the frequency cap should occur.
      - `DontAffectParentFreqCap` boolean — "Opts-out" campaign from advertiser-level frequency cap settings.
    - `Jobs` object[] — Optional list of objects, each representing a `create-ads-from-products` Job. The jobs will be performed asynchronously and the resulting Ads will be added to this Flight. See [Submit Job](https://dev.kevel.com/reference/submit-jobs) for more details.
      - `TaskId` 'create-ads-from-products' | 'create-ads-from-product-query' | 'create-native-product-ad', required — The type of task you are submitting.
      - `TaskArgs` object — Arguments specific to your TaskId
    - `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.
    - `PriorityId` integer, required — The ID of the [Priority](https://dev.adzerk.com/docs/priorities). Here are the [Priority API endpoints](https://dev.adzerk.com/v1.0/reference/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](https://dev.adzerk.com/v1.0/docs/flights#section-goals)
    - `Impressions` integer, required — The goal amount - specifies the number of GoalTypes to aim for during the life of the campaign. The upper limit is 2147483647. Instructions are [here](https://dev.kevel.com/v1.0/docs/flights#section-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` '1' | '2' | '3' | '4' | '5' | '6', required — The Rate value - instructions [here](https://dev.adzerk.com/v1.0/docs/flights#section-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`.
    - `Price` number, float — The Price value - instructions [here](https://dev.adzerk.com/v1.0/docs/flights#section-rateprice).
    - `CapType` '1' | '2' | '3' | '4' — The cap type metric. Instructions [here](https://dev.adzerk.com/v1.0/docs/flights#section-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](https://dev.kevel.com/v1.0/docs/flights#section-caps).
    - `LifetimeCapAmount` integer — The maximum # of `CapType` per lifetime. Instructions [here](https://dev.kevel.com/v1.0/docs/flights#section-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](https://dev.kevel.com/v1.0/docs/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](https://dev.kevel.com/docs/additional-display-rules#section-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`.
    - `IsTrackingConversions` boolean — If `true`, enables conversion tracking endpoints/pixels.
    - `CanPassback` string — 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 that will be used while the Flight is in burn-in mode. Must be at least 0.01.
    - `ECPMBurnInImpressions` integer — Impressions per creative to show before using the calculated eCPM over the default 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.
    - `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/reference/queued-reports#available-time-zone-strings-beta) 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.
    - `TargetROAS` number, float — For CPC auctions, a target return can be selected on ad spend (ROAS) goal and the decision engine will automatically adjust the CPC 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%.
    - `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.
      - `IsExclude` boolean — If leave blank, this will default to `false/null` and target the country. If you want to exclude it instead, use `true`
  - `IsActive` boolean — Specifies whether campaign should be active (serving ads). Defaults to `false`.
  - `FreqCapType` integer — The enum value for how often frequency capping should occur. `1 = Hour 2 = Day 3 = Minute`.
  - `FreqCap` integer — The number of times the frequency cap should occur.
  - `FreqCapDuration` integer — Specifies how often the frequency cap should occur.
  - `DontAffectParentFreqCap` boolean — "Opts-out" campaign from advertiser-level frequency cap settings.
  - `CapType` integer — Set to `CapType = 4`. Campaigns can only budget cap on revenue metric. Do not set to `0` - if removing, set to `null`.
  - `DailyCapAmount` integer — The max daily revenue.
  - `LifetimeCapAmount` integer — The max lifetime revenue.
  - `CustomFieldsJson` string — Stringified JSON value containing Custom Fields. See https://dev.kevel.com/docs/custom-fields
  - `SalespersonId` integer — Network-level login Id of salesperson

## Response `200`

200

---

[API](https://skmtc.net/kevel/apis/engine-apis.md) · [All operations](https://skmtc.net/kevel/apis/engine-apis/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/kevel/engine-apis/versions/0ca55f45aa7d/schema)
