{"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/instantcounts/advertiser/{AdvertiserID}":{"get":{"summary":"Get Advertiser Counts","description":"This returns real time reporting data for an advertiser.","operationId":"get-advertiser-counts","parameters":[{"name":"AdvertiserID","in":"path","description":"ID of the Advertiser","schema":{"type":"integer","format":"int32"},"required":true},{"name":"days","in":"query","description":"Returns data for the number of days since the current day. You can request a maximum of 90 days of data and a minimum of 0. `days=0` returns data for the current day.","schema":{"type":"integer","format":"int32"}},{"name":"start","in":"query","description":"In the format of YYYY-MM-DD. Returns data starting from the date specified. Must be within the past 90 days. If no `end` is included, this will return data up to the current day.","schema":{"type":"string"}},{"name":"end","in":"query","description":"In the format of YYYY-MM-DD. Returns data ending at the date specified. Must be within the past 90 days.","schema":{"type":"string"}}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"advertisers\": {\n    \"123\": {\n      \"impressions\": 3097,\n      \"conversions\": 12,\n      \"revenue\": 49.11279,\n      \"clicks\": 149\n    }\n  }\n}"},"200 OK - Multi Day":{"value":"{\n  \"advertisers\": {\n    \"123\": {\n      \"2017-04-18\": {\n        \"impressions\": 1,\n        \"conversions\": 1,\n        \"revenue\": 0,\n        \"clicks\": 0\n      },\n      \"2017-04-19\": {\n        \"impressions\": 2,\n        \"conversions\": 0,\n        \"revenue\": 0,\n        \"clicks\": 2\n      },\n      \"2017-04-20\": {\n        \"impressions\": 3,\n        \"conversions\": 0,\n        \"revenue\": 0,\n        \"clicks\": 0\n      },\n      \"total\": {\n        \"impressions\": 6,\n        \"conversions\": 1,\n        \"revenue\": 0,\n        \"clicks\": 2\n      }\n    }\n  }\n}"}},"schema":{"oneOf":[{"type":"object","properties":{"advertisers":{"type":"object","properties":{"123":{"type":"object","properties":{"impressions":{"type":"integer","example":3097,"default":0},"conversions":{"type":"integer","example":12,"default":0},"revenue":{"type":"number","example":49.11279,"default":0},"clicks":{"type":"integer","example":149,"default":0}}}}}}},{"title":"200 OK - Multi Day","type":"object","properties":{"advertisers":{"type":"object","properties":{"123":{"type":"object","properties":{"2017-04-18":{"type":"object","properties":{"impressions":{"type":"integer","example":1,"default":0},"conversions":{"type":"integer","example":1,"default":0},"revenue":{"type":"integer","example":0,"default":0},"clicks":{"type":"integer","example":0,"default":0}}},"2017-04-19":{"type":"object","properties":{"impressions":{"type":"integer","example":2,"default":0},"conversions":{"type":"integer","example":0,"default":0},"revenue":{"type":"integer","example":0,"default":0},"clicks":{"type":"integer","example":2,"default":0}}},"2017-04-20":{"type":"object","properties":{"impressions":{"type":"integer","example":3,"default":0},"conversions":{"type":"integer","example":0,"default":0},"revenue":{"type":"integer","example":0,"default":0},"clicks":{"type":"integer","example":0,"default":0}}},"total":{"type":"object","properties":{"impressions":{"type":"integer","example":6,"default":0},"conversions":{"type":"integer","example":1,"default":0},"revenue":{"type":"integer","example":0,"default":0},"clicks":{"type":"integer","example":2,"default":0}}}}}}}}}]}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H 'X-Adzerk-ApiKey:<API-KEY>' 'https://api.kevel.co/v1/instantcounts/advertiser/123'\n\n# Using Days\ncurl -X GET -H 'X-Adzerk-ApiKey:<API-KEY>' 'https://api.kevel.co/v1/instantcounts/advertiser/123?days=42'\n\n# Using Start/End\ncurl -X GET -H 'X-Adzerk-ApiKey:<API-KEY>' 'https://api.kevel.co/v1/instantcounts/advertiser/123?start=2017-04-18&end=2017-04-20'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function getAdvertiserCounts() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let counts = await client.run(\"realTimeReport\", \"getAdvertiserCounts\", {\n    advertiserId: 123\n  });\n\n  console.log(counts);\n}\n\ngetAdvertiserCounts();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef get_advertiser_counts()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    advertiser_id = 123\n    data = {\n        days: 7\n    }\n    pp client.advertisers.instant_counts(advertiser_id, data)\nend\nget_advertiser_counts()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/instantcounts/campaign/{CampaignID}":{"get":{"summary":"Get Campaign Counts","description":"This returns real time reporting data for a campaign.","operationId":"get-campaign-counts","parameters":[{"name":"CampaignID","in":"path","description":"ID of the Campaign","schema":{"type":"integer","format":"int32"},"required":true},{"name":"days","in":"query","description":"Returns data for the number of days since the current day. You can request a maximum of 90 days of data and a minimum of 0. `days=0` returns data for the current day.","schema":{"type":"integer","format":"int32"}},{"name":"start","in":"query","description":"In the format of YYYY-MM-DD. Returns data starting from the date specified. Must be within the past 90 days. If no `end` is included, this will return data up to the current day.","schema":{"type":"string"}},{"name":"end","in":"query","description":"In the format of YYYY-MM-DD. Returns data ending at the date specified. Must be within the past 90 days.","schema":{"type":"string"}}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"campaigns\": {\n    \"123\": {\n      \"impressions\": 123,\n      \"conversions\": 0,\n      \"revenue\": 0.117,\n      \"clicks\": 0\n    }\n  }\n}"},"200 OK - Multi Day":{"value":"{\n  \"campaigns\": {\n    \"123\": {\n      \"2017-04-18\": {\n        \"impressions\": 1,\n        \"conversions\": 1,\n        \"revenue\": 0,\n        \"clicks\": 0\n      },\n      \"2017-04-19\": {\n        \"impressions\": 2,\n        \"conversions\": 0,\n        \"revenue\": 0,\n        \"clicks\": 2\n      },\n      \"2017-04-20\": {\n        \"impressions\": 3,\n        \"conversions\": 0,\n        \"revenue\": 0,\n        \"clicks\": 0\n      },\n      \"total\": {\n        \"impressions\": 6,\n        \"conversions\": 1,\n        \"revenue\": 0,\n        \"clicks\": 2\n      }\n    }\n  }\n}"}},"schema":{"oneOf":[{"type":"object","properties":{"campaigns":{"type":"object","properties":{"123":{"type":"object","properties":{"impressions":{"type":"integer","example":123,"default":0},"conversions":{"type":"integer","example":0,"default":0},"revenue":{"type":"number","example":0.117,"default":0},"clicks":{"type":"integer","example":0,"default":0}}}}}}},{"title":"200 OK - Multi Day","type":"object","properties":{"campaigns":{"type":"object","properties":{"123":{"type":"object","properties":{"2017-04-18":{"type":"object","properties":{"impressions":{"type":"integer","example":1,"default":0},"conversions":{"type":"integer","example":1,"default":0},"revenue":{"type":"integer","example":0,"default":0},"clicks":{"type":"integer","example":0,"default":0}}},"2017-04-19":{"type":"object","properties":{"impressions":{"type":"integer","example":2,"default":0},"conversions":{"type":"integer","example":0,"default":0},"revenue":{"type":"integer","example":0,"default":0},"clicks":{"type":"integer","example":2,"default":0}}},"2017-04-20":{"type":"object","properties":{"impressions":{"type":"integer","example":3,"default":0},"conversions":{"type":"integer","example":0,"default":0},"revenue":{"type":"integer","example":0,"default":0},"clicks":{"type":"integer","example":0,"default":0}}},"total":{"type":"object","properties":{"impressions":{"type":"integer","example":6,"default":0},"conversions":{"type":"integer","example":1,"default":0},"revenue":{"type":"integer","example":0,"default":0},"clicks":{"type":"integer","example":2,"default":0}}}}}}}}}]}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H 'X-Adzerk-ApiKey:<API-KEY>' 'https://api.kevel.co/v1/instantcounts/campaign/123'\n\n# Using Days\ncurl -X GET -H 'X-Adzerk-ApiKey:<API-KEY>' 'https://api.kevel.co/v1/instantcounts/campaign/123?days=42'\n\n# Using Start/End\ncurl -X GET -H 'X-Adzerk-ApiKey:<API-KEY>' 'https://api.kevel.co/v1/instantcounts/campaign/123?start=2017-04-18&end=2017-04-20'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function getCampaignCounts() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let counts = await client.run(\"realTimeReport\", \"getCampaignCounts\", {\n    campaignId: 123\n  });\n\n  console.log(counts);\n}\n\ngetCampaignCounts();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef get_campaign_counts()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    campaign_id = 123\n  \tdata = {\n        days: 7\n    }\n    pp client.campaigns.instant_counts(campaign_id, data)\nend\nget_campaign_counts()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/instantcounts/flight/{FlightID}":{"get":{"summary":"Get Flight Counts","description":"This returns real time reporting data for a flight.","operationId":"get-flight-counts","parameters":[{"name":"FlightID","in":"path","description":"The ID of the Flight","schema":{"type":"integer","format":"int32"},"required":true},{"name":"days","in":"query","description":"Returns data for the number of days since the current day. You can request a maximum of 90 days of data and a minimum of 0. `days=0` returns data for the current day.","schema":{"type":"integer","format":"int32"}},{"name":"start","in":"query","description":"In the format of YYYY-MM-DD. Returns data starting from the date specified. Must be within the past 90 days. If no `end` is included, this will return data up to the current day.","schema":{"type":"string"}},{"name":"end","in":"query","description":"In the format of YYYY-MM-DD. Returns data ending at the date specified. Must be within the past 90 days.","schema":{"type":"string"}}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"flights\": {\n    \"123\": {\n      \"impressions\": 123,\n      \"conversions\": 0,\n      \"revenue\": 0.117,\n      \"clicks\": 0\n    }\n  }\n}"},"200 OK - Multi Day":{"value":"{\n  \"flights\": {\n    \"123\": {\n      \"2017-04-18\": {\n        \"impressions\": 1,\n        \"conversions\": 1,\n        \"revenue\": 0,\n        \"clicks\": 0\n      },\n      \"2017-04-19\": {\n        \"impressions\": 2,\n        \"conversions\": 0,\n        \"revenue\": 0,\n        \"clicks\": 2\n      },\n      \"2017-04-20\": {\n        \"impressions\": 3,\n        \"conversions\": 0,\n        \"revenue\": 0,\n        \"clicks\": 0\n      },\n      \"total\": {\n        \"impressions\": 6,\n        \"conversions\": 1,\n        \"revenue\": 0,\n        \"clicks\": 2\n      }\n    }\n  }\n}"}},"schema":{"oneOf":[{"type":"object","properties":{"flights":{"type":"object","properties":{"123":{"type":"object","properties":{"impressions":{"type":"integer","example":123,"default":0},"conversions":{"type":"integer","example":0,"default":0},"revenue":{"type":"number","example":0.117,"default":0},"clicks":{"type":"integer","example":0,"default":0}}}}}}},{"title":"200 OK - Multi Day","type":"object","properties":{"flights":{"type":"object","properties":{"123":{"type":"object","properties":{"2017-04-18":{"type":"object","properties":{"impressions":{"type":"integer","example":1,"default":0},"conversions":{"type":"integer","example":1,"default":0},"revenue":{"type":"integer","example":0,"default":0},"clicks":{"type":"integer","example":0,"default":0}}},"2017-04-19":{"type":"object","properties":{"impressions":{"type":"integer","example":2,"default":0},"conversions":{"type":"integer","example":0,"default":0},"revenue":{"type":"integer","example":0,"default":0},"clicks":{"type":"integer","example":2,"default":0}}},"2017-04-20":{"type":"object","properties":{"impressions":{"type":"integer","example":3,"default":0},"conversions":{"type":"integer","example":0,"default":0},"revenue":{"type":"integer","example":0,"default":0},"clicks":{"type":"integer","example":0,"default":0}}},"total":{"type":"object","properties":{"impressions":{"type":"integer","example":6,"default":0},"conversions":{"type":"integer","example":1,"default":0},"revenue":{"type":"integer","example":0,"default":0},"clicks":{"type":"integer","example":2,"default":0}}}}}}}}}]}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H 'X-Adzerk-ApiKey:<API-KEY>' 'https://api.kevel.co/v1/instantcounts/flight/123'\n\n# Using Days\ncurl -X GET -H 'X-Adzerk-ApiKey:<API-KEY>' 'https://api.kevel.co/v1/instantcounts/flight/123?days=42'\n\n# Using Start/End\ncurl -X GET -H 'X-Adzerk-ApiKey:<API-KEY>' 'https://api.kevel.co/v1/instantcounts/flight/123?start=2017-04-18&end=2017-04-20'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function getFlightCounts() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let counts = await client.run(\"realTimeReport\", \"getFlightCounts\", {\n    flightId: 123\n  });\n\n  console.log(counts);\n}\n\ngetFlightCounts();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef get_flight_counts()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    flight_id = 123\n  \tdata = {\n        start: \"2021-04-04\",\n        end: \"2021-04-20\"\n     }\n    pp client.flights.instant_counts(flight_id, data)\nend\nget_flight_counts()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/instantcounts/ad/{AdID}":{"get":{"summary":"Get Ad Counts","description":"This returns real time reporting data for an ad.","operationId":"get-ad-counts","parameters":[{"name":"AdID","in":"path","description":"The ID of the AD","schema":{"type":"integer","format":"int32"},"required":true},{"name":"days","in":"query","description":"Returns data for the number of days since the current day. You can request a maximum of 90 days of data and a minimum of 0. `days=0` returns data for the current day.","schema":{"type":"integer","format":"int32"}},{"name":"start","in":"query","description":"In the format of YYYY-MM-DD. Returns data starting from the date specified. Must be within the past 90 days. If no `end` is included, this will return data up to the current day.","schema":{"type":"string"}},{"name":"end","in":"query","description":"In the format of YYYY-MM-DD. Returns data ending at the date specified. Must be within the past 90 days.","schema":{"type":"string"}}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"ads\": {\n    \"123\": {\n      \"impressions\": 123,\n      \"conversions\": 0,\n      \"revenue\": 0.117,\n      \"clicks\": 0\n    }\n  }\n}"},"200 OK - Multi Day":{"value":"{\n  \"ads\": {\n    \"123\": {\n      \"2017-04-18\": {\n        \"impressions\": 1,\n        \"conversions\": 1,\n        \"revenue\": 0,\n        \"clicks\": 0\n      },\n      \"2017-04-19\": {\n        \"impressions\": 2,\n        \"conversions\": 0,\n        \"revenue\": 0,\n        \"clicks\": 2\n      },\n      \"2017-04-20\": {\n        \"impressions\": 3,\n        \"conversions\": 0,\n        \"revenue\": 0,\n        \"clicks\": 0\n      },\n      \"total\": {\n        \"impressions\": 6,\n        \"conversions\": 1,\n        \"revenue\": 0,\n        \"clicks\": 2\n      }\n    }\n  }\n}"}},"schema":{"oneOf":[{"type":"object","properties":{"ads":{"type":"object","properties":{"123":{"type":"object","properties":{"impressions":{"type":"integer","example":123,"default":0},"conversions":{"type":"integer","example":0,"default":0},"revenue":{"type":"number","example":0.117,"default":0},"clicks":{"type":"integer","example":0,"default":0}}}}}}},{"title":"200 OK - Multi Day","type":"object","properties":{"ads":{"type":"object","properties":{"123":{"type":"object","properties":{"2017-04-18":{"type":"object","properties":{"impressions":{"type":"integer","example":1,"default":0},"conversions":{"type":"integer","example":1,"default":0},"revenue":{"type":"integer","example":0,"default":0},"clicks":{"type":"integer","example":0,"default":0}}},"2017-04-19":{"type":"object","properties":{"impressions":{"type":"integer","example":2,"default":0},"conversions":{"type":"integer","example":0,"default":0},"revenue":{"type":"integer","example":0,"default":0},"clicks":{"type":"integer","example":2,"default":0}}},"2017-04-20":{"type":"object","properties":{"impressions":{"type":"integer","example":3,"default":0},"conversions":{"type":"integer","example":0,"default":0},"revenue":{"type":"integer","example":0,"default":0},"clicks":{"type":"integer","example":0,"default":0}}},"total":{"type":"object","properties":{"impressions":{"type":"integer","example":6,"default":0},"conversions":{"type":"integer","example":1,"default":0},"revenue":{"type":"integer","example":0,"default":0},"clicks":{"type":"integer","example":2,"default":0}}}}}}}}}]}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H 'X-Adzerk-ApiKey:<API-KEY>' 'https://api.kevel.co/v1/instantcounts/ad/123'\n\n# Using Days\ncurl -X GET -H 'X-Adzerk-ApiKey:<API-KEY>' 'https://api.kevel.co/v1/instantcounts/ad/123?days=42'\n\n# Using Start/End\ncurl -X GET -H 'X-Adzerk-ApiKey:<API-KEY>' 'https://api.kevel.co/v1/instantcounts/ad/123?start=2017-04-18&end=2017-04-20'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function getAdCounts() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let counts = await client.run(\"realTimeReport\", \"getAdCounts\", {\n    adId: 123\n  });\n\n  console.log(counts);\n}\n\ngetAdCounts();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef get_ad_counts()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    ad_id = 123\n  \tdata = {\n        start: \"2021-04-04\",\n        end: \"2021-04-20\"\n     }\n    pp client.ads.instant_counts(ad_id, data)\nend\nget_ad_counts()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/instantcounts/bulk":{"post":{"summary":"Get Bulk Counts","description":"This returns real time reporting data for more than one advertiser, campaign, flight, or ad. You can request as many as you need from each category.","operationId":"get-bulk-counts","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"advertisers":{"type":"array","description":"IDs of advertisers you want data on","items":{"type":"integer","format":"int32"}},"campaigns":{"type":"array","description":"IDs of campaigns you want data on","items":{"type":"integer","format":"int32"}},"flights":{"type":"array","description":"IDs of flights you want data on","items":{"type":"integer","format":"int32"}},"ads":{"type":"array","description":"IDs of ads you want data on","items":{"type":"integer","format":"int32"}},"days":{"type":"string","description":"Request data broken out by day for past number of days (current day is 0)."},"start":{"type":"string","description":"Day you want to start getting data from in YYYY-MM-DD"},"end":{"type":"string","description":"Day you want to end getting data from in YYYY-MM-DD"}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"advertisers\": {\n    \"123\": {\n      \"impressions\": 3097,\n      \"conversions\": 12,\n      \"revenue\": 49.11279,\n      \"clicks\": 149\n    },\n    \"456\": {\n      \"impressions\": 100,\n      \"conversions\": 0,\n      \"revenue\": 0.011,\n      \"clicks\": 0\n    }\n  },\n  \"campaigns\": {\n    \"789\": {\n      \"impressions\": 100,\n      \"conversions\": 0,\n      \"revenue\": 0.011,\n      \"clicks\": 0\n    },\n    \"123\": {\n      \"impressions\": 123,\n      \"conversions\": 0,\n      \"revenue\": 0.117,\n      \"clicks\": 0\n    }\n  },\n  \"flights\": {\n    \"456\": {\n      \"impressions\": 0,\n      \"conversions\": 0,\n      \"revenue\": 0,\n      \"clicks\": 0\n    },\n    \"789\": {\n      \"impressions\": 106,\n      \"conversions\": 0,\n      \"revenue\": 0.106,\n      \"clicks\": 0\n    }\n  },\n  \"ads\": {\n    \"123\": {\n      \"impressions\": 0,\n      \"conversions\": 0,\n      \"revenue\": 0,\n      \"clicks\": 0\n    },\n    \"456\": {\n      \"impressions\": 106,\n      \"conversions\": 0,\n      \"revenue\": 0.106,\n      \"clicks\": 0\n    }\n  }\n}"},"200 OK - Multi Day":{"value":"{\n  \"advertisers\": {\n    \"123\": {\n      \"2017-04-20\": {\n        \"impressions\": 1,\n        \"conversions\": 0,\n        \"revenue\": 0,\n        \"clicks\": 0\n      },\n      \"2017-04-21\": {\n        \"impressions\": 1,\n        \"conversions\": 0,\n        \"revenue\": 0,\n        \"clicks\": 0\n      },\n      \"total\": {\n        \"impressions\": 2,\n        \"conversions\": 0,\n        \"revenue\": 0,\n        \"clicks\": 0\n      }\n    }\n  },\n  \"campaigns\": {\n    \"456\": {\n      \"2017-04-20\": {\n        \"impressions\": 4,\n        \"conversions\": 0,\n        \"revenue\": 0,\n        \"clicks\": 0\n      },\n      \"2017-04-21\": {\n        \"impressions\": 5,\n        \"conversions\": 0,\n        \"revenue\": 0,\n        \"clicks\": 1\n      },\n      \"total\": {\n        \"impressions\": 9,\n        \"conversions\": 0,\n        \"revenue\": 0,\n        \"clicks\": 1\n      }\n    }\n  },\n  \"flights\": {\n    \"789\": {\n      \"2017-04-20\": {\n        \"impressions\": 2,\n        \"conversions\": 0,\n        \"revenue\": 0,\n        \"clicks\": 0\n      },\n      \"2017-04-21\": {\n        \"impressions\": 2,\n        \"conversions\": 1,\n        \"revenue\": 0,\n        \"clicks\": 0\n      },\n      \"total\": {\n        \"impressions\": 4,\n        \"conversions\": 1,\n        \"revenue\": 0,\n        \"clicks\": 0\n      }\n    }\n  },\n  \"ads\": {\n    \"123\": {\n      \"2017-04-20\": {\n        \"impressions\": 10,\n        \"conversions\": 0,\n        \"revenue\": 0,\n        \"clicks\": 0\n      },\n      \"2017-04-21\": {\n        \"impressions\": 2,\n        \"conversions\": 0,\n        \"revenue\": 1.0,\n        \"clicks\": 0\n      },\n      \"total\": {\n        \"impressions\": 12,\n        \"conversions\": 0,\n        \"revenue\": 1.0,\n        \"clicks\": 0\n      }\n    }\n  }\n}"}},"schema":{"oneOf":[{"type":"object","properties":{"advertisers":{"type":"object","properties":{"123":{"type":"object","properties":{"impressions":{"type":"integer","example":3097,"default":0},"conversions":{"type":"integer","example":12,"default":0},"revenue":{"type":"number","example":49.11279,"default":0},"clicks":{"type":"integer","example":149,"default":0}}},"456":{"type":"object","properties":{"impressions":{"type":"integer","example":100,"default":0},"conversions":{"type":"integer","example":0,"default":0},"revenue":{"type":"number","example":0.011,"default":0},"clicks":{"type":"integer","example":0,"default":0}}}}},"campaigns":{"type":"object","properties":{"123":{"type":"object","properties":{"impressions":{"type":"integer","example":123,"default":0},"conversions":{"type":"integer","example":0,"default":0},"revenue":{"type":"number","example":0.117,"default":0},"clicks":{"type":"integer","example":0,"default":0}}},"789":{"type":"object","properties":{"impressions":{"type":"integer","example":100,"default":0},"conversions":{"type":"integer","example":0,"default":0},"revenue":{"type":"number","example":0.011,"default":0},"clicks":{"type":"integer","example":0,"default":0}}}}},"flights":{"type":"object","properties":{"456":{"type":"object","properties":{"impressions":{"type":"integer","example":0,"default":0},"conversions":{"type":"integer","example":0,"default":0},"revenue":{"type":"integer","example":0,"default":0},"clicks":{"type":"integer","example":0,"default":0}}},"789":{"type":"object","properties":{"impressions":{"type":"integer","example":106,"default":0},"conversions":{"type":"integer","example":0,"default":0},"revenue":{"type":"number","example":0.106,"default":0},"clicks":{"type":"integer","example":0,"default":0}}}}},"ads":{"type":"object","properties":{"123":{"type":"object","properties":{"impressions":{"type":"integer","example":0,"default":0},"conversions":{"type":"integer","example":0,"default":0},"revenue":{"type":"integer","example":0,"default":0},"clicks":{"type":"integer","example":0,"default":0}}},"456":{"type":"object","properties":{"impressions":{"type":"integer","example":106,"default":0},"conversions":{"type":"integer","example":0,"default":0},"revenue":{"type":"number","example":0.106,"default":0},"clicks":{"type":"integer","example":0,"default":0}}}}}}},{"title":"200 OK - Multi Day","type":"object","properties":{"advertisers":{"type":"object","properties":{"123":{"type":"object","properties":{"2017-04-20":{"type":"object","properties":{"impressions":{"type":"integer","example":1,"default":0},"conversions":{"type":"integer","example":0,"default":0},"revenue":{"type":"integer","example":0,"default":0},"clicks":{"type":"integer","example":0,"default":0}}},"2017-04-21":{"type":"object","properties":{"impressions":{"type":"integer","example":1,"default":0},"conversions":{"type":"integer","example":0,"default":0},"revenue":{"type":"integer","example":0,"default":0},"clicks":{"type":"integer","example":0,"default":0}}},"total":{"type":"object","properties":{"impressions":{"type":"integer","example":2,"default":0},"conversions":{"type":"integer","example":0,"default":0},"revenue":{"type":"integer","example":0,"default":0},"clicks":{"type":"integer","example":0,"default":0}}}}}}},"campaigns":{"type":"object","properties":{"456":{"type":"object","properties":{"2017-04-20":{"type":"object","properties":{"impressions":{"type":"integer","example":4,"default":0},"conversions":{"type":"integer","example":0,"default":0},"revenue":{"type":"integer","example":0,"default":0},"clicks":{"type":"integer","example":0,"default":0}}},"2017-04-21":{"type":"object","properties":{"impressions":{"type":"integer","example":5,"default":0},"conversions":{"type":"integer","example":0,"default":0},"revenue":{"type":"integer","example":0,"default":0},"clicks":{"type":"integer","example":1,"default":0}}},"total":{"type":"object","properties":{"impressions":{"type":"integer","example":9,"default":0},"conversions":{"type":"integer","example":0,"default":0},"revenue":{"type":"integer","example":0,"default":0},"clicks":{"type":"integer","example":1,"default":0}}}}}}},"flights":{"type":"object","properties":{"789":{"type":"object","properties":{"2017-04-20":{"type":"object","properties":{"impressions":{"type":"integer","example":2,"default":0},"conversions":{"type":"integer","example":0,"default":0},"revenue":{"type":"integer","example":0,"default":0},"clicks":{"type":"integer","example":0,"default":0}}},"2017-04-21":{"type":"object","properties":{"impressions":{"type":"integer","example":2,"default":0},"conversions":{"type":"integer","example":1,"default":0},"revenue":{"type":"integer","example":0,"default":0},"clicks":{"type":"integer","example":0,"default":0}}},"total":{"type":"object","properties":{"impressions":{"type":"integer","example":4,"default":0},"conversions":{"type":"integer","example":1,"default":0},"revenue":{"type":"integer","example":0,"default":0},"clicks":{"type":"integer","example":0,"default":0}}}}}}},"ads":{"type":"object","properties":{"123":{"type":"object","properties":{"2017-04-20":{"type":"object","properties":{"impressions":{"type":"integer","example":10,"default":0},"conversions":{"type":"integer","example":0,"default":0},"revenue":{"type":"integer","example":0,"default":0},"clicks":{"type":"integer","example":0,"default":0}}},"2017-04-21":{"type":"object","properties":{"impressions":{"type":"integer","example":2,"default":0},"conversions":{"type":"integer","example":0,"default":0},"revenue":{"type":"integer","example":1,"default":0},"clicks":{"type":"integer","example":0,"default":0}}},"total":{"type":"object","properties":{"impressions":{"type":"integer","example":12,"default":0},"conversions":{"type":"integer","example":0,"default":0},"revenue":{"type":"integer","example":1,"default":0},"clicks":{"type":"integer","example":0,"default":0}}}}}}}}}]}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X POST -H 'X-Adzerk-ApiKey:<API-KEY>' -H 'Content-Type:application/json' https://api.kevel.co/v1/instantcounts/bulk -d '{\"advertisers\": [123,456], \"campaigns\": [789,123], \"flights\": [456,789], \"ads\": [123,456]}'\n\n# With Days\ncurl -X POST -H 'X-Adzerk-ApiKey:<API-KEY>' -H 'Content-Type:application/json' https://api.kevel.co/v1/instantcounts/bulk -d '{\"advertisers\": [123,456], \"campaigns\": [789,123], \"flights\": [456,789], \"ads\": [123,456], \"days\":42}'\n\n# With Start/End\ncurl -X POST -H 'X-Adzerk-ApiKey:<API-KEY>' -H 'Content-Type:application/json' https://api.kevel.co/v1/instantcounts/bulk -d '{\"advertisers\": [123], \"campaigns\": [456], \"flights\": [789], \"ads\": [123], \"start\":\"2016-04-20\", \"end\":\"2016-04-21\"}'","name":"cURL"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function getBulkCounts() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let counts = await client.run(\"realTimeReport\", \"bulk\", {\n    advertisers: [123, 456],\n    campaigns: [789, 123],\n    flights: [456, 789],\n    ads: [123, 456],\n  });\n\n  console.log(counts);\n}\n\ngetBulkCounts();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef get_bulk_counts()\n   client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n   data = {\n       advertisers: [123, 456],\n    \t campaigns: [789, 123],\n       flights: [456, 789],\n       ads: [123, 456],\n    }\n    pp client.instant_counts.bulk(data)\nend\nget_bulk_counts()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/instantcounts/network":{"get":{"summary":"Get Network Counts","description":"This returns real time reporting data for all campaigns, flights and ads in a network, aggregated as a total of impressions, clicks etc.","operationId":"get-network-counts","parameters":[{"name":"days","in":"query","description":"Returns data for the number of days since the current day. You can request a maximum of 90 days of data and a minimum of 0. `days=0` returns data for the current day.","schema":{"type":"integer","format":"int32"}},{"name":"start","in":"query","description":"In the format of YYYY-MM-DD. Returns data starting from the date specified. Must be within the past 90 days. If no `end` is included, this will return data up to the current day.","schema":{"type":"string"}},{"name":"end","in":"query","description":"In the format of YYYY-MM-DD. Returns data ending at the date specified. Must be within the past 90 days.","schema":{"type":"string"}}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"network\": {\n    \"12345\": {\n      \"2017-09-12\": {\n        \"impressions\": 100,\n        \"revenue\": 10,\n        \"clicks\": 6,\n        \"passbacks\": 0,\n        \"conversions\": 0\n      },\n      \"total\": {\n        \"impressions\": 100,\n        \"revenue\": 10,\n        \"clicks\": 6,\n        \"passbacks\": 0,\n        \"conversions\": 0\n      }\n    }\n  }\n}"},"200 OK - Multi Day":{"value":"{\n  \"network\": {\n    \"12345\": {\n      \"2017-09-10\": {\n        \"impressions\": 0,\n        \"conversions\": 0,\n        \"revenue\": 0,\n        \"clicks\": 0\n      },\n      \"2017-09-11\": {\n        \"impressions\": 14,\n        \"revenue\": 0,\n        \"clicks\": 0,\n        \"passbacks\": 0,\n        \"conversions\": 0\n      },\n      \"2017-09-12\": {\n        \"impressions\": 1,\n        \"revenue\": 0,\n        \"clicks\": 0,\n        \"passbacks\": 0,\n        \"conversions\": 0\n      },\n      \"total\": {\n        \"impressions\": 15,\n        \"conversions\": 0,\n        \"revenue\": 0,\n        \"clicks\": 0,\n        \"passbacks\": 0\n      }\n    }\n  }\n}"}},"schema":{"oneOf":[{"type":"object","properties":{"network":{"type":"object","properties":{"12345":{"type":"object","properties":{"2017-09-12":{"type":"object","properties":{"impressions":{"type":"integer","example":100,"default":0},"revenue":{"type":"integer","example":10,"default":0},"clicks":{"type":"integer","example":6,"default":0},"passbacks":{"type":"integer","example":0,"default":0},"conversions":{"type":"integer","example":0,"default":0}}},"total":{"type":"object","properties":{"impressions":{"type":"integer","example":100,"default":0},"revenue":{"type":"integer","example":10,"default":0},"clicks":{"type":"integer","example":6,"default":0},"passbacks":{"type":"integer","example":0,"default":0},"conversions":{"type":"integer","example":0,"default":0}}}}}}}}},{"title":"200 OK - Multi Day","type":"object","properties":{"network":{"type":"object","properties":{"12345":{"type":"object","properties":{"2017-09-10":{"type":"object","properties":{"impressions":{"type":"integer","example":0,"default":0},"conversions":{"type":"integer","example":0,"default":0},"revenue":{"type":"integer","example":0,"default":0},"clicks":{"type":"integer","example":0,"default":0}}},"2017-09-11":{"type":"object","properties":{"impressions":{"type":"integer","example":14,"default":0},"revenue":{"type":"integer","example":0,"default":0},"clicks":{"type":"integer","example":0,"default":0},"passbacks":{"type":"integer","example":0,"default":0},"conversions":{"type":"integer","example":0,"default":0}}},"2017-09-12":{"type":"object","properties":{"impressions":{"type":"integer","example":1,"default":0},"revenue":{"type":"integer","example":0,"default":0},"clicks":{"type":"integer","example":0,"default":0},"passbacks":{"type":"integer","example":0,"default":0},"conversions":{"type":"integer","example":0,"default":0}}},"total":{"type":"object","properties":{"impressions":{"type":"integer","example":15,"default":0},"conversions":{"type":"integer","example":0,"default":0},"revenue":{"type":"integer","example":0,"default":0},"clicks":{"type":"integer","example":0,"default":0},"passbacks":{"type":"integer","example":0,"default":0}}}}}}}}}]}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"# NOTE: You may request counts for up to a maximum of 90 days\ncurl -X GET -H 'X-Adzerk-ApiKey:<API-KEY>' 'https://api.kevel.co/v1/instantcounts/network?days=42'\n\n# With Start/End\ncurl -X GET -H 'X-Adzerk-ApiKey:<API-KEY>' 'https://api.kevel.co/v1/instantcounts/network?start=2017-04-18&end=2017-04-20'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function getNetworkCounts() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications, logger});\n\n  // NOTE: You may request counts for up to a maximum of 90 days\n  let counts = await client.run(\"realTimeReport\", \"getNetworkCounts\", { days: 7 });\n\n  // Prints out the entire response, no matter how deeply-nested\n  console.dir(counts, {depth: null});\n}\n\ngetNetworkCounts();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef get_network_counts()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    data = {\n        days: 7\n    }\n    pp client.instant_counts.network_counts(data)\nend\nget_network_counts()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/advertiser/":{"post":{"summary":"Create Advertisers","description":"","operationId":"create-advertisers","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["Title","IsActive"],"properties":{"Title":{"type":"string","description":"The advertiser name"},"IsActive":{"type":"boolean","description":"Whether advertiser is running. Always set to `true` when creating. Defaults to `false`.","default":false},"PlacementLimit":{"type":"integer","description":"How many placements the advertiser's ads can fill per request","format":"int32"},"FreqCap":{"type":"integer","description":"The number of times that you would like the frequency cap to occur. Set-up instructions [here](doc:advertiser-frequency-capping-1)","format":"int32"},"FreqCapDuration":{"type":"integer","description":"How often the frequency cap should occur. Set-up instructions [here](doc:advertiser-frequency-capping-1)","format":"int32"},"FreqCapType":{"type":"integer","description":"The unit of time you would like frequency capping to occur. Key follows: `1 = Hour 2 = Day 3 = Minute`. Set-up instructions [here](doc:advertiser-frequency-capping-1)","format":"int32"},"CapType":{"type":"integer","description":"Advertisers can only budget cap on the revenue metric. Set to `CapType = 4`. Do not set to `0` - if removing, set to `null`","format":"int32"},"DailyCapAmount":{"type":"integer","description":"The max daily revenue","format":"int32"},"LifetimeCapAmount":{"type":"integer","description":"The max lifetime revenue","format":"int32"},"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)."},"RtbCustomFields":{"type":"string","description":"Required for RTB enabled advertisers _only_. JSON Object in a String. It's JSON data provided by the RTB partner. Certain parameters in the object will be required per partner. If you aren't sure what is required, your account manager will supply you with the data for this property."},"ExternalId":{"type":"string","description":"Used to reference an ID from another external system"},"PartnerId":{"type":"integer","description":"Required for RTB enabled advertisers _only_. The ID of the RTB Partner.  If you aren't sure what is required, your account manager will supply you with the data for this property.","format":"int32"},"IsDeleted":{"type":"boolean","description":"Whether advertiser is deleted. Defaults to `false`","default":false},"CatalogAccess":{"type":"array","description":"Define the scope of Catalog items that pertain to an Advertiser.","items":{"properties":{"CatalogId":{"type":"integer","description":"The ID of a `kevel/products` table in the Advertiser's network","format":"int32"},"ProductQuery":{"type":"array","description":"A Kevelog where clause.","default":[],"items":{"type":"string"}}},"type":"object"}},"Segments":{"type":"array","items":{"properties":{"SegmentId":{"type":"integer","format":"int32","description":"ID of the segment."}},"type":"object"},"description":"Segments that the advertiser should be able to access when configuring user segment targeting in Kevel Console. These settings do not effect campaigns managed directly through the Ad Server."}}},"examples":{"JSON":{"value":{"Title":"Nike","IsDeleted":false,"IsActive":true,"PlacementLimit":0,"FreqCap":2,"FreqCapDuration":10,"FreqCapType":1,"CapType":4,"DailyCapAmount":5000,"LifetimeCapAmount":50000,"CatalogAccess":[{"CatalogId":101,"ProductQuery":[[["one-of","kevel/brand-id"],[12345,12346]],["kevel/merchant-id",12347]]}]}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"IsActive\": true,\n  \"DailyCapAmount\": null,\n  \"FreqCapType\": 0,\n  \"Title\": \"Nike\",\n  \"CapType\": null,\n  \"IsFreqCap\": false,\n  \"IsDeleted\": false,\n  \"RtbCustomFields\": null,\n  \"LifetimeCapAmount\": null,\n  \"FreqCapDuration\": null,\n  \"PlacementLimit\": null,\n  \"FreqCap\": null,\n  \"ExternalId\": null,\n  \"PartnerId\": null,\n  \"CatalogAccess\":[\n    {\n      \"ProductQuery\":[ \n        [ [\"one-of\", \"kevel/brand-id\"], [12345, 12346]],\n        [ \"kevel/merchant-id\", 12347 ]\n      ],\n      \"CatalogId\":101\n    }\n  ]\n  \"Id\": 12345\n}"}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"## The example below is a minimally viable advertiser:\ncurl -X POST -H 'X-Adzerk-ApiKey:<APIKEY>' -H \"Content-Type:application/json\" https://api.kevel.co/v1/advertiser --data-binary '{\"Title\":\"Nike\",\"IsDeleted\":false,\"IsActive\":true}'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function createAdvertiser() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let advertiser = await client.run(\"advertiser\", \"create\", {\n    title: \"Nike\",\n    isActive: true,\n  });\n\n  console.log(advertiser);\n}\n\ncreateAdvertiser();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef create_advertiser()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    pp client.advertisers.create(title: \"Ruby Advertiser\", is_active: true)\nend\ncreate_advertiser()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/advertiser/{AdvertiserID}":{"put":{"summary":"Update Advertisers","description":"","operationId":"update-advertisers","parameters":[{"name":"AdvertiserID","in":"path","description":"ID of the Advertiser","schema":{"type":"integer","format":"int32"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["Id","Title","IsActive"],"properties":{"Id":{"type":"integer","description":"The ID of the Advertiser","format":"int32"},"Title":{"type":"string","description":"The name of the advertiser"},"IsActive":{"type":"boolean","description":"Whether the advertiser is active"},"isDeleted":{"type":"boolean","description":"If want to delete, set to `true`"}}},"examples":{"JSON":{"value":{"Id":12345,"Title":"Nike","IsDeleted":false,"IsActive":true,"PlacementLimit":4}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"Id\":12345,\n  \"Title\":\"Nike\",\n  \"IsActive\":true,\n  \"IsDeleted\":false,\n  \"PlacementLimit\":4,\n  \"FreqCap\": 2,\n  \"FreqCapDuration\": 10,\n  \"FreqCapType\": 1,\n  \"CapType\": 4,\n  \"DailyCapAmount\": 5000,\n  \"LifetimeCapAmount\": 50000\n}"}},"schema":{"type":"object","properties":{"Id":{"type":"integer","example":12345,"default":0},"Title":{"type":"string","example":"Nike"},"IsActive":{"type":"boolean","example":true,"default":true},"IsDeleted":{"type":"boolean","example":false,"default":true},"PlacementLimit":{"type":"integer","example":4,"default":0},"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":4,"default":0},"DailyCapAmount":{"type":"integer","example":5000,"default":0},"LifetimeCapAmount":{"type":"integer","example":50000,"default":0}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X PUT -H 'X-Adzerk-ApiKey:<APIKEY>' -H \"Content-Type:application/json\" https://api.kevel.co/v1/advertiser/12345 --data-binary '{\"Id\":12345,\"Title\":\"Nike\",\"IsActive\":true,\"IsDeleted\":false}'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function updateAdvertiser() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let advertiser = await client.run(\"advertiser\", \"update\", {id: 12345, placementLimit: 4});\n  console.log(advertiser);\n}\n\nupdateAdvertiser();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef update_advertiser()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    advertiser_id = 12345\n    opts = client.advertisers.get(advertiser_id) \n    opts[:id] = advertiser_id\n    opts[:title] = \"Updated Title\"\n    pp client.advertisers.update(opts)\nend\nupdate_advertiser()"}],"samples-languages":["curl","javascript","ruby"]}},"get":{"summary":"Get Advertiser","description":"","operationId":"get-advertisers","parameters":[{"name":"AdvertiserID","in":"path","description":"The ID of the Advertiser","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n    \"IsActive\": true,\n    \"Created\": \"2024-10-08T20:15:58.820Z\",\n    \"CatalogAccess\": [\n        {\n            \"ProductQuery\": [\n                [\n                    [\n                        \"one-of\",\n                        \"kevel/brand-id\"\n                    ],\n                    [\n                        2762035,\n                        2764718,\n                        2765001\n                    ]\n                ]\n            ],\n            \"CatalogId\": 310\n        }\n    ],\n    \"DailyCapAmount\": 100,\n    \"FreqCapType\": 1,\n    \"Title\": \"Big Cashew Co.\",\n    \"ExternalId\": \"3faa9840-fd2d-40d1-82b0-cf654067ceea\",\n    \"CapType\": 4,\n    \"IsFreqCap\": true,\n    \"IsDeleted\": false,\n    \"LifetimeCapAmount\": 555555,\n    \"LastModified\": \"2025-05-30T20:24:55.120Z\",\n    \"FreqCapDuration\": 1,\n    \"PlacementLimit\": 1,\n    \"FreqCap\": 5,\n    \"PartnerId\": null,\n    \"Version\": 4,\n    \"Id\": 3423675,\n    \"CustomFieldsJson\": null\n}"}},"schema":{"type":"object","properties":{"IsActive":{"type":"boolean","example":true,"default":true},"Created":{"type":"string","example":"2024-10-08T20:15:58.820Z"},"CatalogAccess":{"type":"array","items":{"type":"object","properties":{"ProductQuery":{"type":"array","items":{"type":"array","items":{"type":"array","items":{"type":"string","example":"one-of"}}}},"CatalogId":{"type":"integer","example":310,"default":0}}}},"DailyCapAmount":{"type":"integer","example":100,"default":0},"FreqCapType":{"type":"integer","example":1,"default":0},"Title":{"type":"string","example":"Big Cashew Co."},"ExternalId":{"type":"string","example":"3faa9840-fd2d-40d1-82b0-cf654067ceea"},"CapType":{"type":"integer","example":4,"default":0},"IsFreqCap":{"type":"boolean","example":true,"default":true},"IsDeleted":{"type":"boolean","example":false,"default":true},"LifetimeCapAmount":{"type":"integer","example":555555,"default":0},"LastModified":{"type":"string","example":"2025-05-30T20:24:55.120Z"},"FreqCapDuration":{"type":"integer","example":1,"default":0},"PlacementLimit":{"type":"integer","example":1,"default":0},"FreqCap":{"type":"integer","example":5,"default":0},"PartnerId":{},"Version":{"type":"integer","example":4,"default":0},"Id":{"type":"integer","example":3423675,"default":0},"CustomFieldsJson":{}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" https://api.kevel.co/v1/advertiser/123"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function getAdvertiser() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let advertiser = await client.run(\"advertiser\", \"get\", {id: 12345});\n  console.log(advertiser);\n}\n\ngetAdvertiser();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef get_advertiser()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    advertiser_id = 12345\n    pp client.advertisers.get(advertiser_id)\nend\nget_advertiser()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/advertiser":{"get":{"summary":"List Advertisers","description":"This returns a JSON object of all your advertisers. For the explorer, just use your API Key.","operationId":"list-advertisers","responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"page\": 1,\n  \"items\":[\n    {\n        \"Id\":123,\n        \"Title\":\"Nike\",\n        \"IsActive\":true,\n        \"IsDeleted\":false,\n        \"PlacementLimit\":null,\n        \"FreqCap\": 2,\n        \"FreqCapDuration\": 10,\n        \"FreqCapType\": 1,\n        \"CapType\": 4,\n        \"DailyCapAmount\": 5000,\n        \"LifetimeCapAmount\": 50000\n    }\n  ]\n}"}},"schema":{"type":"object","properties":{"page":{"type":"integer","example":1,"default":0},"items":{"type":"array","items":{"type":"object","properties":{"Id":{"type":"integer","example":123,"default":0},"Title":{"type":"string","example":"Nike"},"IsActive":{"type":"boolean","example":true,"default":true},"IsDeleted":{"type":"boolean","example":false,"default":true},"PlacementLimit":{},"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":4,"default":0},"DailyCapAmount":{"type":"integer","example":5000,"default":0},"LifetimeCapAmount":{"type":"integer","example":50000,"default":0}}}}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" https://api.kevel.co/v1/advertiser"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function listAdvertisers() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let advertisers = await client.run(\"advertiser\", \"list\");\n  console.log(advertisers);\n\n  let titles = advertisers.items.map(a => a.title)\n  console.log(titles);\n}\n\nlistAdvertisers();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef list_advertisers()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    pp client.advertisers.list()\nend\nlist_advertisers()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/advertiser/{AdvertiserID}/trackingCode":{"get":{"summary":"Get Conversion Tracking Pixel","description":"","operationId":"get-conversion-tracking-pixel","parameters":[{"name":"AdvertiserID","in":"path","description":"The ID of the Advertiser","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n   \"trackingCode\": \"<script type=\\\"text/javascript\\\">var it=document.createElement(\\\"img\\\");var u=\\\"https://engine.adzerk.net/e/1234/12345/e.gif\\\";var t=new Date().getTime();var ut=u+\\\"?_=\\\"+t;it.src=ut;it.border=0;</script>\"\n}"}},"schema":{"type":"object","properties":{"trackingCode":{"type":"string","example":"<script type=\"text/javascript\">var it=document.createElement(\"img\");var u=\"https://engine.adzerk.net/e/1234/12345/e.gif\";var t=new Date().getTime();var ut=u+\"?_=\"+t;it.src=ut;it.border=0;</script>"}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H 'X-Adzerk-ApiKey:<APIKEY>' https://api.kevel.co/v1/advertiser/12345/trackingCode"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function getConversionTrackingCode() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let advertiser = await client.run(\"advertiser\", \"getTrackingCode\", {id: 1234});\n  console.log(advertiser);\n}\n\ngetConversionTrackingCode();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef get_conversion_tracking_code()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    advertiser_id = 12345\n    pp client.advertisers.get_conversion_tracking_code(advertiser_id)\nend\nget_conversion_tracking_code()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/campaign":{"post":{"summary":"Create Campaigns","description":"","operationId":"create-campaigns","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["AdvertiserId","Name"],"properties":{"AdvertiserId":{"type":"integer","description":"The advertiser's ID for the campaign.","format":"int32"},"Name":{"type":"string","description":"The campaign name."},"Flights":{"type":"array","description":"You can pass an array of flights, a blank array, or not include. See [Create Flight](ref:create-flight) endpoint.","items":{"type":"integer","format":"int32"}},"IsActive":{"type":"boolean","description":"Specifies whether campaign should be active (serving ads). Defaults to `false`.","default":false},"IsDeleted":{"type":"boolean","description":"Specifies whether campaign should be deleted. Do not use when creating a campaign."},"IsArchived":{"type":"boolean","description":"Specifies whether campaign should be archived. Do not use when creating a campaign."},"FreqCap":{"type":"integer","description":"The number of times the frequency cap should occur.","format":"int32"},"FreqCapDuration":{"type":"integer","description":"Specifies how often the frequency cap should occur.","format":"int32"},"FreqCapType":{"type":"integer","description":"The enum value for how often frequency capping should occur. `1 = Hour 2 = Day 3 = Minute`.","format":"int32"},"DontAffectParentFreqCap":{"type":"boolean","description":"\"Opts-out\" campaign from advertiser-level frequency cap settings."},"CapType":{"type":"integer","description":"Set to `CapType = 4`. Campaigns can only budget cap on revenue metric. Do not set to `0` - if removing, set to `null`.","format":"int32"},"DailyCapAmount":{"type":"integer","description":"The max daily revenue.","format":"int32"},"LifetimeCapAmount":{"type":"integer","description":"The max lifetime revenue.","format":"int32"}}},"examples":{"JSON":{"value":{"AdvertiserId":12345,"Name":"Nike Q4 Campaign","IsActive":true,"FreqCap":2,"FreqCapDuration":10,"FreqCapType":1,"DontAffectParentFreqCap":true,"CapType":4,"DailyCapAmount":5000,"LifetimeCapAmount":50000}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"IsActive\": false,\n  \"DontAffectParentFreqCap\": null,\n  \"Flights\": [],\n  \"DailyCapAmount\": null,\n  \"FreqCapType\": 0,\n  \"EndDate\": null,\n  \"CapType\": null,\n  \"IsFreqCap\": false,\n  \"IsDeleted\": false,\n  \"EndDateISO\": null,\n  \"Price\": 0,\n  \"IsArchived\": false,\n  \"LifetimeCapAmount\": null,\n  \"FreqCapDuration\": null,\n  \"FreqCap\": null,\n  \"SalespersonId\": null,\n  \"AdvertiserId\": 12345,\n  \"Name\": \"Nike Q4 Campaign\",\n  \"Id\": 123456,\n  \"CustomFieldsJson\": null,\n  \"StartDateISO\": \"2017-01-01T00:00:00.0000000\"\n}"}},"schema":{"type":"object","properties":{"IsActive":{"type":"boolean","example":false,"default":true},"DontAffectParentFreqCap":{},"Flights":{"type":"array"},"DailyCapAmount":{},"FreqCapType":{"type":"integer","example":0,"default":0},"EndDate":{},"CapType":{},"IsFreqCap":{"type":"boolean","example":false,"default":true},"IsDeleted":{"type":"boolean","example":false,"default":true},"EndDateISO":{},"Price":{"type":"integer","example":0,"default":0},"IsArchived":{"type":"boolean","example":false,"default":true},"LifetimeCapAmount":{},"FreqCapDuration":{},"FreqCap":{},"SalespersonId":{},"AdvertiserId":{"type":"integer","example":12345,"default":0},"Name":{"type":"string","example":"Nike Q4 Campaign"},"Id":{"type":"integer","example":123456,"default":0},"CustomFieldsJson":{},"StartDateISO":{"type":"string","example":"2017-01-01T00:00:00.0000000"}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"## The example below is a minimally viable campaign: \ncurl -X POST -H 'X-Adzerk-ApiKey:<API-KEY>' -H \"Content-Type:application/json\" \"https://api.kevel.co/v1/campaign\" --data-binary '{\"Name\":\"Nike Q4 Campaign\",\"AdvertiserId\":12345,\"IsActive\":true}'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function createCampaign() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let campaign = await client.run(\"campaign\", \"create\", {\n    name: \"Nike Q4 Campaign\",\n    advertiserId: 12345,\n    isActive: false, // TIP: create inactive so nothing serves until ready!\n  });\n\n  console.log(campaign);\n}\n\ncreateCampaign();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef create_campaign()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    data = {\n        name: \"Campaign Name\",\n        advertiser_id: 12345,\n        is_active: false # TIP: campaign should start inactive so nothing serves until ready!\n    }\n    pp client.campaigns.create(data)\nend\ncreate_campaign()"}],"samples-languages":["curl","javascript","ruby"]}},"get":{"summary":"List Campaigns","description":"","operationId":"list-campaigns","parameters":[{"name":"isArchived","in":"query","description":"If true, returns only archived flights","schema":{"type":"boolean"}},{"name":"AdvertiserId","in":"query","description":"Returns only campaigns that belong to that advertiser ID.","schema":{"type":"integer","format":"int32"}}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n    \"page\": 1,\n    \"items\": [\n      {\n        \"IsActive\": false,\n        \"Flights\": [],\n        \"FreqCapType\": 0,\n        \"IsDeleted\": false,\n        \"Price\": 0,\n        \"IsArchived\": false,\n        \"AdvertiserId\": 12345,\n        \"Name\": \"Exploding Kittens\",\n        \"Id\": 123456,\n        \"StartDateISO\": \"2017-03-11T00:00:00.0000000\"\n      }\n    ]\n}"}},"schema":{"type":"object","properties":{"page":{"type":"integer","example":1,"default":0},"items":{"type":"array","items":{"type":"object","properties":{"IsActive":{"type":"boolean","example":false,"default":true},"Flights":{"type":"array"},"FreqCapType":{"type":"integer","example":0,"default":0},"IsDeleted":{"type":"boolean","example":false,"default":true},"Price":{"type":"integer","example":0,"default":0},"IsArchived":{"type":"boolean","example":false,"default":true},"AdvertiserId":{"type":"integer","example":12345,"default":0},"Name":{"type":"string","example":"Exploding Kittens"},"Id":{"type":"integer","example":123456,"default":0},"StartDateISO":{"type":"string","example":"2017-03-11T00:00:00.0000000"}}}}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET \\\n     -H \"X-Adzerk-ApiKey:<APIKEY>\" \\\n     https://api.kevel.co/v1/campaign\n\n## To show archived campaigns:\ncurl -X GET \\\n     -H \"X-Adzerk-ApiKey:<APIKEY>\" \\\n     https://api.kevel.co/v1/campaign?isArchived=true\n     \n## To return campaigns from a specific advertiser:\ncurl -X GET \\\n     -H \"X-Adzerk-ApiKey:<APIKEY>\" \\\n     https://api.kevel.co/v1/campaign?AdvertiserId=12345"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function listCampaigns() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let campaigns = await client.run(\"campaign\", \"list\");\n  console.log(campaigns);\n\n  let names = campaigns.items.map(a => a.name)\n  console.log(names);\n}\n\nlistCampaigns();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef list_campaign()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    pp client.campaigns.list()\nend\nlist_campaign()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v2/campaign":{"post":{"summary":"Create Campaign V2","description":"Create a Campaign and nested Flights/Creatives/Ads","operationId":"create-campaign-v2","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["AdvertiserId","Name"],"properties":{"AdvertiserId":{"type":"integer","description":"The advertiser's ID for the campaign.","format":"int32"},"Name":{"type":"string","description":"The campaign name. Max 200 characters."},"Flights":{"type":"array","description":"You can pass an array of flights, a blank array, or not include. See [Create Flight](ref:create-flight) endpoint.","items":{"properties":{"Ads":{"type":"array","items":{"properties":{"Creative":{"type":"object","description":"An object containing the attributes of the Creative which should be created.","required":["AdTypeId","IsActive"],"properties":{"AdTypeId":{"type":"integer","description":"The ad size's ID. More info [here](https://dev.kevel.com/docs/ad-sizes).","format":"int32"},"IsActive":{"type":"boolean","description":"Specifies whether creative is eligible to serve."},"Title":{"type":"string","description":"A short description of creative (in UI, it is called 'Friendly Name'). Max 500 characters."},"ImageName":{"type":"string","description":"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":{"type":"string","description":"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":{"type":"string","description":"The click URL. Max length is 2000 characters. Must not contain leading or trailing spaces."},"Alt":{"type":"string","description":"Alt text."},"IsHTMLJS":{"type":"boolean","description":"Specifies whether to override image with HTML or JavaScript ad. If `true` = the `ScriptBody` field should have value."},"ScriptBody":{"type":"string","description":"If `IsHTMLJS` = `true`, then this field needs to be filled with a HTML/JavaScript ad."},"Metadata":{"type":"string","description":"Adds custom [metadata](doc:creatives#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":{"type":"string","description":"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":{"type":"boolean","description":"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":{"type":"boolean","description":"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":{"type":"boolean","description":"Indicates that a creative originates from a third-party source (such as an ad network) that will serve multiple ads. (BETA)"},"TemplateId":{"type":"integer","description":"If you are using a creative template, specifies which template to use. IDs can be retrieved from the Creative Template API.","format":"int32"},"TemplateValues":{"type":"string","description":"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":{"type":"boolean","description":"Whether ad should be eligible to serve. Defaults to `false`","default":false},"ExternalMetadata":{"type":"object","description":"Object containing key/value pairs for customer's use. Max length when serialized of 512 characters."},"FreqCapType":{"type":"integer","description":"The enum value for how often frequency capping should occur. 1 = Hour 2 = Day 3 = Minute.","format":"int32"},"FreqCap":{"type":"integer","description":"The number of times the frequency cap should occur.","format":"int32"},"FreqCapDuration":{"type":"integer","description":"Specifies how often the frequency cap should occur.","format":"int32"},"DontAffectParentFreqCap":{"type":"boolean","description":"\"Opts-out\" campaign from advertiser-level frequency cap settings."}},"type":"object"}},"Jobs":{"type":"array","description":"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](ref:submit-jobs) for more details.","items":{"properties":{"TaskId":{"type":"string","description":"The type of task you are submitting.","enum":["create-ads-from-products","create-ads-from-product-query","create-native-product-ad"]},"TaskArgs":{"type":"object","description":"Arguments specific to your TaskId"}},"required":["TaskId"],"type":"object"}},"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."},"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. The upper limit 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":"string","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`.","enum":["1","2","3","4","5","6"]},"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`."},"Price":{"type":"number","description":"The Price value - instructions [here](doc:flights#rateprice).","format":"float"},"CapType":{"type":"string","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`.","enum":["1","2","3","4"]},"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"},"IsTrackingConversions":{"type":"boolean","description":"If `true`, enables conversion tracking endpoints/pixels."},"CanPassback":{"type":"string","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"},"RequireStrictLocation":{"type":"boolean","description":"If true, the ad request needs exact longitude and latitude in order to use GeoDistance targeting settings."},"TimeZone":{"type":"string","description":"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.","default":"\"UTC\""},"TargetROAS":{"type":"number","description":"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%.","format":"float"},"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"}}},"required":["Name","StartDateISO","PriorityId","GoalType","Impressions","IsActive","RateType"],"type":"object"}},"IsActive":{"type":"boolean","description":"Specifies whether campaign should be active (serving ads). Defaults to `false`.","default":false},"FreqCapType":{"type":"integer","description":"The enum value for how often frequency capping should occur. `1 = Hour 2 = Day 3 = Minute`.","format":"int32"},"FreqCap":{"type":"integer","description":"The number of times the frequency cap should occur.","format":"int32"},"FreqCapDuration":{"type":"integer","description":"Specifies how often the frequency cap should occur.","format":"int32"},"DontAffectParentFreqCap":{"type":"boolean","description":"\"Opts-out\" campaign from advertiser-level frequency cap settings."},"CapType":{"type":"integer","description":"Set to `CapType = 4`. Campaigns can only budget cap on revenue metric. Do not set to `0` - if removing, set to `null`.","format":"int32"},"DailyCapAmount":{"type":"integer","description":"The max daily revenue.","format":"int32"},"LifetimeCapAmount":{"type":"integer","description":"The max lifetime revenue.","format":"int32"},"CustomFieldsJson":{"type":"string","description":"Stringified JSON value containing Custom Fields. See https://dev.kevel.com/docs/custom-fields"},"SalespersonId":{"type":"integer","description":"Network-level login Id of salesperson","format":"int32"}}},"examples":{"JSON":{"value":{"AdvertiserId":12345,"Name":"Nike Q4 Campaign","IsActive":true,"Flights":[{"Name":"Nike Flight 1","PriorityId":234,"GoalType":2,"Impressions":100,"RateType":1,"StartDateISO":"2023-10-17 00:00:00","Ads":[{"IsActive":true,"Creative":{"Title":"Creative 1","AdTypeId":5}}]},{"Name":"Nike Flight 2","PriorityId":345,"RateType":1,"GoalType":8,"Impressions":42,"StartDateISO":"2023-10-17 00:00:00","EndDateISO":"2023-10-18 00:00:00","Ads":[{"IsActive":true,"Creative":{"Title":"Creative 2","AdTypeId":5}},{"IsActive":true,"Creative":{"Title":"Creative 3","AdTypeId":5}}]}]}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"Id\": 1000069242\n  \"Flights\": [\n    {\n      \"Id\": 1003195679,\n      \"Ads\": [\n        {\n          \"Id\": 1001151589,\n          \"Creative\": {\n            \"Id\": 1000039937\n          }\n        }\n      ]\n    },\n    {\n      \"Id\": 1003195680,\n      \"Ads\": [\n        {\n          \"Id\": 1001151590,\n          \"Creative\": {\n            \"Id\": 1000039938\n          }\n        },\n        {\n          \"Creative\": {\n            \"Id\": 1000039939\n          },\n          \"Id\": 1001151591\n        }\n      ]\n    }\n  ]\n}\n"}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"## The example below is a minimally viable campaign: \ncurl -X POST -H 'X-Adzerk-ApiKey:<API-KEY>' -H \"Content-Type:application/json\" \"https://api.kevel.co/v2/campaign\" --data-binary '{\"Name\":\"Nike Q4 Campaign\",\"AdvertiserId\":12345,\"IsActive\":true}'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function createCampaign() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let campaign = await client.run(\"campaign\", \"create\", {\n    name: \"Nike Q4 Campaign\",\n    advertiserId: 12345,\n    isActive: false, // TIP: create inactive so nothing serves until ready!\n  });\n\n  console.log(campaign);\n}\n\ncreateCampaign();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef create_campaign()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    data = {\n        name: \"Campaign Name\",\n        advertiser_id: 12345,\n        is_active: false # TIP: campaign should start inactive so nothing serves until ready!\n    }\n    pp client.campaigns.create(data)\nend\ncreate_campaign()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/campaign/{CampaignID}":{"put":{"summary":"Update Campaigns","description":"","operationId":"update-campaigns","parameters":[{"name":"CampaignID","in":"path","description":"ID of the Campaign","schema":{"type":"integer","format":"int32"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["Id","AdvertiserId","Name","IsActive"],"properties":{"Id":{"type":"integer","description":"The ID of the Campaign","format":"int32"},"AdvertiserId":{"type":"integer","description":"The ID of the Advertiser","format":"int32"},"Name":{"type":"string","description":"The name of the Campaign"},"IsActive":{"type":"boolean","description":"Whether campaign is active or not"},"isDeleted":{"type":"boolean","description":"If want to delete, set to `true`"}}},"examples":{"JSON":{"value":{"Id":56789,"AdvertiserId":12345,"Name":"Nike Q4 Campaign","IsActive":true}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"IsActive\": true,\n  \"DontAffectParentFreqCap\": null,\n  \"Flights\": [],\n  \"DailyCapAmount\": null,\n  \"FreqCapType\": 0,\n  \"CapType\": null,\n  \"IsFreqCap\": false,\n  \"IsDeleted\": false,\n  \"EndDateISO\": null,\n  \"Price\": 0,\n  \"IsArchived\": false,\n  \"LifetimeCapAmount\": null,\n  \"FreqCapDuration\": null,\n  \"FreqCap\": null,\n  \"SalespersonId\": null,\n  \"AdvertiserId\": 123456,\n  \"Name\": \"Nike Q4 Campaign\",\n  \"Id\": 56789,\n  \"CustomFieldsJson\": null,\n  \"StartDateISO\": \"2018-11-11T00:00:00.0000000\"\n}"}},"schema":{"type":"object","properties":{"IsActive":{"type":"boolean","example":true,"default":true},"DontAffectParentFreqCap":{},"Flights":{"type":"array"},"DailyCapAmount":{},"FreqCapType":{"type":"integer","example":0,"default":0},"CapType":{},"IsFreqCap":{"type":"boolean","example":false,"default":true},"IsDeleted":{"type":"boolean","example":false,"default":true},"EndDateISO":{},"Price":{"type":"integer","example":0,"default":0},"IsArchived":{"type":"boolean","example":false,"default":true},"LifetimeCapAmount":{},"FreqCapDuration":{},"FreqCap":{},"SalespersonId":{},"AdvertiserId":{"type":"integer","example":123456,"default":0},"Name":{"type":"string","example":"Nike Q4 Campaign"},"Id":{"type":"integer","example":56789,"default":0},"CustomFieldsJson":{},"StartDateISO":{"type":"string","example":"2018-11-11T00:00:00.0000000"}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X PUT -H \"X-Adzerk-ApiKey:<APIKEY>\" -H \"Content-Type:application/json\" \"https://api.kevel.co/v1/campaign/123456\" --data-binary '{\"Name\":\"Nike Q4 Campaign\",\"Id\":56789,\"AdvertiserId\":12345,\"IsActive\":true}'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function updateCampaign() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let campaign = await client.run(\"campaign\", \"update\", {id: 12345, isActive: true});\n  console.log(campaign);\n}\n\nupdateCampaign();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef update_campaign()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    campaign_id = 12345\n    opts = client.campaigns.get(campaign_id)\n    opts[:name] = \"New Campaign Name\"\n    pp client.campaigns.update(opts)\nend\nupdate_campaign()"}],"samples-languages":["curl","javascript","ruby"]}},"get":{"summary":"Get Campaign","description":"","operationId":"get-campaigns","parameters":[{"name":"CampaignID","in":"path","description":"The ID of the Campaign","schema":{"type":"integer","format":"int32"},"required":true},{"name":"excludeFlights","in":"query","description":"If true, returns only campaign metadata without flight objects. Defaults to `false`","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"IsActive\": false,\n  \"DontAffectParentFreqCap\": null,\n  \"Flights\": [],\n  \"DailyCapAmount\": null,\n  \"FreqCapType\": 0,\n  \"CapType\": null,\n  \"IsFreqCap\": null,\n  \"IsDeleted\": false,\n  \"EndDateISO\": null,\n  \"Price\": 0.00,\n  \"IsArchived\": true,\n  \"LifetimeCapAmount\": null,\n  \"FreqCapDuration\": null,\n  \"FreqCap\": null,\n  \"SalespersonId\": null,\n  \"AdvertiserId\": 12345,\n  \"Name\": \"Nike Q4 Campaign\",\n  \"Id\": 56789,\n  \"CustomFieldsJson\": null,\n  \"StartDateISO\": \"2017-03-11T00:00:00.0000000\"\n}"}},"schema":{"type":"object","properties":{"IsActive":{"type":"boolean","example":false,"default":true},"DontAffectParentFreqCap":{},"Flights":{"type":"array"},"DailyCapAmount":{},"FreqCapType":{"type":"integer","example":0,"default":0},"CapType":{},"IsFreqCap":{},"IsDeleted":{"type":"boolean","example":false,"default":true},"EndDateISO":{},"Price":{"type":"integer","example":0,"default":0},"IsArchived":{"type":"boolean","example":true,"default":true},"LifetimeCapAmount":{},"FreqCapDuration":{},"FreqCap":{},"SalespersonId":{},"AdvertiserId":{"type":"integer","example":12345,"default":0},"Name":{"type":"string","example":"Nike Q4 Campaign"},"Id":{"type":"integer","example":56789,"default":0},"CustomFieldsJson":{},"StartDateISO":{"type":"string","example":"2017-03-11T00:00:00.0000000"}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H 'X-Adzerk-ApiKey:<APIKEY>' https://api.kevel.co/v1/campaign/56789\n\n# Exclude Flights (returns faster with less data)\ncurl -X GET -H 'X-Adzerk-ApiKey:<APIKEY>' https://api.kevel.co/v1/campaign/56789?excludeFlights=true"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function getCampaign() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let campaign = await client.run(\"campaign\", \"get\", {id: 12345});\n  console.log(campaign);\n}\n\ngetCampaign();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef get_campaign()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    campaign_id = 12345\n    pp client.campaigns.get(campaign_id)\nend\nget_campaign()"}],"samples-languages":["curl","javascript","ruby"]}}},"/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 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.","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 case-sensitive. 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"]}},"get":{"summary":"List Flights","description":"Lists all the flights in the network. For the explorer, use the API Key.","operationId":"list-flights","parameters":[{"name":"filter","in":"query","description":"Limit the set of returned flights. Omission is equivalent to `not-archived`. See below.","schema":{"type":"string","enum":["not-archived","archived","active","inactive"]}}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{  \n    \"page\":1,\n    \"items\":[  \n        {  \n            \"Id\":12345,\n            \"Price\":1.000,\n            \"Impressions\":100,\n            \"IsNoDuplicates\":true,\n            \"Keywords\":\"\",\n            \"Name\":\"My Flight is Best Flight\",\n            \"IsCompanion\":false,\n            \"CampaignId\":1234,\n            \"PriorityId\":1234,\n            \"IsDeleted\":false,\n            \"IsActive\":true,\n            \"CustomTargeting\":\"\",\n            \"GoalType\":2,\n            \"RateType\":1,\n            \"IsSunday\":true,\n            \"IsMonday\":true,\n            \"IsTuesday\":true,\n            \"IsWednesday\":true,\n            \"IsThursday\":true,\n            \"IsFriday\":true,\n            \"IsSaturday\":true,\n            \"FreqCap\":0,\n            \"FreqCapDuration\":0,\n            \"FreqCapType\":0,\n            \"DontAffectParentFreqCap\": true,\n            \"DeliveryStatus\":1,\n            \"IsArchived\":null,\n            \"CanPassback\":true,\n            \"PassbackSortOrder\":1,\n            \"StartDateISO\":\"2017-05-29T15:41:00.0000000\",\n            \"Created\": \"2022-03-08T12:34:56.123Z\",\n            \"LastModified\": \"2022-03-08T12:34:56.123Z\",\n            \"Version\": 1\n        },..."}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET \\\n     -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \\\n     \"https://api.kevel.co/v1/flight\"\n     \n# List Archived only\ncurl -X GET \\\n     -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \\\n     \"https://api.kevel.co/v1/flight?isArchived=true\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function listFlights() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let flights = await client.run(\"flight\", \"list\");\n  console.log(flights);\n\n  let names = flights.items.map(a => a.name)\n  console.log(names);\n}\n\nlistFlights();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef list_flights()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    pp client.flights.list()\nend\nlist_flights()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/flight/{FlightID}":{"put":{"summary":"Update Flights","description":"This lets you update flights.","operationId":"update-flights","parameters":[{"name":"FlightID","in":"path","description":"This is the ID of the Flight","schema":{"type":"integer","format":"int32"},"required":true},{"in":"query","name":"excludeAds","schema":{"type":"boolean","default":"false"},"description":"If true, the endpoint returns only the flight metadata without ad objects"}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["Id","Name","StartDateISO","CampaignId","PriorityId","GoalType","Impressions","IsActive"],"properties":{"Id":{"type":"integer","description":"The ID of the Flight","format":"int32"},"Name":{"type":"string","description":"The name of the Flight"},"StartDateISO":{"type":"string","description":"Start date in ISO 8601 format: `YYYY-MM-DDTHH:MM:SS.SSSSSSS`. You can also just use `YYYY-MM-DD`"},"EndDateISO":{"type":"string","description":"End date in ISO 8601 format: `YYYY-MM-DDTHH:MM:SS.SSSSSSS`. You can also just use `YYYY-MM-DD`"},"NoEndDate":{"type":"boolean","description":"If flight has no specified End Date, set to `true`"},"CampaignId":{"type":"integer","description":"The ID of the campaign","format":"int32"},"PriorityId":{"type":"integer","description":"The ID of the 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","format":"int32"},"IsActive":{"type":"boolean","description":"Active/inactive state of the flight"},"IsDeleted":{"type":"boolean","description":"If want to delete, set to `true`"},"IsArchived":{"type":"boolean","description":"Specifies whether flight is archived.","default":false},"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 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.","required":["Id"],"properties":{"Id":{"type":"string","description":"The category, a string of 1 to 200 characters after trimming."}}}}}},"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. Send the full list on every update. An update that leaves this field out clears the rules, as it clears any other field you leave out, unless your network uses partial updates. 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 case-sensitive. 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."}}}}}},"examples":{"JSON":{"value":{"Id":1234,"Name":"A Different Name","StartDateISO":"2017-05-01T00:00:00.00.0000000","CampaignId":1234,"PriorityId":1234,"GoalType":1,"Impressions":20000}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"Name\":\"A Different Name\",\n  \"StartDateISO\":\"2017-05-01T00:00:00.00.0000000\",\n  \"EndDateISO\":\"2017-12-31T00:00:00.00.0000000\",\n  \"CampaignId\":1234,\n  \"PriorityId\":1234,\n  \"GoalType\": 1,\n  \"Impressions\":20000,\n  \"RateType\": 2,\n  \"Price\":5,\n  \"CapType\": 1,\n  \"DailyCapAmount\": 5000,\n  \"LifetimeCapAmount\": 50000,\n  \"IsActive\":true,\n  \"Keywords\":\"exercise\",\n  \"CustomTargeting\": null,\n  \"GeoTargeting\":[{\n    \"CountryCode\":\"US\",\n    \"Region\":\"NC\",\n    \"MetroCode\":560,\n    \"City\":\"Durham\",\n    \"CityGeonameId\":4464368,\n    \"IsExclude\":false\n  }],\n    \"SiteZoneTargeting\":[{\n    \"SiteId\":123,\n    \"ZoneId\":321,\n    \"IsExclude\":false\n  }],\n  \"IsActive\":true,\n  \"IsFreqCap\":true,\n  \"FreqCap\": 2,\n  \"FreqCapDuration\": 10,\n  \"FreqCapType\": 1,\n  \"DontAffectParentFreqCap\": true,\n  \"IsCompanion\":true,\n  \"IsNoDuplicates\":false,  \n  \"IsTrackingConversions\": true,\n  \"CanPassback\":true,\n  \"PassbackSortOrder\":1,\n  \"IsArchived\":false,\n  \"IsSunday\": true,\n  \"IsMonday\": false,\n  \"IsTuesday\": false,\n  \"IsWednesday\": false,\n  \"IsThursday\": false,\n  \"IsFriday\": false,\n  \"IsSaturday\": true,\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  \"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}"}},"schema":{"type":"object","properties":{"Name":{"type":"string","example":"A Different Name"},"StartDateISO":{"type":"string","example":"2017-05-01T00:00:00.00.0000000"},"EndDateISO":{"type":"string","example":"2017-12-31T00:00:00.00.0000000"},"CampaignId":{"type":"integer","example":1234,"default":0},"PriorityId":{"type":"integer","example":1234,"default":0},"GoalType":{"type":"integer","example":1,"default":0},"Impressions":{"type":"integer","example":20000,"default":0},"RateType":{"type":"integer","example":2,"default":0},"Price":{"type":"integer","example":5,"default":0},"CapType":{"type":"integer","example":1,"default":0},"DailyCapAmount":{"type":"integer","example":5000,"default":0},"LifetimeCapAmount":{"type":"integer","example":50000,"default":0},"IsActive":{"type":"boolean","example":true,"default":true},"Keywords":{"type":"string","example":"exercise"},"CustomTargeting":{},"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}}}},"IsFreqCap":{"type":"boolean","example":true,"default":true},"FreqCap":{"type":"integer","example":2,"default":0},"FreqCapDuration":{"type":"integer","example":10,"default":0},"FreqCapType":{"type":"integer","example":1,"default":0},"DontAffectParentFreqCap":{"type":"boolean","example":true,"default":true},"IsCompanion":{"type":"boolean","example":true,"default":true},"IsNoDuplicates":{"type":"boolean","example":false,"default":true},"IsTrackingConversions":{"type":"boolean","example":true,"default":true},"CanPassback":{"type":"boolean","example":true,"default":true},"PassbackSortOrder":{"type":"integer","example":1,"default":0},"IsArchived":{"type":"boolean","example":false,"default":true},"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},"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},"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}}}}},"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":"curl -X PUT \\\n     -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \\\n     -H \"Content-Type:application/json\" \\\n     --data-binary '{\"Id\":123456,\"PriorityId\":12345,\"GoalType\":2,\"RateType\":2,\"CampaignId\":123456,\"Name\":\"A Different Name\",\"StartDateISO\":\"2018-06-03\",\"IsActive\":true}' \\\n     \"https://api.kevel.co/v1/flight/123456\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function updateFlight() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let flight = await client.run(\"flight\", \"update\", {id: 12345, name: \"A Different Name\"});\n  console.log(flight);\n}\n\nupdateFlight();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef update_flight()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    flight_id = 12345\n    data = client.flights.get(flight_id)\n    data[:name] = \"Updated Name\"\n    pp client.flights.update(data)\nend\nupdate_flight()"}],"samples-languages":["curl","javascript","ruby"]}},"get":{"summary":"Get Flight","description":"This returns the parameters for a specific flight","operationId":"get-flight","parameters":[{"name":"FlightID","in":"path","description":"This is the ID of the Flight","schema":{"type":"integer","format":"int32"},"required":true},{"name":"excludeAds","in":"query","description":"If true, the endpoint returns only the flight metadata without ad objects","schema":{"type":"boolean"}}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{  \n    \"Id\":12345,\n    \"NoEndDate\":null,\n    \"Price\":0.000,\n    \"OptionType\":1,\n    \"Impressions\":100,\n    \"IsUnlimited\":false,\n    \"IsNoDuplicates\":true,\n    \"DuplicateMode\":4,\n    \"IsFullSpeed\":false,\n    \"Keywords\":\"\",\n    \"UserAgentKeywords\":null,\n    \"Name\":\"The Great API Flight\",\n    \"WeightOverride\":null,\n    \"IsFreqCap\":null,\n    \"IsCompanion\":false,\n    \"CampaignId\":12345,\n    \"PriorityId\":1234,\n    \"IsDeleted\":false,\n    \"IsActive\":true,\n    \"GeoTargeting\":[  \n        {  \n            \"LocationId\":1234567,\n            \"FlightId\":0,\n            \"CountryCode\":\"US\",\n            \"Region\":\"NC\",\n            \"MetroCode\":560,\n            \"City\":\"Durham\",\n            \"CityGeonameId\":4464368,\n            \"IsExclude\":null\n        }\n    ],\n    \"SiteZoneTargeting\":[  \n        {  \n            \"Id\":123456,\n            \"FlightId\":12345,\n            \"SiteId\":12345,\n            \"ZoneId\":null,\n            \"IsExclude\":true\n        }\n    ],\n    \"CustomTargeting\":\"\",\n    \"GoalType\":2,\n    \"RateType\":1,\n    \"IsECPMOptimized\":null,\n    \"ECPMOptimizePeriod\":null,\n    \"ECPMMultiplier\":null,\n    \"FloorECPM\":null,\n    \"CeilingECPM\":null,\n    \"DefaultECPM\":null,\n    \"ECPMBurnInImpressions\":null,\n    \"EffectiveCPMOverride\":null,\n    \"DatePartingStartTime\":null,\n    \"DatePartingEndTime\":null,\n    \"IsSunday\":true,\n    \"IsMonday\":true,\n    \"IsTuesday\":true,\n    \"IsWednesday\":true,\n    \"IsThursday\":true,\n    \"IsFriday\":true,\n    \"IsSaturday\":true,\n    \"FreqCap\":0,\n    \"FreqCapDuration\":0,\n    \"FreqCapType\":0,\n    \"CapType\":1,\n    \"DailyCapAmount\":null,\n    \"LifetimeCapAmount\":null,\n    \"DeliveryStatus\":1,\n    \"CustomFieldsJson\":\"{\\\"SKU\\\":\\\"\\\"}\",\n    \"BehavioralTargeting\":null,\n    \"CreativeMaps\":[  \n        {  \n            \"Id\":12345,\n            \"CampaignId\":12345,\n            \"FlightId\":12345,\n            \"ZoneId\":0,\n            \"SiteId\":0,\n            \"Iframe\":null,\n            \"Impressions\":100,\n            \"Percentage\":0,\n            \"DistributionType\":1,\n            \"IsDeleted\":false,\n            \"IsActive\":true,\n            \"Creative\":{  \n                \"Id\":12345,\n                \"Title\":\"The Great API Creative\",\n                \"ImageName\":\"99b3fbfdd2e8491295c9d0d5dc4d5a2f.gif\",\n                \"Url\":\"https://adzerk.com\",\n                \"Body\":\"\\\"\\\"\",\n                \"AdvertiserId\":12345,\n                \"IsActive\":true,\n                \"AdTypeId\":5,\n                \"Alt\":\"New alt tag\",\n                \"IsDeleted\":null,\n                \"IsSync\":null,\n                \"IsHTMLJS\":false,\n                \"Metadata\":null,\n                \"ImageLink\":\"httpss://static.adzerk.net/Advertisers/99b3fbfdd2e8491295c9d0d5dc4d5a2f.gif\"\n            },\n            \"CustomTargeting\":\"\",\n            \"FreqCap\":0,\n            \"FreqCapDuration\":0,\n            \"FreqCapType\":0,\n            \"StartDate\":null,\n            \"EndDate\":null,\n            \"GoalType\":0,\n            \"Goal\":null,\n            \"IsGoalOverride\":null,\n            \"IsStartEndDateOverride\":null,\n            \"ActiveKeywords\":[  \n\n            ],\n            \"RtbCustomFields\":null\n        }\n    ],\n    \"IsTargetingOptimization\":null,\n    \"TargetingOptimizationType\":null,\n    \"TargetingOptimizationTargetType\":null,\n    \"TargetingOptimizationTarget\":null,\n    \"TargetingOptimizationBurnIn\":null,\n    \"TargetingOptimizationCanMiss\":null,\n  \t\"GeoDistanceTargeting\":[],\n    \"IsArchived\":null,\n    \"CanPassback\":true,\n    \"PassbackSortOrder\":1,\n    \"StartDateISO\":\"2015-06-08T00:00:00.0000000\"\n}"}},"schema":{"type":"object","properties":{"Id":{"type":"integer","example":12345,"default":0},"NoEndDate":{},"Price":{"type":"integer","example":0,"default":0},"OptionType":{"type":"integer","example":1,"default":0},"Impressions":{"type":"integer","example":100,"default":0},"IsUnlimited":{"type":"boolean","example":false,"default":true},"IsNoDuplicates":{"type":"boolean","example":true,"default":true},"DuplicateMode":{"type":"integer","example":4,"default":0},"IsFullSpeed":{"type":"boolean","example":false,"default":true},"Keywords":{"type":"string","example":""},"UserAgentKeywords":{},"Name":{"type":"string","example":"The Great API Flight"},"WeightOverride":{},"IsFreqCap":{},"IsCompanion":{"type":"boolean","example":false,"default":true},"CampaignId":{"type":"integer","example":12345,"default":0},"PriorityId":{"type":"integer","example":1234,"default":0},"IsDeleted":{"type":"boolean","example":false,"default":true},"IsActive":{"type":"boolean","example":true,"default":true},"GeoTargeting":{"type":"array","items":{"type":"object","properties":{"LocationId":{"type":"integer","example":1234567,"default":0},"FlightId":{"type":"integer","example":0,"default":0},"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":{}}}},"SiteZoneTargeting":{"type":"array","items":{"type":"object","properties":{"Id":{"type":"integer","example":123456,"default":0},"FlightId":{"type":"integer","example":12345,"default":0},"SiteId":{"type":"integer","example":12345,"default":0},"ZoneId":{},"IsExclude":{"type":"boolean","example":true,"default":true}}}},"CustomTargeting":{"type":"string","example":""},"GoalType":{"type":"integer","example":2,"default":0},"RateType":{"type":"integer","example":1,"default":0},"IsECPMOptimized":{},"ECPMOptimizePeriod":{},"ECPMMultiplier":{},"FloorECPM":{},"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"},"DatePartingStartTime":{},"DatePartingEndTime":{},"IsSunday":{"type":"boolean","example":true,"default":true},"IsMonday":{"type":"boolean","example":true,"default":true},"IsTuesday":{"type":"boolean","example":true,"default":true},"IsWednesday":{"type":"boolean","example":true,"default":true},"IsThursday":{"type":"boolean","example":true,"default":true},"IsFriday":{"type":"boolean","example":true,"default":true},"IsSaturday":{"type":"boolean","example":true,"default":true},"FreqCap":{"type":"integer","example":0,"default":0},"FreqCapDuration":{"type":"integer","example":0,"default":0},"FreqCapType":{"type":"integer","example":0,"default":0},"CapType":{"type":"integer","example":1,"default":0},"DailyCapAmount":{},"LifetimeCapAmount":{},"DeliveryStatus":{"type":"integer","example":1,"default":0},"CustomFieldsJson":{"type":"string","example":"{\"SKU\":\"\"}"},"BehavioralTargeting":{},"CreativeMaps":{"type":"array","items":{"type":"object","properties":{"Id":{"type":"integer","example":12345,"default":0},"CampaignId":{"type":"integer","example":12345,"default":0},"FlightId":{"type":"integer","example":12345,"default":0},"ZoneId":{"type":"integer","example":0,"default":0},"SiteId":{"type":"integer","example":0,"default":0},"Iframe":{},"Impressions":{"type":"integer","example":100,"default":0},"Percentage":{"type":"integer","example":0,"default":0},"DistributionType":{"type":"integer","example":1,"default":0},"IsDeleted":{"type":"boolean","example":false,"default":true},"IsActive":{"type":"boolean","example":true,"default":true},"Creative":{"type":"object","properties":{"Id":{"type":"integer","example":12345,"default":0},"Title":{"type":"string","example":"The Great API Creative"},"ImageName":{"type":"string","example":"99b3fbfdd2e8491295c9d0d5dc4d5a2f.gif"},"Url":{"type":"string","example":"https://adzerk.com"},"Body":{"type":"string","example":"\"\""},"AdvertiserId":{"type":"integer","example":12345,"default":0},"IsActive":{"type":"boolean","example":true,"default":true},"AdTypeId":{"type":"integer","example":5,"default":0},"Alt":{"type":"string","example":"New alt tag"},"IsDeleted":{},"IsSync":{},"IsHTMLJS":{"type":"boolean","example":false,"default":true},"Metadata":{},"ImageLink":{"type":"string","example":"httpss://static.adzerk.net/Advertisers/99b3fbfdd2e8491295c9d0d5dc4d5a2f.gif"}}},"CustomTargeting":{"type":"string","example":""},"FreqCap":{"type":"integer","example":0,"default":0},"FreqCapDuration":{"type":"integer","example":0,"default":0},"FreqCapType":{"type":"integer","example":0,"default":0},"StartDate":{},"EndDate":{},"GoalType":{"type":"integer","example":0,"default":0},"Goal":{},"IsGoalOverride":{},"IsStartEndDateOverride":{},"ActiveKeywords":{"type":"array"},"RtbCustomFields":{}}}},"IsTargetingOptimization":{},"TargetingOptimizationType":{},"TargetingOptimizationTargetType":{},"TargetingOptimizationTarget":{},"TargetingOptimizationBurnIn":{},"TargetingOptimizationCanMiss":{},"GeoDistanceTargeting":{"type":"array"},"IsArchived":{},"CanPassback":{"type":"boolean","example":true,"default":true},"PassbackSortOrder":{"type":"integer","example":1,"default":0},"StartDateISO":{"type":"string","example":"2015-06-08T00:00:00.0000000"},"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":"curl -X GET \\\n     -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \\\n     \"https://api.kevel.co/v1/flight/12345\"\n     \n# Exclude ads (returns faster with less data)\ncurl -X GET \\\n     -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \\\n     \"https://api.kevel.co/v1/flight/12345?excludeAds=true\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function getFlight() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let flight = await client.run(\"flight\", \"get\", {id: 12345});\n  console.log(flight);\n}\n\ngetFlight();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef get_flight()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    flight_id = 12345\n    pp client.flights.get(flight_id)\nend\nget_flight()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/campaign/{CampaignID}/flight":{"get":{"summary":"List Flights for Campaign","description":"Lists all flights for a particular campaign.","operationId":"list-flights-for-campaign-id","parameters":[{"name":"CampaignID","in":"path","description":"ID of the Campaign","schema":{"type":"integer","format":"int32"},"required":true},{"name":"filter","in":"query","description":"Limit the set of returned flights. Omission is equivalent to not-archived. See [List Flights](#list-flights) for details.","schema":{"type":"string","enum":["not-archived","archived","active","inactive"]}},{"name":"isActive","in":"query","description":"DEPRECATED. If true, returns only active flights. Deprecated: will be removed in the future. Use filter in preference.","schema":{"type":"boolean"}},{"in":"query","name":"excludeAds","schema":{"type":"boolean","default":"false"},"description":"If true, the endpoint returns only the flight data without ad objects"}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{  \n    \"items\":[  \n        {  \n            \"Id\":12345,\n            \"NoEndDate\":null,\n            \"Price\":0.000,\n            \"Impressions\":100,\n            \"IsNoDuplicates\":true,\n            \"DuplicateMode\":4,\n            \"Keywords\":\"\",\n            \"Name\":\"The Great API Flight\",\n            \"WeightOverride\":null,\n            \"IsFreqCap\":null,\n            \"IsCompanion\":false,\n            \"CampaignId\":1234,\n            \"PriorityId\":1234,\n            \"IsDeleted\":false,\n            \"IsActive\":true,\n            \"GeoTargeting\":null,\n            \"SiteZoneTargeting\":null,\n            \"CustomTargeting\":\"\",\n            \"GoalType\":2,\n            \"RateType\":1,\n            \"IsECPMOptimized\":null,\n            \"ECPMOptimizePeriod\":null,\n            \"ECPMMultiplier\":null,\n            \"FloorECPM\":null,\n            \"CeilingECPM\":null,\n            \"DefaultECPM\":null,\n            \"ECPMBurnInImpressions\":null,\n            \"EffectiveCPMOverride\":null,\n            \"DatePartingStartTimeISO\":null,\n            \"DatePartingEndTimeISO\":null,\n            \"IsSunday\":true,\n            \"IsMonday\":true,\n            \"IsTuesday\":true,\n            \"IsWednesday\":true,\n            \"IsThursday\":true,\n            \"IsFriday\":true,\n            \"IsSaturday\":true,\n            \"FreqCap\":0,\n            \"FreqCapDuration\":0,\n            \"FreqCapType\":0,\n            \"CapType\":1,\n            \"DailyCapAmount\":null,\n            \"LifetimeCapAmount\":null,\n            \"DeliveryStatus\":1,\n            \"CustomFieldsJson\":null,\n            \"BehavioralTargeting\":null,\n            \"IsTargetingOptimization\":null,\n            \"TargetingOptimizationType\":null,\n            \"TargetingOptimizationTargetType\":null,\n            \"TargetingOptimizationTarget\":null,\n            \"TargetingOptimizationBurnIn\":null,\n            \"TargetingOptimizationCanMiss\":null,\n            \"IsArchived\":null,\n            \"CanPassback\":true,\n            \"PassbackSortOrder\":1,\n            \"StartDateISO\":\"2017-06-08T00:00:00.0000000\",\n            \"EndDateISO\":\"2017-12-08T00:00:00.0000000\",\n            \"Created\":\"2022-03-08T12:34:56.123Z\",\n            \"LastModified\":\"2022-03-08T12:34:56.123Z\",\n            \"Version\":4\n        }...\n\t\"page\": 1\n}"}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET \\\n     -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \\\n     \"https://api.kevel.co/v1/campaign/1234/flight\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function listFlightsForCampaign() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let flights = await client.run(\"flight\", \"listForCampaign\", {campaignId: 12345});\n  console.log(flights);\n\n  let names = flights.items.map(a => a.name)\n  console.log(names);\n}\n\nlistFlightsForCampaign();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef list_flights_for_campaign()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    campaign_id = 12345\n    pp client.flights.list_for_campaign(campaign_id)\nend\nlist_flights_for_campaign()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/advertiser/{AdvertiserID}/flight":{"get":{"summary":"List Flights for Advertiser","description":"Lists all flights for a particular advertiser.","operationId":"list-flights-for-advertiser-id","parameters":[{"name":"AdvertiserId","in":"path","description":"ID of the Advertiser","schema":{"type":"integer","format":"int32"},"required":true},{"name":"filter","in":"query","description":"Constrains the set of flights returned. Omission is equivalent to specifying `not-archived`. For details see [List Flights](ref:list-flights).","schema":{"type":"string","enum":["active","inactive","archived","not-archived"]}},{"in":"query","name":"excludeAds","schema":{"type":"boolean","default":"false"},"description":"If true, the endpoint returns only the flight data without ad objects"}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{  \n    \"items\":[  \n        {  \n            \"Id\":12345,\n            \"NoEndDate\":null,\n            \"Price\":0.000,\n            \"Impressions\":100,\n            \"IsNoDuplicates\":true,\n            \"DuplicateMode\":4,\n            \"Keywords\":\"\",\n            \"Name\":\"The Great API Flight\",\n            \"WeightOverride\":null,\n            \"IsFreqCap\":null,\n            \"IsCompanion\":false,\n            \"CampaignId\":1234,\n            \"PriorityId\":1234,\n            \"IsDeleted\":false,\n            \"IsActive\":true,\n            \"GeoTargeting\":null,\n            \"SiteZoneTargeting\":null,\n            \"CustomTargeting\":\"\",\n            \"GoalType\":2,\n            \"RateType\":1,\n            \"IsECPMOptimized\":null,\n            \"ECPMOptimizePeriod\":null,\n            \"ECPMMultiplier\":null,\n            \"FloorECPM\":null,\n            \"CeilingECPM\":null,\n            \"DefaultECPM\":null,\n            \"ECPMBurnInImpressions\":null,\n            \"EffectiveCPMOverride\":null,\n            \"DatePartingStartTimeISO\":null,\n            \"DatePartingEndTimeISO\":null,\n            \"IsSunday\":true,\n            \"IsMonday\":true,\n            \"IsTuesday\":true,\n            \"IsWednesday\":true,\n            \"IsThursday\":true,\n            \"IsFriday\":true,\n            \"IsSaturday\":true,\n            \"FreqCap\":0,\n            \"FreqCapDuration\":0,\n            \"FreqCapType\":0,\n            \"CapType\":1,\n            \"DailyCapAmount\":null,\n            \"LifetimeCapAmount\":null,\n            \"DeliveryStatus\":1,\n            \"CustomFieldsJson\":null,\n            \"BehavioralTargeting\":null,\n            \"IsTargetingOptimization\":null,\n            \"TargetingOptimizationType\":null,\n            \"TargetingOptimizationTargetType\":null,\n            \"TargetingOptimizationTarget\":null,\n            \"TargetingOptimizationBurnIn\":null,\n            \"TargetingOptimizationCanMiss\":null,\n            \"IsArchived\":null,\n            \"CanPassback\":true,\n            \"PassbackSortOrder\":1,\n            \"StartDateISO\":\"2017-06-08T00:00:00.0000000\",\n            \"EndDateISO\":\"2017-12-08T00:00:00.0000000\",\n            \"Created\":\"2022-03-08T12:34:56.123Z\",\n            \"LastModified\":\"2022-03-08T12:34:56.123Z\",\n            \"Version\":4\n        }...\n\t\"page\": 1\n}"}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET \\\n     -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \\\n     \"https://api.kevel.co/v1/advertiser/1234/flight\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function listFlightsForAdvertiser() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let flights = await client.run(\"flight\", \"listForAdvertiser\", {advertiserId: 12345});\n  console.log(flights);\n\n  let names = flights.items.map(a => a.name)\n  console.log(names);\n}\n\nlistFlightsForAdvertiser();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef list_flights_for_advertiser()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    advertiser_id = 12345\n    pp client.flights.list_for_advertiser(advertiser_id)\nend\nlist_flights_for_advertiser()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/fast/flight":{"get":{"summary":"Flight Filtering","description":"","operationId":"flight-category","parameters":[{"name":"isActive","in":"query","description":"Only return flights where `IsActive` is [true/false]. Default is `true`.","schema":{"type":"boolean","default":false}},{"name":"isArchived","in":"query","description":"Only return flights where `IsArchived` is [true/false]. Default is `false`.","schema":{"type":"boolean","default":false}},{"name":"beforeStartDate","in":"query","description":"Only return flights where `StartDate` is before the provided date. Format: `YYYY-MM-DD HH:MM:SS`; `HH:MM:SS` optional","schema":{"type":"string"}},{"name":"afterStartDate","in":"query","description":"Only return flights where `StartDate` is after the provided date. Format: `YYYY-MM-DD HH:MM:SS`; `HH:MM:SS` optional","schema":{"type":"string"}},{"name":"beforeEndDate","in":"query","description":"Only return flights where `EndDate` is before the provided date. Format: `YYYY-MM-DD HH:MM:SS`; `HH:MM:SS` optional","schema":{"type":"string"}},{"name":"afterEndDate","in":"query","description":"Only return flights where `EndDate` is after the provided date. Format: `YYYY-MM-DD HH:MM:SS`; `HH:MM:SS` optional","schema":{"type":"string"}},{"name":"noEndDate","in":"query","description":"Only return flights where `EndDate` is null","schema":{"type":"boolean"}},{"name":"name","in":"query","description":"Only return flights where `Name` is an exact match of the query.","schema":{"type":"string"}},{"name":"nameContains","in":"query","description":"Only return flights where the given string is a substring of the `Name`. No wildcard characters are supported.","schema":{"type":"string"}}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"LastModifiedDate\": \"2016-12-08T21:34:32Z\",\n  \"CustomFieldsJson\": \"{\\\"Currency\\\":\\\"USD: US Dollars\\\"}\",\n  \"StartDate\": \"2016-12-08T00:00:00Z\",\n  \"PriorityId\": 1234,\n  \"IsDeleted\": false,\n  \"Id\": 1234567,\n  \"IsNoDuplicates\": false,\n  \"IsArchived\": null,\n  \"RateType\": 1,\n  \"FreqCap\": 0,\n  \"IsCompanion\": false,\n  \"CanPassback\": false,\n  \"CapType\": 1,\n  \"Price\": 0,\n  \"IsActive\": true,\n  \"FreqCapType\": 0,\n  \"CustomTargeting\": \"\",\n  \"IsTrackingConversions\": false,\n  \"FreqCapDuration\": 0,\n  \"PassbackSortOrder\": null,\n  \"GoalType\": 2,\n  \"DailyCapAmount\": null,\n  \"Name\": \"There's a Flight\",\n  \"LifetimeCapAmount\": null,\n  \"AdvertiserId\": 12345,\n  \"Keywords\": \"\",\n  \"EndDate\": null,\n  \"AdIds\": [\n    1234567\n  ],\n  \"Impressions\": 100,\n  \"CampaignId\": 123456\n}"}},"schema":{"type":"object","properties":{"LastModifiedDate":{"type":"string","example":"2016-12-08T21:34:32Z"},"CustomFieldsJson":{"type":"string","example":"{\"Currency\":\"USD: US Dollars\"}"},"StartDate":{"type":"string","example":"2016-12-08T00:00:00Z"},"PriorityId":{"type":"integer","example":1234,"default":0},"IsDeleted":{"type":"boolean","example":false,"default":true},"Id":{"type":"integer","example":1234567,"default":0},"IsNoDuplicates":{"type":"boolean","example":false,"default":true},"IsArchived":{},"RateType":{"type":"integer","example":1,"default":0},"FreqCap":{"type":"integer","example":0,"default":0},"IsCompanion":{"type":"boolean","example":false,"default":true},"CanPassback":{"type":"boolean","example":false,"default":true},"CapType":{"type":"integer","example":1,"default":0},"Price":{"type":"integer","example":0,"default":0},"IsActive":{"type":"boolean","example":true,"default":true},"FreqCapType":{"type":"integer","example":0,"default":0},"CustomTargeting":{"type":"string","example":""},"IsTrackingConversions":{"type":"boolean","example":false,"default":true},"FreqCapDuration":{"type":"integer","example":0,"default":0},"PassbackSortOrder":{},"GoalType":{"type":"integer","example":2,"default":0},"DailyCapAmount":{},"Name":{"type":"string","example":"There's a Flight"},"LifetimeCapAmount":{},"AdvertiserId":{"type":"integer","example":12345,"default":0},"Keywords":{"type":"string","example":""},"EndDate":{},"AdIds":{"type":"array","items":{"type":"integer","example":1234567,"default":0}},"Impressions":{"type":"integer","example":100,"default":0},"CampaignId":{"type":"integer","example":123456,"default":0}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -N \"https://api.kevel.co/v1/fast/flight\" -H \"X-Adzerk-ApiKey:<API-KEY>\"\n\n# With multiple arguments\ncurl -N \"https://api.kevel.co/v1/fast/flight?beforeStartDate=2014-01-01&noEndDate=true&isActive=false&nameContains=shoe\" -H \"X-Adzerk-ApiKey:<API-KEY>\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function filterFlights() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let flights = await client.run(\"flight\", \"filter\", {nameContains: \"of\"});\n  console.log(flights);\n\n  let summaries = flights.map(a => `${a.id} - ${a.name} - ${a.campaignId}`);\n  console.log(summaries);\n}\n\nfilterFlights();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef filter_flights()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    flight_data = {\n        is_active: true,\n        name_contains: \"of\"\n    }\n    pp client.flights.filter_flights(flight_data)\nend\nfilter_flights()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/creative":{"post":{"summary":"Create Creative","description":"This creates a new creative under an advertiser.","operationId":"create-creative","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["AdvertiserId","AdTypeId","IsActive"],"properties":{"AdvertiserId":{"type":"integer","description":"The ID of the Advertiser.","format":"int32"},"AdTypeId":{"type":"integer","description":"The ad size's ID. More info [here](https://dev.kevel.com/docs/ad-sizes).","format":"int32"},"IsActive":{"type":"boolean","description":"Specifies whether creative is eligible to serve."},"Title":{"type":"string","description":"A short description of creative (in UI, it is called 'Friendly Name'). Max 500 characters."},"ImageName":{"type":"string","description":"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":{"type":"string","description":"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":{"type":"string","description":"The click URL. Max length is 2000 characters. Must not contain leading or trailing spaces."},"Alt":{"type":"string","description":"Alt text. The maximum length is 500 characters after HTML-encoding the value."},"IsDeleted":{"type":"boolean","description":"Specifies whether creative is deleted."},"IsHTMLJS":{"type":"boolean","description":"Specifies whether to override image with HTML or JavaScript ad. If `true` = the `ScriptBody` field should have value."},"ScriptBody":{"type":"string","description":"If `IsHTMLJS` = `true`, then this field needs to be filled with a HTML/JavaScript ad."},"Metadata":{"type":"string","description":"Adds custom [metadata](doc:creatives#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":{"type":"string","description":"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":{"type":"boolean","description":"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":{"type":"boolean","description":"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":{"type":"boolean","description":"Indicates that a creative originates from a third-party source (such as an ad network) that will serve multiple ads. (BETA)"},"TemplateId":{"type":"integer","description":"If you are using a creative template, specifies which template to use. IDs can be retrieved from the Creative Template API.","format":"int32"},"TemplateValues":{"type":"string","description":"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\\\"}\"`"}}},"examples":{"JSON":{"value":{"AdvertiserId":123,"Title":"Adzerk Blue Creative","Body":"","AdTypeId":5,"Url":"https://adzerk.com","IsDeleted":false,"Alt":"Adzerk - Native Ads","IsActive":true,"Metadata":"JSON object as string","ImageLink":"https://somecdn.com/somelongstring.jpg","IsNoTrack":true,"IsNetworkAd":false}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"Id\":1234,\n  \"Title\":\"Adzerk Blue Creative\",\n  \"ImageName\":\"somelongstring.jpg\",\n  \"Url\":\"https://adzerk.com\",\n  \"Body\":\"\",\n  \"AdvertiserId\":123,\n  \"IsActive\":true,\n  \"AdTypeId\":5,\n  \"Alt\":\"Adzerk - Native Ads\",\n  \"IsDeleted\":false,\n  \"IsSync\":false,\n  \"IsHTMLJS\": true,\n  \"ScriptBody\":\"<a href=\\\"{{url}}\\\">Click here to redirect to Url</a>\",\n  \"Metadata\":\"{\\\"something\\\":true}\",\n  \"ImageLink\":\"https://somecdn.com/somelongstring.jpg\",\n  \"IsNoTrack\":true,\n  \"IsNetworkAd\":false\n}"}},"schema":{"type":"object","properties":{"Id":{"type":"integer","example":1234,"default":0},"Title":{"type":"string","example":"Adzerk Blue Creative"},"ImageName":{"type":"string","example":"somelongstring.jpg"},"Url":{"type":"string","example":"https://adzerk.com"},"Body":{"type":"string","example":""},"AdvertiserId":{"type":"integer","example":123,"default":0},"IsActive":{"type":"boolean","example":true,"default":true},"AdTypeId":{"type":"integer","example":5,"default":0},"Alt":{"type":"string","example":"Adzerk - Native Ads"},"IsDeleted":{"type":"boolean","example":false,"default":true},"IsSync":{"type":"boolean","example":false,"default":true},"IsHTMLJS":{"type":"boolean","example":true,"default":true},"ScriptBody":{"type":"string","example":"<a href=\"{{url}}\">Click here to redirect to Url</a>"},"Metadata":{"type":"string","example":"{\"something\":true}"},"ImageLink":{"type":"string","example":"https://somecdn.com/somelongstring.jpg"},"IsNoTrack":{"type":"boolean","example":true,"default":true},"IsNetworkAd":{"type":"boolean","example":false,"default":true}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"## A minimally viable creative. Note that it includes no `Title` or creative contents.\ncurl -X POST -H 'X-Adzerk-ApiKey:<API-KEY>' -H \"Content-Type:application/json\" \"https://api.kevel.co/v1/creative\" --data-binary '{\"AdvertiserId\":12345,\"AdTypeId\":5,\"IsActive\":true}'\n\n## A minimally viable image creative without an uploaded image (to upload an image, see \"Upload Creative Image\"): \ncurl -X POST -H 'X-Adzerk-ApiKey:<API-KEY>' -H \"Content-Type:application/json\" \"https://api.kevel.co/v1/creative\" --data-binary '{\"AdvertiserId\":12345,\"AdTypeId\":5,\"Title\":\"Image Creative\",\"Url\":\"http://adzerk.com\",\"Body\":\"\",\"IsActive\":true}'\n\n## A minimally viable image creative with an externally hosted image: \ncurl -X POST -H 'X-Adzerk-ApiKey:<API-KEY>' -H \"Content-Type:application/json\" \"https://api.kevel.co/v1/creative\" --data-binary '{\"AdvertiserId\":12345,\"AdTypeId\":5,\"Title\":\"Image Creative\",\"Url\":\"http://adzerk.com\",\"Body\":\"\",\"IsActive\":true,\"ImageLink\":\"http://cdn.com/ad.gif\"}'\n\n## A minimally viable JS/HTML creative:\ncurl -X POST -H 'X-Adzerk-ApiKey:<API-KEY>' -H \"Content-Type:application/json\" \"https://api.kevel.co/v1/creative\" --data-binary '{\"AdvertiserId\":12345,\"AdTypeId\":5,\"Title\":\"JS/HTML Creative\",\"IsActive\":true,\"ScriptBody\":\"Creative contents\",\"IsHTMLJS\":true}'\n\n## A minimally viable Static Text Link creative:\ncurl -X POST -H 'X-Adzerk-ApiKey:<API-KEY>' -H \"Content-Type:application/json\" \"https://api.kevel.co/v1/creative\" --data-binary '{\"AdvertiserId\":12345,\"AdTypeId\":20,\"IsActive\":true,\"Title\":\"Static Text Link example\",\"Url\":\"http://adzerk.com\"}'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function createCreative() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let creative = await client.run(\"creative\", \"create\", {\n    title: \"Creative Name\",\n    isActive: true,\n    advertiserId: 12345,\n    adTypeId: 5,\n    url: \"https://www.adzerk.com\",\n    isHtmljs: true,\n    scriptBody: \"<script>console.log('hello world!')</script>\",\n  });\n\n  console.log(creative);\n}\n\ncreateCreative();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef create_creative()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    data = {\n        title: \"Creative Name\",\n        is_active: true,\n        advertiser_id: 12345,\n        ad_type_id: 5,\n        url: \"https://www.adzerk.com\",\n    }\n    pp client.creatives.create(data)\nend\ncreate_creative()"}],"samples-languages":["curl","javascript","ruby"]}},"get":{"summary":"List Creatives For Network","description":"","operationId":"list-creatives-for-network","responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n    \"page\": 1,\n    \"items\": [\n        {\n            \"Id\": 123456,\n            \"Title\": \"Adzerk Blue Creative\",\n            \"ImageName\": \"somelongstring.jpg\",\n            \"Url\": \"https://adzerk.com\",\n            \"Body\": \"\",\n            \"AdvertiserId\": 123456,\n            \"IsActive\": true,\n            \"AdTypeId\": 5,\n            \"Alt\": \"Adzerk - Native Ads\",\n            \"IsDeleted\": false,\n            \"IsSync\": false,\n            \"IsHTMLJS\": true,\n            \"ScriptBody\": \"The Great API Content\",\n            \"ImageLink\": \"https://somecdn.com/somelongstring.jpg\",\n            \"Metadata\": \"JSON object as string\",\n            \"IsNoTrack\": true,\n            \"IsNetworkAd\": false\n        }\n      ]\n}"}},"schema":{"type":"object","properties":{"page":{"type":"integer","example":1,"default":0},"items":{"type":"array","items":{"type":"object","properties":{"Id":{"type":"integer","example":123456,"default":0},"Title":{"type":"string","example":"Adzerk Blue Creative"},"ImageName":{"type":"string","example":"somelongstring.jpg"},"Url":{"type":"string","example":"https://adzerk.com"},"Body":{"type":"string","example":""},"AdvertiserId":{"type":"integer","example":123456,"default":0},"IsActive":{"type":"boolean","example":true,"default":true},"AdTypeId":{"type":"integer","example":5,"default":0},"Alt":{"type":"string","example":"Adzerk - Native Ads"},"IsDeleted":{"type":"boolean","example":false,"default":true},"IsSync":{"type":"boolean","example":false,"default":true},"IsHTMLJS":{"type":"boolean","example":true,"default":true},"ScriptBody":{"type":"string","example":"The Great API Content"},"ImageLink":{"type":"string","example":"https://somecdn.com/somelongstring.jpg"},"Metadata":{"type":"string","example":"JSON object as string"},"IsNoTrack":{"type":"boolean","example":true,"default":true},"IsNetworkAd":{"type":"boolean","example":false,"default":true}}}}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/creative\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function listCreativesForNetwork() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let creatives = await client.run(\"creative\", \"listForNetwork\");\n  console.log(creatives);\n}\nlistCreativesForNetwork();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef list_creatives_for_network()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    pp client.creatives.list_for_network()\nend\nlist_creatives_for_network()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/creative/{CreativeID}/upload":{"post":{"summary":"Upload Creative Image","description":"","operationId":"upload-creative-image","parameters":[{"name":"CreativeID","in":"path","description":"The ID of the Creative","schema":{"type":"integer","format":"int32"},"required":true},{"name":"sizeOverride","in":"query","description":"Add this to upload an image that is a different dimension than the creative's `adTypeId`","schema":{"type":"boolean"}},{"name":"fieldName","in":"query","description":"*(creative template creatives only)* Specifies which image field (of Type `File`) the file will be uploaded to. Can be used with single-image and multiple-image templates. If a template has only one image, `fieldName` is not required.","schema":{"type":"string"}}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"IsActive\": true,\n  \"ImageName\": \"b5983bd1e1e84a8980499668a8f76822.gif\",\n  \"SaveEmptyCreative\": null,\n  \"Body\": \"\",\n  \"IsNetworkAd\": null,\n  \"Alt\": null,\n  \"Title\": \"Hello World Creative\",\n  \"IsDeleted\": false,\n  \"IsSync\": null,\n  \"Url\": \"http://adzerk.com\",\n  \"IsIdOnly\": false,\n  \"IsNoTrack\": null,\n  \"TemplateValues\": null,\n  \"TemplateId\": null,\n  \"ImageLink\": \"http://s.zkcdn.net/Advertisers/b5983bd1e1e84a8980499668a8f76822.gif\",\n  \"ScriptBody\": \"\",\n  \"AdvertiserId\": 12345,\n  \"Metadata\": null,\n  \"AdTypeId\": 5,\n  \"IsHTMLJS\": false,\n  \"Id\": 12345\n}"}},"schema":{"type":"object","properties":{"IsActive":{"type":"boolean","example":true,"default":true},"ImageName":{"type":"string","example":"b5983bd1e1e84a8980499668a8f76822.gif"},"SaveEmptyCreative":{},"Body":{"type":"string","example":""},"IsNetworkAd":{},"Alt":{},"Title":{"type":"string","example":"Hello World Creative"},"IsDeleted":{"type":"boolean","example":false,"default":true},"IsSync":{},"Url":{"type":"string","example":"http://adzerk.com"},"IsIdOnly":{"type":"boolean","example":false,"default":true},"IsNoTrack":{},"TemplateValues":{},"TemplateId":{},"ImageLink":{"type":"string","example":"http://s.zkcdn.net/Advertisers/b5983bd1e1e84a8980499668a8f76822.gif"},"ScriptBody":{"type":"string","example":""},"AdvertiserId":{"type":"integer","example":12345,"default":0},"Metadata":{},"AdTypeId":{"type":"integer","example":5,"default":0},"IsHTMLJS":{"type":"boolean","example":false,"default":true},"Id":{"type":"integer","example":12345,"default":0}}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":"{\"message\":\"File missing from request.\"}\n\n{\"message\":\"AZERROR01: Incorrect image size for ad type\"}\n\n\nUsing the fieldName paramter:\n\n{\"message\":\"ThefieldNameparameter can only be used with custom template creatives.\"}\n\n{\"message\":\"The template of this creative does not have a field with the variable \\\"ctNope\\\".\"}\n\n{\"message\":\"The field \\\"ctStringy\\\" is not a file field.\"}\n\n{\"message\":\"You must specify the template field for your file upload via thefieldNameparameter.\"}"}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X POST -H \"X-Adzerk-ApiKey: <APIKEY>\" \"https://api.kevel.co/v1/creative/12345/upload\" -F \"image=@helloworld.gif\"\n\n## With size override:\ncurl -X POST -H \"X-Adzerk-ApiKey: <APIKEY>\" \"https://api.kevel.co/v1/creative/12345/upload?sizeOverride=true\" -F \"image=@helloworld.gif\"\n\n## With template field upload:\ncurl -X POST -H \"X-Adzerk-ApiKey: <APIKEY>\" \"https://api.kevel.co/v1/creative/12345/upload?fieldName=ctSponsorImage\" -F \"image=@helloworld.gif\""},{"language":"javascript","code":"const fetch = require('node-fetch');\nconst Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function uploadCreativeImage() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  // Style 1: Specify a file path\n  let creative = await client.run('creative', \"uploadImage\", {\n    id: 12345,\n    image: \"./adzerk-logo.png\",\n    sizeOverride: true,\n  });\n\n  console.log(creative);\n\n  // Style 2: Specify an image from memory\n  let response = await fetch('https://octodex.github.com/images/Fintechtocat.png');\n  let buffer = response.buffer();\n\n  let creative = await client.run('creative', 'uploadImage', {\n    id: 12345,\n    image: buffer,\n    sizeOverride: true,\n  });\n\n  console.log(creative);\n\n  // Style 3: Upload an image into a creative template field\n  let creative = await client.run('creative', 'uploadImage', {\n    id: 12345,\n    image: \"./adzerk-logo.png\",\n    fieldName: 'ctBannerImage',\n  });\n\n  console.log(creative);\n}\n\nuploadCreativeImage();"},{"language":"ruby","code":"require \"adzerk\"\n\n#\n# Creating a creative and uploading a creative image are bundled in the Ruby SDK!\n# \n\ndef upload_creative_image()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    data = {\n        title: \"Creative Name\",\n        is_active: true,\n        advertiser_id: 12345,\n        ad_type_id: 5,\n        url: \"https://www.adzerk.com\",\n        image_link: \"./adzerk-logo.png\"\n    }\n    pp client.creatives.create(data)\nend\nupload_creative_image()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/creative/{CreativeID}":{"put":{"summary":"Update Creative","description":"","operationId":"update-creative","parameters":[{"name":"CreativeID","in":"path","description":"The ID of the Creative","schema":{"type":"integer","format":"int32"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["Id","AdvertiserId","Title","IsActive","AdTypeID","Body"],"properties":{"Id":{"type":"integer","description":"The ID of the Creative","format":"int32"},"AdvertiserId":{"type":"integer","description":"The ID of the advertiser","format":"int32"},"Title":{"type":"string","description":"The name of the creative"},"IsActive":{"type":"boolean","description":"Whether it's active or not. Defaults to `null`","default":false},"AdTypeID":{"type":"integer","description":"The ad size's ID","format":"int32"},"Body":{"type":"string","description":"This is the body text associated with AdType 1 (in UI it's called \"Text\"). If you are NOT using AdType1, pass an empty string: \"\"."},"isDeleted":{"type":"boolean","description":"If want to delete, set to `true`"}}},"examples":{"JSON":{"value":{"Id":123,"AdvertiserId":123,"Body":"Test","Url":"https://adzerk.com","Title":"Adzerk Blue Creative","AdTypeId":5,"Alt":"Adzerk - Native Ads","IsActive":true,"IsDeleted":false}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"Id\":1234,\n  \"Title\":\"Test creative\",\n  \"ImageName\":\"somelongstring.jpg\",\n  \"Url\":\"https://adzerk.com\",\n  \"Body\":\"Test\",\n  \"AdvertiserId\":123,\n  \"IsActive\":true,\n  \"AdTypeId\":1,\n  \"Alt\":\"test\",\n  \"IsDeleted\":false,\n  \"IsSync\":null,\n  \"IsHTMLJS\": false,\n  \"Metadata\":\"JSON object as string\",\n  \"ImageLink\":\"https://somecdn.com/somelongstring.jpg\",\n  \"IsNoTrack\":true,\n  \"IsNetworkAd\":false\n}"}},"schema":{"type":"object","properties":{"Id":{"type":"integer","example":1234,"default":0},"Title":{"type":"string","example":"Test creative"},"ImageName":{"type":"string","example":"somelongstring.jpg"},"Url":{"type":"string","example":"https://adzerk.com"},"Body":{"type":"string","example":"Test"},"AdvertiserId":{"type":"integer","example":123,"default":0},"IsActive":{"type":"boolean","example":true,"default":true},"AdTypeId":{"type":"integer","example":1,"default":0},"Alt":{"type":"string","example":"test"},"IsDeleted":{"type":"boolean","example":false,"default":true},"IsSync":{},"IsHTMLJS":{"type":"boolean","example":false,"default":true},"Metadata":{"type":"string","example":"JSON object as string"},"ImageLink":{"type":"string","example":"https://somecdn.com/somelongstring.jpg"},"IsNoTrack":{"type":"boolean","example":true,"default":true},"IsNetworkAd":{"type":"boolean","example":false,"default":true}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"## Minimum viable update for non-image creatives:\ncurl -X PUT -H 'X-Adzerk-ApiKey:<API-KEY>' -H \"Content-Type:application/json\" \"https://api.kevel.co/v1/creative/123456\" --data-binary '{\"Id\":123456,\"AdvertiserId\":12345,\"AdTypeId\":5,\"Title\":\"Update Creative\",\"IsActive\":true}'\n\n## Minimum viable update for image creatives: \ncurl -X PUT -H 'X-Adzerk-ApiKey:<API-KEY>' -H \"Content-Type:application/json\" \"https://api.kevel.co/v1/creative/123456\" --data-binary '{\"Id\":123456,\"AdvertiserId\":12345,\"AdTypeId\":5,\"Title\":\"Update\",\"Body\":\"\",\"IsActive\":true,\"Url\":\"http://adzerk.com\",\"ImageName\":\"longstringofhex.jpg\"}'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function updateCreative() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let creative = await client.run(\"creative\", \"update\", {id: 12345, title: \"A Different Name\"});\n  console.log(creative);\n}\n\nupdateCreative();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef update_creative()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    creative_id = 12345\n    data = client.creatives.get(creative_id)\n    data[:title] = \"Updated Creative Name\"\n    pp client.creatives.update(data)\nend\nupdate_creative()"}],"samples-languages":["curl","javascript","ruby"]}},"get":{"summary":"Get Creative","description":"","operationId":"get-creative","parameters":[{"name":"CreativeID","in":"path","description":"The ID of the Creative","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"Id\":1234,\n  \"Title\":\"Adzerk Blue Creative\",\n  \"ImageName\":\"somelongstring.jpg\",\n  \"Url\":\"https://adzerk.com\",\n  \"Body\":\"\",\n  \"AdvertiserId\":123,\n  \"IsActive\":true,\n  \"AdTypeId\":5,\n  \"Alt\":\"Adzerk - Native Ads\",\n  \"IsDeleted\":false,\n  \"IsSync\":null,\n  \"IsHTMLJS\":true,\n  \"ScriptBody\": \"The Great API Content\",\n  \"Metadata\":JSON object as string,\n  \"ImageLink\":\"https://somecdn.com/somelongstring.jpg\",\n  \"IsNoTrack\":true,\n  \"IsNetworkAd\":false,\n  \"TemplateValues\": null,\n  \"TemplateId\": null\n  \"SaveEmptyCreative\": null\n}"}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:<APIKEY>\" \"https://api.kevel.co/v1/creative/123456\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function getCreative() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let creative = await client.run(\"creative\", \"get\", {id: 12345});\n  console.log(creative);\n}\n\ngetCreative();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef get_creative()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    creative_id = 12345\n    pp client.creatives.get(creative_id)\nend\nget_creative()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/advertiser/{AdvertiserID}/creatives":{"get":{"summary":"List Creatives For Advertiser","description":"This returns properties of all the creatives for a given advertiser based on the advertiser `id`.","operationId":"list-creatives","parameters":[{"name":"AdvertiserID","in":"path","description":"The ID of the Advertiser","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n    \"page\": 1,\n    \"items\": [\n        {\n            \"Id\": 123456,\n            \"Title\": \"Adzerk Blue Creative\",\n            \"ImageName\": \"somelongstring.jpg\",\n            \"Url\": \"https://adzerk.com\",\n            \"Body\": \"\",\n            \"AdvertiserId\": 123456,\n            \"IsActive\": true,\n            \"AdTypeId\": 5,\n            \"Alt\": \"Adzerk - Native Ads\",\n            \"IsDeleted\": false,\n            \"IsSync\": false,\n            \"IsHTMLJS\": true,\n            \"ScriptBody\": \"The Great API Content\",\n            \"ImageLink\": \"https://somecdn.com/somelongstring.jpg\",\n            \"Metadata\": \"JSON object as string\",\n            \"IsNoTrack\": true,\n            \"IsNetworkAd\": false\n        }\n      ]\n}"}},"schema":{"type":"object","properties":{"page":{"type":"integer","example":1,"default":0},"items":{"type":"array","items":{"type":"object","properties":{"Id":{"type":"integer","example":123456,"default":0},"Title":{"type":"string","example":"Adzerk Blue Creative"},"ImageName":{"type":"string","example":"somelongstring.jpg"},"Url":{"type":"string","example":"https://adzerk.com"},"Body":{"type":"string","example":""},"AdvertiserId":{"type":"integer","example":123456,"default":0},"IsActive":{"type":"boolean","example":true,"default":true},"AdTypeId":{"type":"integer","example":5,"default":0},"Alt":{"type":"string","example":"Adzerk - Native Ads"},"IsDeleted":{"type":"boolean","example":false,"default":true},"IsSync":{"type":"boolean","example":false,"default":true},"IsHTMLJS":{"type":"boolean","example":true,"default":true},"ScriptBody":{"type":"string","example":"The Great API Content"},"ImageLink":{"type":"string","example":"https://somecdn.com/somelongstring.jpg"},"Metadata":{"type":"string","example":"JSON object as string"},"IsNoTrack":{"type":"boolean","example":true,"default":true},"IsNetworkAd":{"type":"boolean","example":false,"default":true}}}}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/advertiser/12345/creatives\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function listCreativesForAdvertiser() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let creatives = await client.run(\"creative\", \"listForAdvertiser\", {id: 12345});\n  console.log(creatives);\n\n  let titles = creatives.items.map(a => a.title)\n  console.log(titles);\n}\n\nlistCreativesForAdvertiser();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef list_creatives_for_advertiser()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    advertiser_id = 12345\n    pp client.creatives.list(advertiser_id)\nend\nlist_creatives_for_advertiser()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/flight/{FlightID}/creatives":{"get":{"summary":"List Ads for Flight","description":"","operationId":"list-ads","parameters":[{"name":"FlightID","in":"path","description":"The ID of the Flight","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"page\": 1,\n  \"items\": [\n    {\n      \"Id\": 123456,\n      \"CampaignId\": 123456,\n      \"FlightId\": 123456,\n      \"ZoneId\": null,\n      \"SiteId\": null,\n      \"Impressions\": 100,\n      \"Percentage\": 0,\n      \"DistributionType\": 1,\n      \"IsDeleted\": false,\n      \"IsActive\": true,\n      \"Creative\": {\n        \"Id\": 12345,\n        \"Title\": \"Adzerk Blue Creative\",\n        \"ImageName\": \"\",\n        \"Url\": \"https://adzerk.com\",\n        \"Body\": \"\",\n        \"AdvertiserId\": 12345,\n        \"IsActive\": true,\n        \"AdTypeId\": 5,\n        \"Alt\": \"Adzerk - Native Ads\",\n        \"IsDeleted\": false,\n        \"IsSync\": false,\n        \"IsHTMLJS\": true,\n        \"ScriptBody\": \"JS or HTML content\",\n        \"Metadata\": \"{\\\"something\\\":true}\",\n        \"ImageLink\": \"httpss://static.adzerk.net/Advertisers/\",\n        \"IsNoTrack\": true,\n        \"IsNetworkAd\": false\n      },\n      \"CustomTargeting\": \"$keywords contains \\\"dean\\\"\",\n      \"FreqCap\": 5,\n      \"FreqCapDuration\": 1,\n      \"FreqCapType\": 2,\n      \"DontAffectParentFreqCap\": true,\n      \"StartDate\": null,\n      \"EndDate\": null,\n      \"StartDateISO\": \"2017-01-01T00:00:00.0000000\",\n      \"EndDateISO\": \"2015-12-05T00:00:00.0000000\",\n      \"GoalType\": 1,\n      \"Price\": 1,\n      \"IsGoalOverride\": true,\n      \"IsStartEndDateOverride\": true,\n      \"ActiveKeywords\": [\"kittens\",\"cats\"]\n    }\n  ]\n}"}},"schema":{"type":"object","properties":{"page":{"type":"integer","example":1,"default":0},"items":{"type":"array","items":{"type":"object","properties":{"Id":{"type":"integer","example":123456,"default":0},"CampaignId":{"type":"integer","example":123456,"default":0},"FlightId":{"type":"integer","example":123456,"default":0},"ZoneId":{},"SiteId":{},"Impressions":{"type":"integer","example":100,"default":0},"Percentage":{"type":"integer","example":0,"default":0},"DistributionType":{"type":"integer","example":1,"default":0},"IsDeleted":{"type":"boolean","example":false,"default":true},"IsActive":{"type":"boolean","example":true,"default":true},"Creative":{"type":"object","properties":{"Id":{"type":"integer","example":12345,"default":0},"Title":{"type":"string","example":"Adzerk Blue Creative"},"ImageName":{"type":"string","example":""},"Url":{"type":"string","example":"https://adzerk.com"},"Body":{"type":"string","example":""},"AdvertiserId":{"type":"integer","example":12345,"default":0},"IsActive":{"type":"boolean","example":true,"default":true},"AdTypeId":{"type":"integer","example":5,"default":0},"Alt":{"type":"string","example":"Adzerk - Native Ads"},"IsDeleted":{"type":"boolean","example":false,"default":true},"IsSync":{"type":"boolean","example":false,"default":true},"IsHTMLJS":{"type":"boolean","example":true,"default":true},"ScriptBody":{"type":"string","example":"JS or HTML content"},"Metadata":{"type":"string","example":"{\"something\":true}"},"ImageLink":{"type":"string","example":"httpss://static.adzerk.net/Advertisers/"},"IsNoTrack":{"type":"boolean","example":true,"default":true},"IsNetworkAd":{"type":"boolean","example":false,"default":true}}},"CustomTargeting":{"type":"string","example":"$keywords contains \"dean\""},"FreqCap":{"type":"integer","example":5,"default":0},"FreqCapDuration":{"type":"integer","example":1,"default":0},"FreqCapType":{"type":"integer","example":2,"default":0},"DontAffectParentFreqCap":{"type":"boolean","example":true,"default":true},"StartDate":{},"EndDate":{},"StartDateISO":{"type":"string","example":"2017-01-01T00:00:00.0000000"},"EndDateISO":{"type":"string","example":"2015-12-05T00:00:00.0000000"},"GoalType":{"type":"integer","example":1,"default":0},"Price":{"type":"integer","example":1,"default":0},"IsGoalOverride":{"type":"boolean","example":true,"default":true},"IsStartEndDateOverride":{"type":"boolean","example":true,"default":true},"ActiveKeywords":{"type":"array","items":{"type":"string","example":"kittens"}}}}}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:<APIKEY>\" \"https://api.kevel.co/v1/flight/12345/creatives\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function listAdsForFlight() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let list = await client.run('ad', 'listForFlight', { flightId: 12345 });\n  \n  // Print out the entire response\n  console.dir(list, {depth:null});\n}\n\nlistAdsForFlight();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef list_ads_for_flight()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    flight_id = 12345\n    pp client.ads.list(flight_id)\nend\nlist_ads_for_flight()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/ad/{AdID}":{"get":{"summary":"Get Ad","description":"","operationId":"get-ad-1","parameters":[{"name":"AdID","in":"path","description":"ID of the Ad / Creative Flight Map. This is not the ID from Create Creatives.","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"Id\": 1227159,\n  \"CampaignId\": 258367,\n  \"FlightId\": 616145,\n  \"ZoneId\": 12345,\n  \"SiteId\": 1234,\n  \"Iframe\": null,\n  \"Impressions\": 0,\n  \"Percentage\": 0,\n  \"DistributionType\": 1,\n  \"IsDeleted\": false,\n  \"IsActive\": false,\n  \"Creative\": {\n    \"Id\": 1163487,\n    \"Title\": \"Adzerk Blue Creative\",\n    \"ImageName\": \"\",\n    \"Url\": \"https://adzerk.com\",\n    \"Body\": \"\",\n    \"AdvertiserId\": 84825,\n    \"IsActive\": null,\n    \"AdTypeId\": 5,\n    \"Alt\": \"Adzerk - Native Ads\",\n    \"IsDeleted\": null,\n    \"IsSync\": null,\n    \"IsHTMLJS\": true,\n    \"ScriptBody\": \"this\",\n    \"Metadata\": null,\n    \"ImageLink\": \"httpss://static.adzerk.net/Advertisers/\",\n    \"IsNoTrack\": true,\n    \"IsNetworkAd\": false\n  },\n  \"CustomTargeting\": \"$keywords contains \\\"dean\\\"\",\n  \"FreqCap\": 5,\n  \"FreqCapDuration\": 1,\n  \"FreqCapType\": 2,\n  \"StartDate\": \"/Date(1430481600000)/\",\n  \"EndDate\": \"/Date(1430827200000)/\",\n  \"GoalType\": 1,\n  \"Goal\": 200000,\n  \"Price\": 1,\n  \"IsGoalOverride\": true,\n  \"IsStartEndDateOverride\": true,\n  \"ActiveKeywords\": [\"kittens\", \"cats\"],\n  \"RtbCustomFields\": null\n}"}},"schema":{"type":"object","properties":{"Id":{"type":"integer","example":1227159,"default":0},"CampaignId":{"type":"integer","example":258367,"default":0},"FlightId":{"type":"integer","example":616145,"default":0},"ZoneId":{"type":"integer","example":12345,"default":0},"SiteId":{"type":"integer","example":1234,"default":0},"Iframe":{},"Impressions":{"type":"integer","example":0,"default":0},"Percentage":{"type":"integer","example":0,"default":0},"DistributionType":{"type":"integer","example":1,"default":0},"IsDeleted":{"type":"boolean","example":false,"default":true},"IsActive":{"type":"boolean","example":false,"default":true},"Creative":{"type":"object","properties":{"Id":{"type":"integer","example":1163487,"default":0},"Title":{"type":"string","example":"Adzerk Blue Creative"},"ImageName":{"type":"string","example":""},"Url":{"type":"string","example":"https://adzerk.com"},"Body":{"type":"string","example":""},"AdvertiserId":{"type":"integer","example":84825,"default":0},"IsActive":{},"AdTypeId":{"type":"integer","example":5,"default":0},"Alt":{"type":"string","example":"Adzerk - Native Ads"},"IsDeleted":{},"IsSync":{},"IsHTMLJS":{"type":"boolean","example":true,"default":true},"ScriptBody":{"type":"string","example":"this"},"Metadata":{},"ImageLink":{"type":"string","example":"httpss://static.adzerk.net/Advertisers/"},"IsNoTrack":{"type":"boolean","example":true,"default":true},"IsNetworkAd":{"type":"boolean","example":false,"default":true}}},"CustomTargeting":{"type":"string","example":"$keywords contains \"dean\""},"FreqCap":{"type":"integer","example":5,"default":0},"FreqCapDuration":{"type":"integer","example":1,"default":0},"FreqCapType":{"type":"integer","example":2,"default":0},"StartDate":{"type":"string","example":"/Date(1430481600000)/"},"EndDate":{"type":"string","example":"/Date(1430827200000)/"},"GoalType":{"type":"integer","example":1,"default":0},"Goal":{"type":"integer","example":200000,"default":0},"Price":{"type":"integer","example":1,"default":0},"IsGoalOverride":{"type":"boolean","example":true,"default":true},"IsStartEndDateOverride":{"type":"boolean","example":true,"default":true},"ActiveKeywords":{"type":"array","items":{"type":"string","example":"kittens"}},"RtbCustomFields":{},"CategoryTargeting":{"type":"array","description":"The category targeting rules saved on the Ad itself, each with an `Id` and `IsExclude`. An Ad with no rules of its own uses its Flight's rules, and they do not appear here. 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":"curl -X GET -H 'X-Adzerk-ApiKey:<APIKEY>' \"https://api.kevel.co/v1/ad/123456\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function getAd() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let ad = await client.run('ad', 'get', {id: 12345});\n  console.log(ad);\n}\n\ngetAd();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef get_ad()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    ad_id = 12345\n    flight_id = 67890\n    pp client.ads.get(ad_id, flight_id)\nend\nget_ad()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/flight/{FlightID}/creative/{AdID}":{"get":{"summary":"Get Ad (Legacy)","description":"","operationId":"get-ad","parameters":[{"name":"FlightID","in":"path","description":"The ID of the Flight","schema":{"type":"integer","format":"int32"},"required":true},{"name":"AdID","in":"path","description":"ID of the Ad / Creative Flight Map. This is not the ID from Create Creatives.","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"Id\": 1227159,\n  \"CampaignId\": 258367,\n  \"FlightId\": 616145,\n  \"ZoneId\": 12345,\n  \"SiteId\": 1234,\n  \"Iframe\": null,\n  \"Impressions\": 0,\n  \"Percentage\": 0,\n  \"DistributionType\": 1,\n  \"IsDeleted\": false,\n  \"IsActive\": false,\n  \"Creative\": {\n    \"Id\": 1163487,\n    \"Title\": \"Adzerk Blue Creative\",\n    \"ImageName\": \"\",\n    \"Url\": \"https://adzerk.com\",\n    \"Body\": \"\",\n    \"AdvertiserId\": 84825,\n    \"IsActive\": null,\n    \"AdTypeId\": 5,\n    \"Alt\": \"Adzerk - Native Ads\",\n    \"IsDeleted\": null,\n    \"IsSync\": null,\n    \"IsHTMLJS\": true,\n    \"ScriptBody\": \"this\",\n    \"Metadata\": null,\n    \"ImageLink\": \"httpss://static.adzerk.net/Advertisers/\",\n    \"IsNoTrack\": true,\n    \"IsNetworkAd\": false\n  },\n  \"CustomTargeting\": \"$keywords contains \\\"dean\\\"\",\n  \"FreqCap\": 5,\n  \"FreqCapDuration\": 1,\n  \"FreqCapType\": 2,\n  \"StartDate\": \"/Date(1430481600000)/\",\n  \"EndDate\": \"/Date(1430827200000)/\",\n  \"GoalType\": 1,\n  \"Goal\": 200000,\n  \"Price\": 1,\n  \"IsGoalOverride\": true,\n  \"IsStartEndDateOverride\": true,\n  \"ActiveKeywords\": [\"kittens\", \"cats\"],\n  \"RtbCustomFields\": null\n}"}},"schema":{"type":"object","properties":{"Id":{"type":"integer","example":1227159,"default":0},"CampaignId":{"type":"integer","example":258367,"default":0},"FlightId":{"type":"integer","example":616145,"default":0},"ZoneId":{"type":"integer","example":12345,"default":0},"SiteId":{"type":"integer","example":1234,"default":0},"Iframe":{},"Impressions":{"type":"integer","example":0,"default":0},"Percentage":{"type":"integer","example":0,"default":0},"DistributionType":{"type":"integer","example":1,"default":0},"IsDeleted":{"type":"boolean","example":false,"default":true},"IsActive":{"type":"boolean","example":false,"default":true},"Creative":{"type":"object","properties":{"Id":{"type":"integer","example":1163487,"default":0},"Title":{"type":"string","example":"Adzerk Blue Creative"},"ImageName":{"type":"string","example":""},"Url":{"type":"string","example":"https://adzerk.com"},"Body":{"type":"string","example":""},"AdvertiserId":{"type":"integer","example":84825,"default":0},"IsActive":{},"AdTypeId":{"type":"integer","example":5,"default":0},"Alt":{"type":"string","example":"Adzerk - Native Ads"},"IsDeleted":{},"IsSync":{},"IsHTMLJS":{"type":"boolean","example":true,"default":true},"ScriptBody":{"type":"string","example":"this"},"Metadata":{},"ImageLink":{"type":"string","example":"httpss://static.adzerk.net/Advertisers/"},"IsNoTrack":{"type":"boolean","example":true,"default":true},"IsNetworkAd":{"type":"boolean","example":false,"default":true}}},"CustomTargeting":{"type":"string","example":"$keywords contains \"dean\""},"FreqCap":{"type":"integer","example":5,"default":0},"FreqCapDuration":{"type":"integer","example":1,"default":0},"FreqCapType":{"type":"integer","example":2,"default":0},"StartDate":{"type":"string","example":"/Date(1430481600000)/"},"EndDate":{"type":"string","example":"/Date(1430827200000)/"},"GoalType":{"type":"integer","example":1,"default":0},"Goal":{"type":"integer","example":200000,"default":0},"Price":{"type":"integer","example":1,"default":0},"IsGoalOverride":{"type":"boolean","example":true,"default":true},"IsStartEndDateOverride":{"type":"boolean","example":true,"default":true},"ActiveKeywords":{"type":"array","items":{"type":"string","example":"kittens"}},"RtbCustomFields":{},"CategoryTargeting":{"type":"array","description":"The category targeting rules saved on the Ad itself, each with an `Id` and `IsExclude`. An Ad with no rules of its own uses its Flight's rules, and they do not appear here. 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":"curl -X GET -H 'X-Adzerk-ApiKey:<APIKEY>' \"https://api.kevel.co/v1/flight/12345/creative/123456\""}],"samples-languages":["curl"]}}},"/v1/ad/{AdID}/tracking-urls":{"get":{"summary":"Get Ad Tracking Pixel and ClickURL","description":"","operationId":"get-ad-tracking-pixel-and-clickurl","parameters":[{"name":"AdID","in":"path","description":"The ad ID (or creative flight map). Note that this is not the creative ID.","schema":{"type":"integer","format":"int32"},"required":true},{"name":"siteid","in":"query","description":"The site in your network where the impression and/or click should be tracked. The site must be eligible to serve the ad (i.e. the ad's flight belongs to a channel the site is associated with).","required":true,"schema":{"type":"integer","format":"int32"}},{"name":"zoneid","in":"query","description":"An optional zone where the impression and/or click should be tracked. Must belong to the `siteid`.","schema":{"type":"integer","format":"int32"}},{"name":"keywords","in":"query","description":"A comma separated string of keywords, like `foo,bar,baz`, that will be tracked in reporting with the click and/or impression. Keywords must not contain [disallowed characters defined in the keyword documentation.](doc:keyword-targeting#keywords-and-special-characters)","schema":{"type":"string"}}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"Id\": 1234567,\n  \"StaticClickUrl\": \"https://e-1234.adzerk.net/r?e=eyJhdiI6MjMwNjIsImF0IjoyMCwiYnQiOjAsImNtIjo...&s=FOw8LAsm9ns2zM3THky6Dxvg0jc\",\n  \"ImpressionPixelUrl\": \"https://e-1234.adzerk.net/p/eyJhdiI6MjMwNjIsImF0.../i.gif\"\n}"}},"schema":{"type":"object","properties":{"Id":{"type":"integer","example":1234567,"default":0},"StaticClickUrl":{"type":"string","example":"https://e-1234.adzerk.net/r?e=eyJhdiI6MjMwNjIsImF0IjoyMCwiYnQiOjAsImNtIjo...&s=FOw8LAsm9ns2zM3THky6Dxvg0jc"},"ImpressionPixelUrl":{"type":"string","example":"https://e-1234.adzerk.net/p/eyJhdiI6MjMwNjIsImF0.../i.gif"}}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"message\": \"This ad is not active.\"\n}\n\n{\n  \"message\": \"This ad does not belong to your network.\"\n}\n\n{\n  \"message\": \"Site ID must be an integer.\"\n}\n\n{\n  \"message\": \"This site does not belong to your network.\"\n}\n\n{\n  \"message\": \"This site is not associated with a channel that includes this ad.\"\n}\n\n{\n  \"message\": \"Zone ID must be an integer.\"\n}\n\n{\n  \"message\": \"This zone does not belong to your network.\"\n}\n\n{\n  \"message\": \"This zone does not belong to this site.\"\n}\n\n{\n  \"message\": \"The keyword \\\":foo\\\" contains a character that is not allowed: ':'\"\n}\n\n{\n  \"message\": \"The keyword \\\" foo\\\" is invalid because it starts with whitespace.\"\n}"}}}}},"404":{"description":"404","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"message\": \"The tracking URLs you have requested are not available. This may indicate the Ad has not yet been fully published. Please retry your request based on the Retry-After header.\"\n}"}},"schema":{"type":"object","properties":{"message":{"type":"string","example":"The tracking URLs you have requested are not available. This may indicate the Ad has not yet been fully published. Please retry your request based on the Retry-After header."}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"## Requesting the ad for an eligible site:\ncurl -s -H \"X-Adzerk-ApiKey:<API-KEY>\" \"https://api.kevel.co/v1/ad/123456/tracking-urls?siteid=123456\"\n\n## Requesting the ad for a site, zone, and keywords:\ncurl -s -H \"X-Adzerk-ApiKey:<API-KEY>\" \"https://api.kevel.co/v1/ad/123456/tracking-urls?siteid=123456&zoneid=12345&keywords=foo,bar,baz\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function getTrackingUrls() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let urls = await client.run('ad', 'getTrackingUrls', {id: 12345, siteid: 67890});\n  console.log(urls);\n}\n\ngetTrackingUrls();"}],"samples-languages":["curl","javascript"]}}},"/v1/flight/{FlightID}/creative/{AdID}/delete":{"get":{"summary":"Delete Ad","description":"","operationId":"delete-ad","parameters":[{"name":"FlightID","in":"path","description":"ID of the Flight","schema":{"type":"integer","format":"int32"},"required":true},{"name":"AdID","in":"path","description":"ID of the Ad/ Creative Flight Map. This is not the ID from Create Creatives.","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"\"This creative map has been deleted\""}},"schema":{"type":"string","example":"This creative map has been deleted"}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H 'X-Adzerk-ApiKey:<APIKEY>' \"https://api.kevel.co/v1/flight/12345/creative/123456/delete\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function deleteAd() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let ad = await client.run('ad', 'delete', {\n    id: 12345,\n    flightId: 67890\n  });\n  console.log(ad);\n}\n\ndeleteAd();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef delete_ad()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    ad_id = 12345\n    flight_id = 67890\n    pp client.ads.delete(ad_id, 67890)\nend\ndelete_ad()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/ad":{"get":{"summary":"List Ads For Network","description":"","operationId":"list-ads-for-network","responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"page\": 1,\n  \"items\": [\n    {\n      \"Id\": 123456,\n      \"CampaignId\": 123456,\n      \"FlightId\": 123456,\n      \"ZoneId\": null,\n      \"SiteId\": null,\n      \"Impressions\": 100,\n      \"Percentage\": 0,\n      \"DistributionType\": 1,\n      \"IsDeleted\": false,\n      \"IsActive\": true,\n      \"Creative\": {\n        \"Id\": 12345,\n        \"Title\": \"Adzerk Blue Creative\",\n        \"ImageName\": \"\",\n        \"Url\": \"https://adzerk.com\",\n        \"Body\": \"\",\n        \"AdvertiserId\": 12345,\n        \"IsActive\": true,\n        \"AdTypeId\": 5,\n        \"Alt\": \"Adzerk - Native Ads\",\n        \"IsDeleted\": false,\n        \"IsSync\": false,\n        \"IsHTMLJS\": true,\n        \"ScriptBody\": \"JS or HTML content\",\n        \"Metadata\": \"{\\\"something\\\":true}\",\n        \"ImageLink\": \"httpss://static.adzerk.net/Advertisers/\",\n        \"IsNoTrack\": true,\n        \"IsNetworkAd\": false\n      },\n      \"CustomTargeting\": \"$keywords contains \\\"dean\\\"\",\n      \"FreqCap\": 5,\n      \"FreqCapDuration\": 1,\n      \"FreqCapType\": 2,\n      \"DontAffectParentFreqCap\": true,\n      \"StartDate\": null,\n      \"EndDate\": null,\n      \"StartDateISO\": \"2017-01-01T00:00:00.0000000\",\n      \"EndDateISO\": \"2015-12-05T00:00:00.0000000\",\n      \"GoalType\": 1,\n      \"Price\": 1,\n      \"IsGoalOverride\": true,\n      \"IsStartEndDateOverride\": true,\n      \"ActiveKeywords\": [\"kittens\",\"cats\"]\n    }\n  ]\n}"}},"schema":{"type":"object","properties":{"page":{"type":"integer","example":1,"default":0},"items":{"type":"array","items":{"type":"object","properties":{"Id":{"type":"integer","example":123456,"default":0},"CampaignId":{"type":"integer","example":123456,"default":0},"FlightId":{"type":"integer","example":123456,"default":0},"ZoneId":{},"SiteId":{},"Impressions":{"type":"integer","example":100,"default":0},"Percentage":{"type":"integer","example":0,"default":0},"DistributionType":{"type":"integer","example":1,"default":0},"IsDeleted":{"type":"boolean","example":false,"default":true},"IsActive":{"type":"boolean","example":true,"default":true},"Creative":{"type":"object","properties":{"Id":{"type":"integer","example":12345,"default":0},"Title":{"type":"string","example":"Adzerk Blue Creative"},"ImageName":{"type":"string","example":""},"Url":{"type":"string","example":"https://adzerk.com"},"Body":{"type":"string","example":""},"AdvertiserId":{"type":"integer","example":12345,"default":0},"IsActive":{"type":"boolean","example":true,"default":true},"AdTypeId":{"type":"integer","example":5,"default":0},"Alt":{"type":"string","example":"Adzerk - Native Ads"},"IsDeleted":{"type":"boolean","example":false,"default":true},"IsSync":{"type":"boolean","example":false,"default":true},"IsHTMLJS":{"type":"boolean","example":true,"default":true},"ScriptBody":{"type":"string","example":"JS or HTML content"},"Metadata":{"type":"string","example":"{\"something\":true}"},"ImageLink":{"type":"string","example":"httpss://static.adzerk.net/Advertisers/"},"IsNoTrack":{"type":"boolean","example":true,"default":true},"IsNetworkAd":{"type":"boolean","example":false,"default":true}}},"CustomTargeting":{"type":"string","example":"$keywords contains \"dean\""},"FreqCap":{"type":"integer","example":5,"default":0},"FreqCapDuration":{"type":"integer","example":1,"default":0},"FreqCapType":{"type":"integer","example":2,"default":0},"DontAffectParentFreqCap":{"type":"boolean","example":true,"default":true},"StartDate":{},"EndDate":{},"StartDateISO":{"type":"string","example":"2017-01-01T00:00:00.0000000"},"EndDateISO":{"type":"string","example":"2015-12-05T00:00:00.0000000"},"GoalType":{"type":"integer","example":1,"default":0},"Price":{"type":"integer","example":1,"default":0},"IsGoalOverride":{"type":"boolean","example":true,"default":true},"IsStartEndDateOverride":{"type":"boolean","example":true,"default":true},"ActiveKeywords":{"type":"array","items":{"type":"string","example":"kittens"}}}}}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:<APIKEY>\" \"https://api.kevel.co/v1/ad\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function listAdsForNetwork() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let ads = await client.run(\"ad\", \"listForNetwork\");\n  console.log(ads);\n}\nlistAdsForNetwork();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef list_ads_for_network()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    pp client.ads.list_for_network()\nend\nlist_ads_for_network()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/segment/":{"post":{"summary":"Create Segment","description":"","operationId":"create-segment","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["Name"],"properties":{"Name":{"type":"string","description":"The human-friendly name of the segment."},"Source":{"type":"string","description":"Where the segment came from."},"Reach":{"type":"object","description":"The estimated reach of the segment for all time and the last 4 weeks.","properties":{"all_time":{"type":"integer","format":"int32"},"28d":{"type":"integer","format":"int32"}}},"Description":{"type":"string","description":"An extended human-friendly description of the segment."},"Category":{"type":"string","description":"The category a segment belongs to."},"Advertisers":{"type":"array","items":{"properties":{"AdvertiserId":{"type":"integer","format":"int32"}},"type":"object"},"description":"A list of Advertisers that have access to the Segment."}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"Id\": 123456,\n  \"Source\": \"audience\",\n  \"Name\": \"best customers\",\n  \"Reach\": { \"all_time\": 3187463, \"28d\": 387434 },\n  \"Description\": \"top 1% spenders in the last 30 days.\",\n  \"Category\": \"CRM\",\n  \"IsDeleted\": false\n}\n"}},"schema":{"type":"object","properties":{"Id":{"type":"integer","example":123456,"default":0},"Source":{"type":"string","example":"audience"},"Name":{"type":"string","example":"best customers"},"Reach":{"type":"object","properties":{"all_time":{"type":"integer","example":3187463,"default":0},"28d":{"type":"integer","example":387434,"default":0}}},"Description":{"type":"string","example":"top 1% spenders in the last 30 days."},"Category":{"type":"string","example":"CRM"},"IsDeleted":{"type":"boolean","example":false,"default":true}}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X POST -H \"X-Adzerk-ApiKey:<APIKEY>\" -H \"Content-Type:application/json\" https://api.kevel.co/v1/segment --data-binary '{\"Category\":\"CRM\",\"Source\":\"audience\",\"Description\":\"top 1% spenders in the last 30 days.\",\"Reach\":\"{\"all_time\":3187463, \"28d\":387434}\",\"Name\":\"best customers\"}' "},{"language":"javascript","code":"// coming soon to @adzerk-management-sdk\nconst Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function createSegment() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let segment = await client.run(\"segment\", \"create\", {\n    name: \"best customers\",\n    source: \"audience\",\n    description: \"top 1% spenders in the last 30 days.\",\n  });\n\n  console.log(segment);\n}\n\ncreateSegment();"},{"language":"ruby","code":"## coming soon to @adzerk-management-sdk\nrequire \"adzerk\"\n\ndef create_segment()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    pp client.segment.create(name: \"best customers\", source: \"audience\", description: \"top 1% spenders in the last 30 days.\")\nend\ncreate_segment()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/segment/{SegmentId}":{"put":{"summary":"Update Segment","description":"","operationId":"update-segment","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"Name":{"type":"string","description":"The human-friendly name of the segment."},"Source":{"type":"string","description":"Where the segment came from."},"Reach":{"type":"object","description":"The estimated reach of the segment for all time and the last 4 weeks.","properties":{"all_time":{"type":"integer","format":"int32"},"28d":{"type":"integer","format":"int32"}}},"Description":{"type":"string","description":"An extended human-friendly description of the segment."},"Category":{"type":"string","description":"The category a segment belongs to."}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"Id\": 123456,\n  \"Source\": \"audience\",\n  \"Name\": \"Updated Name\",\n  \"Reach\": { \"all_time\": 3187463, \"28d\": 387434 },\n  \"Description\": \"top 1% spenders in the last 30 days.\",\n  \"Category\": \"CRM\",\n  \"IsDeleted\": false\n}"}},"schema":{"type":"object","properties":{"Id":{"type":"integer","example":123456,"default":0},"Source":{"type":"string","example":"audience"},"Name":{"type":"string","example":"Updated Name"},"Reach":{"type":"object","properties":{"all_time":{"type":"integer","example":3187463,"default":0},"28d":{"type":"integer","example":387434,"default":0}}},"Description":{"type":"string","example":"top 1% spenders in the last 30 days."},"Category":{"type":"string","example":"CRM"},"IsDeleted":{"type":"boolean","example":false,"default":true}}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X PUT -H \"X-Adzerk-ApiKey:<APIKEY>\" -H \"Content-Type:application/json\" https://api.kevel.co/v1/segment/{SegmentId} --data-binary '{\"Category\":\"CRM\",\"Source\":\"audience\",\"Description\":\"top 1% spenders in the last 30 days.\",\"Reach\":\"{\"all_time\":3187463, \"28d\":387434}\",\"Name\":\"Updated Name\",\"Id\":123456}'"},{"language":"javascript","code":"// coming soon to @adzerk-management-sdk\n\nconst Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function updateSegment() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\nlet segment = await client.run(\"segment\", \"update\", {\n\t\tid:123456,\n    name: \"updated name\",\n    source: \"audience,\n    description: \"top 1% spenders in the last 30 days.\",\n  });\n\n  console.log(segment);\n}\n\nupdateSegment();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef update_segment()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    pp client.segment.update(id: 123456, name: \"Updated Name\", source: \"audience\", description: \"top 1% spenders in the last 30 days.\")\nend\nupdate_segment()"}],"samples-languages":["curl","javascript","ruby"]}},"get":{"summary":"Get Segment","description":"","operationId":"get-segment","parameters":[{"name":"SegmentId","in":"path","description":"Id of the Segment","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"Id\": 123456,\n  \"Source\": \"audience\",\n  \"Name\": \"best customers\",\n  \"Reach\": { \"all_time\": 3187463, \"28d\": 387434 },\n  \"Description\": \"top 1% spenders in the last 30 days.\",\n  \"Category\": \"CRM\",\n  \"IsDeleted\": false\n}"}},"schema":{"type":"object","properties":{"Id":{"type":"integer","example":123456,"default":0},"Source":{"type":"string","example":"audience"},"Name":{"type":"string","example":"best customers"},"Reach":{"type":"object","properties":{"all_time":{"type":"integer","example":3187463,"default":0},"28d":{"type":"integer","example":387434,"default":0}}},"Description":{"type":"string","example":"top 1% spenders in the last 30 days."},"Category":{"type":"string","example":"CRM"},"IsDeleted":{"type":"boolean","example":false,"default":true}}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:<APIKEY>\"  \"https://api.kevel.co/v1/segment/{SegmentId}\""},{"language":"javascript","code":"// coming soon to @adzerk-management-sdk\n\nconst Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function getSegment() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let segment = await client.run('segment', 'get', {id: 12345});\n  console.log(segment);\n}\n\ngetSegment();"},{"language":"ruby","code":"## coming soon to @adzerk-management-sdk\n\nrequire \"adzerk\"\n\ndef get_segment()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    segment_id = 12345\n    pp client.segments.get(segment_id)\nend\nget_segment()"}],"samples-languages":["curl","javascript","ruby"]}},"delete":{"summary":"Delete Segment","description":"","operationId":"delete-segment","parameters":[{"name":"SegmentId","in":"path","description":"The Id of the Segment to delete","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"\"Successfully deleted.\""}},"schema":{"type":"string","example":"Successfully deleted."}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X DELETE -H \"X-Adzerk-ApiKey:<APIKEY>\" \"https://api.kevel.co/v1/segment/{SegmentId}\""},{"language":"javascript","code":"// coming soon to @adzerk-management-sdk\n\nconst Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function deleteSegment() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let segment = await client.run('segment', 'delete', {\n    id: 12345\n  });\n  console.log(segment);\n}\n\ndeleteSegment();"},{"language":"ruby","code":"## coming soon to @adzerk-management-sdk\n\nrequire \"adzerk\"\n\ndef delete_segment()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    segment_id = 12345\n    pp client.segments.delete(segment_id)\nend\ndelete_segment()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/segment":{"get":{"summary":"List Segments","description":"","operationId":"list-segments","responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"Id\": 123456,\n  \"Source\": \"audience\",\n  \"Name\": \"best customers\",\n  \"Reach\": { \"all_time\": 3187463, \"28d\": 387434 },\n  \"Description\": \"top 1% spenders in the last 30 days.\",\n  \"Category\": \"CRM\",\n  \"IsDeleted\": false\n}"}},"schema":{"type":"object","properties":{"Id":{"type":"integer","example":123456,"default":0},"Source":{"type":"string","example":"audience"},"Name":{"type":"string","example":"best customers"},"Reach":{"type":"object","properties":{"all_time":{"type":"integer","example":3187463,"default":0},"28d":{"type":"integer","example":387434,"default":0}}},"Description":{"type":"string","example":"top 1% spenders in the last 30 days."},"Category":{"type":"string","example":"CRM"},"IsDeleted":{"type":"boolean","example":false,"default":true}}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:<APIKEY>\" \"https://api.kevel.co/v1/segment\""},{"language":"javascript","code":"// coming soon to @adzerk-management-sdk\n\nconst Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function listSegment() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let segment = await client.run('segment', 'list');\n  console.log(segment);\n}\n\nlistSegment();"},{"language":"ruby","code":"## coming soon to @adzerk-management-sdk\n\nrequire \"adzerk\"\n\ndef list_segment()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    pp client.segments.list()\nend\nlist_segment()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/flight/{FlightId}/segmenttargeting":{"post":{"summary":"Create Flight Segment Targeting Rule","description":"Create a Flight to Segment targeting rule","operationId":"create-flight-segment","parameters":[{"name":"FlightId","in":"path","description":"The flight the targeting rule applies to","schema":{"type":"integer","format":"int32"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["SegmentId"],"properties":{"SegmentId":{"type":"integer","description":"Id of the Segment","format":"int32"},"IsExclude":{"type":"boolean","description":"Whether targeting is to be excluded or included.","default":false}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \t\"Id\": 56789,\n\t\t\"FlightId\": 55555,\n    \"SegmentId\": 123456,\n    \"IsExclude\": false,\n\t\t\"Segment\":\n        \t{\n\t\t\t\t\t\t\"Source\": \"audience\",\n  \t\t\t\t\t\"Name\": \"best customers\",\n  \t\t\t\t\t\"Reach\": { \"all_time\": 3187463, \"28d\": 387434 },\n  \t\t\t\t\t\"Description\": \"top 1% spenders in the last 30 days.\",\n  \t\t\t\t\t\"Category\": \"CRM\"\n\t\t\t\t\t}\n}"}},"schema":{"type":"object","properties":{"Id":{"type":"integer","example":56789,"default":0},"FlightId":{"type":"integer","example":55555,"default":0},"SegmentId":{"type":"integer","example":123456,"default":0},"IsExclude":{"type":"boolean","example":false,"default":"false"},"Segment":{"type":"object","properties":{"Source":{"type":"string","example":"audience"},"Name":{"type":"string","example":"best customers"},"Reach":{"type":"object","properties":{"all_time":{"type":"integer","example":3187463,"default":0},"28d":{"type":"integer","example":387434,"default":0}}},"Description":{"type":"string","example":"top 1% spenders in the last 30 days."},"Category":{"type":"string","example":"CRM"}}}}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X POST -H \"X-Adzerk-ApiKey:<APIKEY>\" -H \"Content-Type:application/json\" https://api.kevel.co/v1/flight/{FlightId}/segmenttargeting --data-binary '{\"SegmentId\":123456,\"IsExclude\":false}' "},{"language":"javascript","code":"// coming soon to @adzerk-management-sdk\n\nconst Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function createFlightSegment() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let targetingRule = await client.run(\"flightSegment\", \"create\", {\n    segmentId:123456,\n    isExclude: false\n  });\n\n  console.log(targetingRule);\n}\n\ncreateFlightSegment();"},{"language":"ruby","code":"## coming soon to @adzerk-management-sdk\n\nrequire \"adzerk\"\n\ndef create_flight_segment()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    pp client.flightSegment.create(segmentId: 123456, isExclude: false)\nend\ncreate_flight_segment()"}],"samples-languages":["curl","javascript","ruby"]}},"get":{"summary":"List Flight Segment Targeting Rules","description":"List all Segment targeting rules for a Flight","operationId":"list-flight-segments","parameters":[{"name":"FlightId","in":"path","description":"The flight the targeting rule applies to","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"page\":1,\n  \"items\": [\n\t\t\t{\n\t\t\t\t\"Id\": 56789,\n\t\t\t\t\"FlightId\": 55555,\n    \t\t\"SegmentId\": 123456,\n        \"IsExclude\": false,\n        \"Segment\":\n        \t{\n\t\t\t\t\t\t\"Source\": \"audience\",\n  \t\t\t\t\t\"Name\": \"best customers\",\n  \t\t\t\t\t\"Reach\": { \"all_time\": 3187463, \"28d\": 387434 },\n  \t\t\t\t\t\"Description\": \"top 1% spenders in the last 30 days.\",\n  \t\t\t\t\t\"Category\": \"CRM\"\n\t\t\t\t\t}\n\t\t\t}\n    ],\n    \"pageSize\":1,\n    \"totalPages\":1,\n\t\t\"totalItems\":1\n}"}},"schema":{"type":"object","properties":{"page":{"type":"integer","example":1,"default":0},"items":{"type":"array","items":{"type":"object","properties":{"Id":{"type":"integer","example":56789,"default":0},"FlightId":{"type":"integer","example":55555,"default":0},"SegmentId":{"type":"integer","example":123456,"default":0},"IsExclude":{"type":"boolean","example":false,"default":"false"},"Segment":{"type":"object","properties":{"Source":{"type":"string","example":"audience"},"Name":{"type":"string","example":"best customers"},"Reach":{"type":"object","properties":{"all_time":{"type":"integer","example":3187463,"default":0},"28d":{"type":"integer","example":387434,"default":0}}},"Description":{"type":"string","example":"top 1% spenders in the last 30 days."},"Category":{"type":"string","example":"CRM"}}}}}},"pageSize":{"type":"integer","example":1,"default":0},"totalPages":{"type":"integer","example":1,"default":0},"totalItems":{"type":"integer","example":1,"default":0}}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:<APIKEY>\" \"https://api.kevel.co/v1/flight/{FlightId}/segmenttargeting\" "},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function listFlightSegment() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let targetingRule = await client.run('flightSegment', 'list');\n  console.log(targetingRule);\n}\n\nlistFlightSegment();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef list_flight_segment()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    pp client.flight_segments.list()\nend\nlist_flight_segment()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/flight/{FlightId}/segmenttargeting/{Id}":{"delete":{"summary":"Delete Flight Segment Targeting Rule","description":"Delete a Flight Segment targeting rule","operationId":"delete-flight-segment","parameters":[{"name":"FlightId","in":"path","description":"The flight the targeting rule applies to","schema":{"type":"integer","format":"int32"},"required":true},{"name":"SegmentTargetingId","in":"path","description":"Id of the Flight Segment targeting rule","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"\"Successfully deleted.\""}},"schema":{"type":"string","example":"Successfully deleted."}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X DELETE -H \"X-Adzerk-ApiKey:<APIKEY>\" \"https://api.kevel.co/v1/flight/{FlightId}/segmenttargeting/{Id}\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function deleteFlightSegment() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let targetingRule = await client.run('flightSegment', 'delete', {\n    flight_id: 12345,\n\t\tid: 456789\n  });\n  console.log(flightSegment);\n}\n\ndeleteFlightSegment();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef delete_flight_segment()\n  \tclient = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n\t  flight_id = 6789\n    id = 12345\n    pp client.segments.delete(flight_id, id)\nend\ndelete_flight_segment()"}],"samples-languages":["curl","javascript","ruby"]}},"put":{"summary":"Update Flight Segment Targeting Rule","description":"Update a Flight to Segment targeting rule","operationId":"update-flight-segment","parameters":[{"name":"FlightId","in":"path","description":"The flight the targeting rule applies to","schema":{"type":"integer","format":"int32"},"required":true},{"name":"SegmentTargetingId","in":"path","description":"Id of the Flight Segment targeting rule","schema":{"type":"integer","format":"int32"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"IsExclude":{"type":"boolean","description":"Whether targeting is to be excluded or included.","default":false}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \t\"Id\": 56789,\n\t\t\"FlightId\": 55555,\n    \"SegmentId\": 123456,\n    \"IsExclude\": true,\n\t\t\"Segment\":\n        \t{\n\t\t\t\t\t\t\"Source\": \"audience\",\n  \t\t\t\t\t\"Name\": \"best customers\",\n  \t\t\t\t\t\"Reach\": { \"all_time\": 3187463, \"28d\": 387434 },\n  \t\t\t\t\t\"Description\": \"top 1% spenders in the last 30 days.\",\n  \t\t\t\t\t\"Category\": \"CRM\"\n\t\t\t\t\t}\n}"}},"schema":{"type":"object","properties":{"Id":{"type":"integer","example":56789,"default":0},"FlightId":{"type":"integer","example":55555,"default":0},"SegmentId":{"type":"integer","example":123456,"default":0},"IsExclude":{"type":"boolean","example":true,"default":"false"},"Segment":{"type":"object","properties":{"Source":{"type":"string","example":"audience"},"Name":{"type":"string","example":"best customers"},"Reach":{"type":"object","properties":{"all_time":{"type":"integer","example":3187463,"default":0},"28d":{"type":"integer","example":387434,"default":0}}},"Description":{"type":"string","example":"top 1% spenders in the last 30 days."},"Category":{"type":"string","example":"CRM"}}}}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X PUT -H \"X-Adzerk-ApiKey:<APIKEY>\" -H \"Content-Type:application/json\" https://api.kevel.co/v1/flight/{FlightId}/segmenttargeting/{Id} --data-binary '{\"IsExclude\":true}'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function updateFlightSegment() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let targetingRule = await client.run(\"flightSegment\", \"update\", {\n    isExclude: true,\n    flightId: 456789,\n\t\tid: 123456\n  });\n\n  console.log(targetingRule);\n}\n\nupdateFlightSegment();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef update_flight_segment()\n  client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n  flight_id = 456789\n  id = 123456\n  data = client.flightSegment.update(flight_id, id)\n  data[:is_exclude] = true\n  pp client.flightSegment.update(data)\nend \nupdate_flight_segment()"}],"samples-languages":["curl","javascript","ruby"]}},"get":{"summary":"Get Flight Segment Targeting Rule","description":"Get a Flight Segment targeting rule","operationId":"get-flight-segment","parameters":[{"name":"FlightId","in":"path","description":"The flight the targeting rule applies to","schema":{"type":"integer","format":"int32"},"required":true},{"name":"SegmentTargetingId","in":"path","description":"Id of the Flight Segment targeting rule","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n\t\t\"Id\": 56789,\n\t\t\"FlightId\": 55555,\n    \"SegmentId\": 123456,\n    \"IsExclude\": true,\n\t\t\"Segment\":\n        \t{\n\t\t\t\t\t\t\"Source\": \"audience\",\n  \t\t\t\t\t\"Name\": \"best customers\",\n  \t\t\t\t\t\"Reach\": { \"all_time\": 3187463, \"28d\": 387434 },\n  \t\t\t\t\t\"Description\": \"top 1% spenders in the last 30 days.\",\n  \t\t\t\t\t\"Category\": \"CRM\"\n\t\t\t\t\t}\t\n}"}},"schema":{"type":"object","properties":{"Id":{"type":"integer","example":56789,"default":0},"FlightId":{"type":"integer","example":55555,"default":0},"SegmentId":{"type":"integer","example":123456,"default":0},"IsExclude":{"type":"boolean","example":true,"default":"false"},"Segment":{"type":"object","properties":{"Source":{"type":"string","example":"audience"},"Name":{"type":"string","example":"best customers"},"Reach":{"type":"object","properties":{"all_time":{"type":"integer","example":3187463,"default":0},"28d":{"type":"integer","example":387434,"default":0}}},"Description":{"type":"string","example":"top 1% spenders in the last 30 days."},"Category":{"type":"string","example":"CRM"}}}}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:<APIKEY>\" \"https://api.kevel.co/v1/flight/{FlightId}/segmenttargeting/{Id}\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function getFlightSegment() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let targetingRule = await client.run(\"flightSegment\", \"get\", \n                      {flightId: 456789, id: 123456});\n\n  console.log(targetingRule);\n}\n\ngetFlightSegment();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef get_flight_segment()\n  client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n\t\tflight_id = 456789\n    segment_targeting_id = 12345\n    pp client.segments.get(flight_id, segment_targeting_id)\nend\nget_flight_segment()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/ad/{AdId}/segmenttargeting":{"post":{"summary":"Create Ad Segment Targeting Rule","description":"Create an Ad to Segment targeting rule","operationId":"create-ad-segment","parameters":[{"name":"AdId","in":"path","description":"The Ad the targeting rule applies to","schema":{"type":"integer","format":"int32"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["SegmentId"],"properties":{"SegmentId":{"type":"integer","description":"Id of the Segment","format":"int32"},"IsExclude":{"type":"boolean","description":"Whether targeting is to be excluded or included","default":false}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \t\"Id\": 56789,\n\t\t\"AdId\": 55555,\n    \"SegmentId\": 123456,\n    \"IsExclude\": false,\n\t\t\"Segment\":\n        \t{\n\t\t\t\t\t\t\"Source\": \"audience\",\n  \t\t\t\t\t\"Name\": \"best customers\",\n  \t\t\t\t\t\"Reach\": { \"all_time\": 3187463, \"28d\": 387434 },\n  \t\t\t\t\t\"Description\": \"top 1% spenders in the last 30 days.\",\n  \t\t\t\t\t\"Category\": \"CRM\"\n\t\t\t\t\t}\n}"}},"schema":{"type":"object","properties":{"Id":{"type":"integer","example":56789,"default":0},"AdId":{"type":"integer","example":55555,"default":0},"SegmentId":{"type":"integer","example":123456,"default":0},"IsExclude":{"type":"boolean","example":false,"default":"false"},"Segment":{"type":"object","properties":{"Source":{"type":"string","example":"audience"},"Name":{"type":"string","example":"best customers"},"Reach":{"type":"object","properties":{"all_time":{"type":"integer","example":3187463,"default":0},"28d":{"type":"integer","example":387434,"default":0}}},"Description":{"type":"string","example":"top 1% spenders in the last 30 days."},"Category":{"type":"string","example":"CRM"}}}}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X POST -H \"X-Adzerk-ApiKey:<APIKEY>\" -H \"Content-Type:application/json\" https://api.kevel.co/v1/ad/{AdId}/segmenttargeting --data-binary '{\"SegmentId\":123456,\"IsExclude\":false}'"},{"language":"javascript","code":"// coming soon to @adzerk-management-sdk\n\nconst Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function createAdSegment() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let targetingRule = await client.run(\"adSegment\", \"create\", {\n    segmentId:123456,\n    isExclude: false\n  });\n\n  console.log(targetingRule);\n}\n\ncreateAdSegment();"},{"language":"ruby","code":"## coming soon to @adzerk-management-sdk\n\nrequire \"adzerk\"\n\ndef create_ad_segment()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    pp client.adSegment.create(segmentId: 123456, isExclude: false)\nend\ncreate_ad_segment()"}],"samples-languages":["curl","javascript","ruby"]}},"get":{"summary":"List Ad Segment Targeting Rules","description":"List all Segment targeting rules for an Ad","operationId":"list-ad-segments","parameters":[{"name":"AdId","in":"path","description":"The Ad the targeting rule applies to","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"page\":1,\n  \"items\": [\n\t\t\t{\n\t\t\t\t\"Id\": 56789,\n\t\t\t\t\"AdId\": 55555,\n    \t\t\"SegmentId\": 123456,\n        \"IsExclude\": false,\n        \"Segment\":\n        \t{\n\t\t\t\t\t\t\"Source\": \"audience\",\n  \t\t\t\t\t\"Name\": \"best customers\",\n  \t\t\t\t\t\"Reach\": { \"all_time\": 3187463, \"28d\": 387434 },\n  \t\t\t\t\t\"Description\": \"top 1% spenders in the last 30 days.\",\n  \t\t\t\t\t\"Category\": \"CRM\"\n\t\t\t\t\t}\n\t\t\t}\n    ],\n    \"pageSize\":1,\n    \"totalPages\":1,\n\t\t\"totalItems\":1\n}"}},"schema":{"type":"object","properties":{"page":{"type":"integer","example":1,"default":0},"items":{"type":"array","items":{"type":"object","properties":{"Id":{"type":"integer","example":56789,"default":0},"AdId":{"type":"integer","example":55555,"default":0},"SegmentId":{"type":"integer","example":123456,"default":0},"IsExclude":{"type":"boolean","example":false,"default":"false"},"Segment":{"type":"object","properties":{"Source":{"type":"string","example":"audience"},"Name":{"type":"string","example":"best customers"},"Reach":{"type":"object","properties":{"all_time":{"type":"integer","example":3187463,"default":0},"28d":{"type":"integer","example":387434,"default":0}}},"Description":{"type":"string","example":"top 1% spenders in the last 30 days."},"Category":{"type":"string","example":"CRM"}}}}}},"pageSize":{"type":"integer","example":1,"default":0},"totalPages":{"type":"integer","example":1,"default":0},"totalItems":{"type":"integer","example":1,"default":0}}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:<APIKEY>\" \"https://api.kevel.co/v1/ad/{AdId}/segmenttargeting\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function listAdSegment() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let targetingRule = await client.run('adSegment', 'list');\n  console.log(targetingRule);\n}\n\nlistAdSegment();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef list_ad_segment()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    pp client.ad_segments.list()\nend\nlist_ad_segment()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/ad/{AdId}/segmenttargeting/{Id}":{"put":{"summary":"Update Ad Segment Targeting Rule","description":"Update an Ad to Segment targeting rule","operationId":"update-ad-segment","parameters":[{"name":"AdId","in":"path","description":"The Ad the targeting rule applies to","schema":{"type":"integer","format":"int32"},"required":true},{"name":"SegmentTargetingId","in":"path","description":"Id of the Ad Segment targeting rule","schema":{"type":"integer","format":"int32"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"IsExclude":{"type":"boolean","description":"Whether targeting is to be excluded or included.","default":false}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \t\"Id\": 56789,\n\t\t\"AdId\": 55555,\n    \"SegmentId\": 123456,\n    \"IsExclude\": true,\n\t\t\"Segment\":\n        \t{\n\t\t\t\t\t\t\"Source\": \"audience\",\n  \t\t\t\t\t\"Name\": \"best customers\",\n  \t\t\t\t\t\"Reach\": { \"all_time\": 3187463, \"28d\": 387434 },\n  \t\t\t\t\t\"Description\": \"top 1% spenders in the last 30 days.\",\n  \t\t\t\t\t\"Category\": \"CRM\"\n\t\t\t\t\t}\n}"}},"schema":{"type":"object","properties":{"Id":{"type":"integer","example":56789,"default":0},"AdId":{"type":"integer","example":55555,"default":0},"SegmentId":{"type":"integer","example":123456,"default":0},"IsExclude":{"type":"boolean","example":true,"default":"false"},"Segment":{"type":"object","properties":{"Source":{"type":"string","example":"audience"},"Name":{"type":"string","example":"best customers"},"Reach":{"type":"object","properties":{"all_time":{"type":"integer","example":3187463,"default":0},"28d":{"type":"integer","example":387434,"default":0}}},"Description":{"type":"string","example":"top 1% spenders in the last 30 days."},"Category":{"type":"string","example":"CRM"}}}}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X PUT -H \"X-Adzerk-ApiKey:<APIKEY>\" -H \"Content-Type:application/json\" https://api.kevel.co/v1/ad/{AdId}/segmenttargeting/{Id} --data-binary '{\"IsExclude\":true}'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function updateAdSegment() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let targetingRule = await client.run(\"adSegment\", \"update\", {\n    isExclude: true,\n    adId: 456789,\n\t\tid: 123456\n  });\n\n  console.log(targetingRule);\n}\n\nupdateAdSegment();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef update_ad_segment()\n  client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n  ad_id = 456789\n  id = 123456\n  data = client.adSegment.update(ad_id, id)\n  data[:is_exclude] = true\n  pp client.adSegment.update(data)\nend \nupdate_ad_segment()"}],"samples-languages":["curl","javascript","ruby"]}},"get":{"summary":"Get Ad Segment Targeting Rule","description":"Get a Flight Segment targeting rule","operationId":"get-ad-segment","parameters":[{"name":"AdId","in":"path","description":"The Ad the targeting rule applies to","schema":{"type":"integer","format":"int32"},"required":true},{"name":"SegmentTargetingId","in":"path","description":"Id of the Ad Segment targeting rule","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n\t\t\"Id\": 56789,\n\t\t\"FlightId\": 55555,\n    \"SegmentId\": 123456,\n\t\t\"IsExclude\": false,\n\t\t\"Segment\":\n        \t{\n\t\t\t\t\t\t\"Source\": \"audience\",\n  \t\t\t\t\t\"Name\": \"best customers\",\n  \t\t\t\t\t\"Reach\": { \"all_time\": 3187463, \"28d\": 387434 },\n  \t\t\t\t\t\"Description\": \"top 1% spenders in the last 30 days.\",\n  \t\t\t\t\t\"Category\": \"CRM\"\n\t\t\t\t\t}\n}"}},"schema":{"type":"object","properties":{"Id":{"type":"integer","example":56789,"default":0},"FlightId":{"type":"integer","example":55555,"default":0},"SegmentId":{"type":"integer","example":123456,"default":0},"IsExclude":{"type":"boolean","example":false,"default":"false"},"Segment":{"type":"object","properties":{"Source":{"type":"string","example":"audience"},"Name":{"type":"string","example":"best customers"},"Reach":{"type":"object","properties":{"all_time":{"type":"integer","example":3187463,"default":0},"28d":{"type":"integer","example":387434,"default":0}}},"Description":{"type":"string","example":"top 1% spenders in the last 30 days."},"Category":{"type":"string","example":"CRM"}}}}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:<APIKEY>\" \"https://api.kevel.co/v1/ad/{AdId}/segmenttargeting/{Id}\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function getAdSegment() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let targetingRule = await client.run(\"adSegment\", \"get\", \n                      {adId: 456789, id: 123456});\n\n  console.log(targetingRule);\n}\n\ngetAdSegment();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef get_ad_segment()\n  client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n\t\tad_id = 456789\n    segment_targeting_id = 12345\n    pp client.segments.get(ad_id, segment_targeting_id)\nend\nget_ad_segment()"}],"samples-languages":["curl","javascript","ruby"]}},"delete":{"summary":"Delete Ad Segment Targeting Rule","description":"Delete an Ad Segment targeting rule","operationId":"delete-ad-segment","parameters":[{"name":"AdId","in":"path","description":"The Ad the targeting rule applies to","schema":{"type":"integer","format":"int32"},"required":true},{"name":"SegmentTargetingId","in":"path","description":"Id of the Ad Segment targeting rule","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"\"Successfully deleted.\""}},"schema":{"type":"string","example":"Successfully deleted."}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X DELETE -H \"X-Adzerk-ApiKey:<APIKEY>\" \"https://api.kevel.co/v1/ad/{AdId}/segmenttargeting/{Id}\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function deleteAdSegment() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let targetingRule = await client.run('adSegment', 'delete', {\n    ad_id: 12345,\n\t\tid: 456789\n  });\n  console.log(adSegment);\n}\n\ndeleteAdSegment();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef delete_ad_segment()\n  \tclient = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n\t  ad_id = 6789\n    id = 12345\n    pp client.segments.delete(ad_id, id)\nend\ndelete_ad_segment()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/flight/{FlightID}/category":{"post":{"summary":"Create Flight Categories","description":"","operationId":"create-flight-categories","parameters":[{"name":"FlightID","in":"path","description":"ID of the Flight","schema":{"type":"integer","format":"int32"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["Name"],"properties":{"Name":{"type":"string","description":"The category's name"},"Id":{"type":"integer","description":"The category ID. If the category is new to your network, this field is optional","format":"int32"}}},"examples":{"JSON":{"value":{"Id":4567,"Name":"Sports"}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"Id\":4567,\n  \"Name\":\"Sports\"\n}"}},"schema":{"type":"object","properties":{"Id":{"type":"integer","example":4567,"default":0},"Name":{"type":"string","example":"Sports"}}}}}}},"x-readme":{"code-samples":[{"language":"curl","code":"## Creating a new category:\ncurl -X POST -H 'X-Adzerk-ApiKey:<APIKEY>' -H \"Content-Type:application/json\" \"https://api.kevel.co/v1/flight/12345/category\" --data-binary '{\"Name\":\"Sports\"}'\n\n## Linking an existing category to the flight:\ncurl -X POST -H 'X-Adzerk-ApiKey:<APIKEY>' -H \"Content-Type:application/json\" \"https://api.kevel.co/v1/flight/12345/category\" --data-binary '{\"Name:\"Sports\",\"Id\":4567}'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function createFlightCategory() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let flightCategory = await client.run(\"flightCategory\", \"create\", {\n    flightId: 12345,\n    name: \"Sports\"\n  });\n\n  console.log(flightCategory);\n}\n\ncreateFlightCategory();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef create_flight_category()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    flight_id = 12345\n    data = {\n        name: \"Test Flight Category\"\n    }\n    pp client.categories.create(flight_id, data)\nend\ncreate_flight_category()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/flight/{FlightID}/categories":{"get":{"summary":"List Flight Categories","description":"","operationId":"flight-categories-list","parameters":[{"name":"FlightID","in":"path","description":"The ID of the Flight","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"page\":1,\n  \"items\":[\n    {\n      \"Id\":123,\n      \"Name\":\"Sports\"\n    }\n    {\n      \"Id\":234,\n      \"Name\":\"Current Events\"\n    }\n  ]\n}"}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/flight/123456/categories\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function listFlightCategories() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let flightCategories = await client.run(\"flightCategory\", \"listForFlight\", {flightId: 12345});\n  console.log(flightCategories);\n\n  let names = flightCategories.items.map(a => a.name)\n  console.log(names);\n}\n\nlistFlightCategories();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef list_flight_categories()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    flight_id = 12345\n    pp client.categories.list(flight_id)\nend\nlist_flight_categories()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/categories":{"get":{"summary":"List Network Categories","description":"","operationId":"list-network-categories","responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n    \"page\": 1,\n    \"items\": [\n        {\n            \"Id\": 123,\n            \"Name\": \"Sports\"\n        },..."}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/categories\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function listNetworkFlightCategories() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let flightCategories = await client.run(\"flightCategory\", \"list\");\n  console.log(flightCategories);\n\n  let names = flightCategories.items.map(a => a.name)\n  console.log(names);\n}\n\nlistNetworkFlightCategories();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef list_network_flight_categories()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    pp client.categories.listAll()\nend\nlist_network_flight_categories()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/flight/{FlightID}/category/{FlightCategoryID}/delete":{"get":{"summary":"Delete Flight Category","description":"","operationId":"delete-category","parameters":[{"name":"FlightID","in":"path","description":"ID of the Flight","schema":{"type":"integer","format":"int32"},"required":true},{"name":"FlightCategoryID","in":"path","description":"ID of Flight Category. You can find this via the List Category endpoints, or in the response when you create a Flight Category.","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"\"Successfully Deleted\""}},"schema":{"type":"string","example":"Successfully Deleted"}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/flight/12345/category/123/delete\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function deleteFlightCategory() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let flightCategory = await client.run(\"flightCategory\", \"delete\", {flightId: 12345, id: 6789});\n  console.log(flightCategory);\n}\n\ndeleteFlightCategory();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef delete_flight_category()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    flight_id = 12345\n    category_id = 6789\n    pp client.categories.delete(flight_id, category_id)\nend\ndelete_flight_category()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/flight/{FlightID}/sitezonetargeting":{"post":{"summary":"Create Site/Zone Targeting","description":"","operationId":"create-sitezone-targeting","parameters":[{"name":"FlightID","in":"path","description":"ID of the Flight","schema":{"type":"integer","format":"int32"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"SiteId":{"type":"integer","description":"ID of the Site","format":"int32"},"ZoneId":{"type":"integer","description":"ID of the Zone","format":"int32"},"IsExclude":{"type":"boolean","description":"Whether targeting is to be excluded or included. Defaults to `false`, so if you leave this blank it'll target the site/zone.","default":"false"}}},"examples":{"JSON":{"value":{"FlightId":12345,"SiteId":678,"ZoneId":910,"IsExclude":false}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"Id\":98765,\n  \"FlightId\":12345,\n  \"SiteId\":678,\n  \"ZoneId\":910,\n  \"IsExclude\":false\n}"}},"schema":{"type":"object","properties":{"Id":{"type":"integer","example":98765,"default":0},"FlightId":{"type":"integer","example":12345,"default":0},"SiteId":{"type":"integer","example":678,"default":0},"ZoneId":{"type":"integer","example":910,"default":0},"IsExclude":{"type":"boolean","example":false,"default":"false"}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X POST -H 'X-Adzerk-ApiKey:<APIKEY>' -H \"Content-Type:application/json\" \"https://api.kevel.co/v1/flight/12345/sitezonetargeting\" --data-binary '{\"FlightId\":12345,\"SiteId\":678,\"ZoneId\":910,\"IsExclude\":false}'","name":"cURL"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function createSiteZoneTargeting() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let siteZoneTargeting = await client.run(\"siteZoneTargeting\", \"create\", {\n    flightId: 12345,\n    siteId: 678,\n    zoneId: 910,  // optional\n    isExclude: false, // defaults to false\n  });\n\n  console.log(siteZoneTargeting);\n}\n\ncreateSiteZoneTargeting();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef create_site_zone_targeting()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    flight_id = 123456\n    data = {\n        site_id: 67890,\n        zone_id: 54321, # optional\n        is_exclude: false # defaults to false\n    }\n    pp client.sitezonetargetings.create(flight_id, data)\nend\ncreate_site_zone_targeting()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/flight/{FlightID}/sitezonetargeting/{SiteZoneTargetingID}":{"put":{"summary":"Update Site/Zone Targeting","description":"","operationId":"update-sitezone-targeting","parameters":[{"name":"FlightID","in":"path","description":"The ID of the Flight","schema":{"type":"integer","format":"int32"},"required":true},{"name":"SiteZoneTargetingID","in":"path","description":"ID of the Site/Zone Targeting parameter. You can pull it through the Get Flight endpoint if don't have.","schema":{"type":"integer","format":"int32"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"SiteID":{"type":"integer","description":"ID of the Site","format":"int32"},"ZoneID":{"type":"integer","description":"ID of the Zone","format":"int32"},"isExclude":{"type":"boolean","description":"Whether you want to include or exclude","default":"false"}}},"examples":{"JSON":{"value":{"FlightId":12345,"SiteId":678,"ZoneId":910,"IsExclude":false}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"Id\":98765,\n  \"FlightId\":12345,\n  \"SiteId\":678,\n  \"ZoneId\":910,\n  \"IsExclude\":false\n}"}},"schema":{"type":"object","properties":{"Id":{"type":"integer","example":98765,"default":0},"FlightId":{"type":"integer","example":12345,"default":0},"SiteId":{"type":"integer","example":678,"default":0},"ZoneId":{"type":"integer","example":910,"default":0},"IsExclude":{"type":"boolean","example":false,"default":"false"}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X PUT -H 'X-Adzerk-ApiKey:<APIKEY>' -H \"Content-Type:application/json\" \"https://api.kevel.co/v1/flight/12345/sitezonetargeting/98765\" --data-binary '{\"FlightId\":12345,\"SiteId\":678,\"ZoneId\":910,\"IsExclude\":false}'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function updateSiteZoneTargeting() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let siteZoneTargeting = await client.run(\"siteZoneTargeting\", \"update\", {\n    id: 98765,\n    flightId: 12345,\n    isExclude: false,\n  });\n\n  console.log(siteZoneTargeting);\n}\n\nupdateSiteZoneTargeting();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef update_site_zone_targeting()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    flight_id = 123456\n    id = 987654\n    data = client.sitezonetargetings.get(flight_id, id)\n    data[:is_exclude] = true\n    pp client.sitezonetargetings.update(flight_id, id, data)\nend\nupdate_site_zone_targeting()"}],"samples-languages":["curl","javascript","ruby"]}},"get":{"summary":"Get Site/Zone Targeting","description":"","operationId":"get-sitezone-targeting","parameters":[{"name":"FlightID","in":"path","description":"ID of the Flight","schema":{"type":"integer","format":"int32"},"required":true},{"name":"SiteZoneTargetingID","in":"path","description":"ID of the Site Zone Targeting parameter. You can pull it through the Get Flight endpoint if don't have.","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"Id\":98765,\n  \"FlightId\":12345,\n  \"SiteId\":678,\n  \"ZoneId\":910,\n  \"IsExclude\":false\n}"}},"schema":{"type":"object","properties":{"Id":{"type":"integer","example":98765,"default":0},"FlightId":{"type":"integer","example":12345,"default":0},"SiteId":{"type":"integer","example":678,"default":0},"ZoneId":{"type":"integer","example":910,"default":0},"IsExclude":{"type":"boolean","example":false,"default":"false"}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H 'X-Adzerk-ApiKey:<APIKEY>' \"https://api.kevel.co/v1/flight/12345/sitezonetargeting/98765\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function getSiteZoneTargeting() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let siteZoneTargeting = await client.run(\"siteZoneTargeting\", \"get\", {\n    id: 98765,\n    flightId: 12345\n  });\n\n  console.log(siteZoneTargeting);\n}\n\ngetSiteZoneTargeting();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef get_site_zone_targeting()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    flight_id = 12345\n    id = 67890\n    pp client.sitezonetargetings.get(flight_id, id)\nend\nget_site_zone_targeting()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/flight/{FlightID}/sitezonetargeting/{SiteZoneTargetingID}/delete":{"get":{"summary":"Delete Site/Zone Targeting","description":"This removes site/zone targeting from a flight.","operationId":"delete-sitezone-targeting","parameters":[{"name":"FlightID","in":"path","description":"ID of the Flight","schema":{"type":"integer","format":"int32"},"required":true},{"name":"SiteZoneTargetingID","in":"path","description":"ID of the Site Zone Targeting parameter. You can pull it through the Get Flight endpoint if don't have.","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"\"Successfully Deleted\""}},"schema":{"type":"string","example":"Successfully Deleted"}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H 'X-Adzerk-ApiKey:<APIKEY>' \"https://api.kevel.co/v1/flight/12345/sitezonetargeting/98765/delete\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function deleteSiteZoneTargeting() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let response = await client.run(\"siteZoneTargeting\", \"delete\", {\n    id: 98765,\n    flightId: 12345\n  });\n\n  console.log(response);\n}\n\ndeleteSiteZoneTargeting();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef delete_site_zone_targeting()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    flight_id = 12345\n    id = 67890\n    pp client.sitezonetargetings.delete(flight_id, id)\nend\ndelete_site_zone_targeting()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/flight/{FlightID}/geotargeting":{"post":{"summary":"Create Geo-Targeting","description":"","operationId":"create-geo-targeting","parameters":[{"name":"FlightID","in":"path","description":"ID of the Flight","schema":{"type":"integer","format":"int32"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","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"}}},"examples":{"JSON":{"value":{"FlightId":12345,"CountryCode":"US","Region":"NC","MetroCode":560,"City":"Durham","CityGeonameId":4464368,"IsExclude":false}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"LocationId\":76543,\n  \"FlightId\":12345,\n  \"CountryCode\":\"US\",\n  \"Region\":\"NC\",\n  \"MetroCode\":560,\n  \"City\":\"Durham\",\n  \"CityGeonameId\":4464368,\n  \"IsExclude\":false\n}"}},"schema":{"type":"object","properties":{"LocationId":{"type":"integer","example":76543,"default":0},"FlightId":{"type":"integer","example":12345,"default":0},"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":"false"}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X POST -H 'X-Adzerk-ApiKey:<APIKEY>' -H \"Content-Type:application/json\" \"https://api.kevel.co/v1/flight/12345/geotargeting\" --data-binary '{\"FlightId\":12345,\"CountryCode\":\"US\",\"Region\":\"NC\",\"MetroCode\":560, \"IsExclude\":false}'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function createGeoTargeting() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let geoTargeting = await client.run(\"geoTargeting\", \"create\", {\n    flightId: 12345,\n    countryCode: \"US\",  // United States\n    region: \"NC\",       // North Carolina (optional)\n    metroCode: 560,     // Raleigh/Durham, NC (optional)\n    isExclude: false,   // target only this region, defaults to false\n  });\n\n  console.log(geoTargeting);\n}\n\ncreateGeoTargeting();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef create_geo_targeting()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    flight_id = 12345\n    data = {\n        country_code: \"US\", \n        region: \"NC\",      \n        is_exclude: false,\n    }\n    pp client.geotargetings.create(flight_id, data)\nend\ncreate_geo_targeting()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/flight/{FlightID}/geotargeting/{LocationID}":{"put":{"summary":"Update Geo-Targeting","description":"","operationId":"update-geo-targeting","parameters":[{"name":"FlightID","in":"path","description":"ID of the Flight","schema":{"type":"integer","format":"int32"},"required":true},{"name":"LocationID","in":"path","description":"ID from the Geo-Targeting Endpoint","schema":{"type":"integer","format":"int32"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","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 `true`, this will exclude the country from targeting. Defaults to `false/null`","default":"false"}}},"examples":{"JSON":{"value":{"FlightId":12345,"CountryCode":"US","Region":"NC","MetroCode":560,"City":"Durham","CityGeonameId":4464368,"IsExclude":false}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"LocationId\":76543,\n  \"FlightId\":12345,\n  \"CountryCode\":\"US\",\n  \"Region\":\"NC\",\n  \"MetroCode\":560,\n  \"City\":\"Durham\",\n  \"CityGeonameId\":4464368,\n  \"IsExclude\":false\n}"}},"schema":{"type":"object","properties":{"LocationId":{"type":"integer","example":76543,"default":0},"FlightId":{"type":"integer","example":12345,"default":0},"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":"false"}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X PUT -H 'X-Adzerk-ApiKey:<APIKEY>' -H \"Content-Type:application/json\" \"https://api.kevel.co/v1/flight/12345/geotargeting/76543\" --data-binary '{\"FlightId\":12345,\"CountryCode\":\"US\",\"Region\":\"NC\",\"MetroCode\":560, \"IsExclude\":true}'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function updateGeoTargeting() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let geoTargeting = await client.run(\"geoTargeting\", \"update\", {\n    locationId: 76543,\n    flightId: 12345,\n    countryCode: \"US\",  // United States\n    region: \"NC\",       // North Carolina\n  });\n\n  console.log(geoTargeting);\n}\n\nupdateGeoTargeting();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef update_geo_targeting()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    flight_id = 12345\n    location_id = 67890\n    data = client.geotargetings.get(flight_id, location_id)\n    data[:region] = \"MN\"\n    pp client.geotargetings.update(flight_id, location_id, data)\nend\nupdate_geo_targeting()"}],"samples-languages":["curl","javascript","ruby"]}},"get":{"summary":"Get Geo-Targeting","description":"","operationId":"get-geo-targeting","parameters":[{"name":"FlightID","in":"path","description":"ID of the Flight","schema":{"type":"integer","format":"int32"},"required":true},{"name":"LocationID","in":"path","description":"ID from the Geo-Targeting Endpoint","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"LocationId\":76543,\n  \"FlightId\":12345,\n  \"CountryCode\":\"US\",\n  \"Region\":\"NC\",\n  \"MetroCode\":560,\n  \"City\":\"Durham\",\n  \"CityGeonameId\":4464368,\n  \"IsExclude\":false\n}"}},"schema":{"type":"object","properties":{"LocationId":{"type":"integer","example":76543,"default":0},"FlightId":{"type":"integer","example":12345,"default":0},"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":"false"}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H 'X-Adzerk-ApiKey:<APIKEY>' \"https://api.kevel.co/v1/flight/12345/geotargeting/76543\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function getGeoTargeting() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let geoTargeting = await client.run(\"geoTargeting\", \"get\", {\n    locationId: 76544,\n    flightId: 12345,\n  });\n\n  console.log(geoTargeting);\n}\n\ngetGeoTargeting();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef get_geo_targeting()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    flight_id = 12345\n    location_id = 67890\n    pp client.geotargetings.get(flight_id, location_id)\nend\nget_geo_targeting()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/flight/{FlightID}/geotargeting/{LocationID}/delete":{"get":{"summary":"Delete Geo-Targeting","description":"","operationId":"delete-geo-targeting","parameters":[{"name":"FlightID","in":"path","description":"ID of the Flight","schema":{"type":"integer","format":"int32"},"required":true},{"name":"LocationID","in":"path","description":"ID from the Geo-Targeting Endpoint","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"\"Successfully Deleted\""}},"schema":{"type":"string","example":"Successfully Deleted"}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H 'X-Adzerk-ApiKey:<APIKEY>' \"https://api.kevel.co/v1/flight/12345/geotargeting/76543/delete\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function deleteGeoTargeting() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let response = await client.run(\"geoTargeting\", \"delete\", {\n    locationId: 76543,\n    flightId: 12345,\n  });\n\n  console.log(response);\n}\n\ndeleteGeoTargeting();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef delete_geo_targeting()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    flight_id = 12345\n    location_id = 67890\n    pp client.geotargetings.delete(flight_id, location_id)\nend\ndelete_geo_targeting()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/countries":{"get":{"summary":"List Countries","description":"","operationId":"list-geo-codes","responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"[\n  {\n    regions: {\n      'us:pa': {\n        countryCode: 'US',\n        metros: [Object],\n        name: 'Pennsylvania',\n        code: 'PA'\n      },\n      'us:ak': { countryCode: 'US', metros: [Object], name: 'Alaska', code: 'AK' },\n      'us:or': { countryCode: 'US', metros: [Object], name: 'Oregon', code: 'OR' },\n      'us:ky': {\n        countryCode: 'US',\n        metros: [Object],\n        name: 'Kentucky',\n        code: 'KY'\n      },\n      'us:mi': {\n        countryCode: 'US',\n        metros: [Object],\n        name: 'Michigan',\n        code: 'MI'\n      },\n      'us:wa': {\n        countryCode: 'US',\n        metros: [Object],\n        name: 'Washington',\n        code: 'WA'\n      },\n\n...."}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/countries\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function listCountries() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let countries = await client.run(\"geoTargeting\", \"listCountries\");\n\n  // Print out the entire response tree\n  console.dir(countries, {depth: null});\n\n  // Print mapping of country codes to names\n  let codesAndNames = countries.map(c => [c.code, c.name])\n  console.log(codesAndNames);\n}\n\nlistCountries();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef list_countries()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    pp client.flights.countries()\nend\nlist_countries()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/country/{CountryCode}/regions?version=2":{"get":{"summary":"List Regions in Country","description":"","operationId":"list-regions-in-country","parameters":[{"name":"CountryCode","in":"path","description":"The 2-3 character string that denotes the country you want to target","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  'us:pa': {\n    countryCode: 'US',\n    metros: {\n      '501': {\n        name: 'New York, NY',\n        code: '501',\n        regionCodes: [ 'NY', 'PA', 'CT', 'NJ' ]\n      },\n      '502': {\n        name: 'Binghamton, NY',\n        code: '502',\n        regionCodes: [ 'NY', 'PA' ]\n      },\n      '504': {\n        name: 'Philadelphia, PA',\n        code: '504',\n        regionCodes: [ 'PA', 'DE', 'MD', 'NJ' ]\n      },\n      '508': {\n        name: 'Pittsburgh, PA',\n        code: '508',\n        regionCodes: [ 'PA', 'MD', 'WV' ]\n      },\n      '511': {\n        name: 'Washington, DC (Hagerstown, MD)',\n        code: '511',\n        regionCodes: [ 'VA', 'PA', 'DC', 'MD', 'WV' ]\n      },\n      '514': { name: 'Buffalo, NY', code: '514', regionCodes: [ 'NY', 'PA' ] },\n      '516': { name: 'Erie, PA', code: '516', regionCodes: [ 'NY', 'PA' ] },\n      '536': {\n        name: 'Youngstown, OH',\n        code: '536',\n        regionCodes: [ 'PA', 'OH' ]\n      },\n      '554': {\n        name: 'Wheeling, WV-Steubenville, OH',\n        code: '554',\n        regionCodes: [ 'PA', 'WV', 'OH' ]\n      },\n      '565': { name: 'Elmira, NY', code: '565', regionCodes: [ 'NY', 'PA' ] },\n      '566': {\n        name: 'Harrisburg-Lancaster-Lebanon-York, PA',\n        code: '566',\n        regionCodes: [ 'PA', 'MD' ]\n      },\n      '574': {\n        name: 'Johnstown-Altoona, PA',\n        code: '574',\n        regionCodes: [ 'PA' ]\n      },\n      '577': {\n        name: 'Wilkes Barre-Scranton, PA',\n        code: '577',\n        regionCodes: [ 'NY', 'PA' ]\n      }\n    },\n    name: 'Pennsylvania',\n    code: 'PA'\n  },\n  'us:ak': {\n    countryCode: 'US',\n.....      "}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"## Returns regions in the United States (country code \"US\")\ncurl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/country/US/regions\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function listRegionsForCountry() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let response = await client.run(\"geoTargeting\", \"listRegionsForCountry\", {countryCode: \"US\"});\n  let regions = response.regions;\n\n  // Print out the entire response tree\n  console.dir(regions, {depth: null});\n\n  // Print mapping of region codes to names\n  let codesAndNames = Object.keys(regions).map(c => [regions[c].code, regions[c].name]);\n  console.log(codesAndNames);\n}\n\nlistRegionsForCountry();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef list_regions_for_country()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    country_code = \"US\"\n    pp client.flights.list_regions_for_country(country_code)\nend\nlist_regions_for_country()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/region/{RegionCode}":{"get":{"summary":"List Metro Codes in Region","description":"","operationId":"list-metro-codes-in-region","parameters":[{"name":"RegionCode","in":"path","description":"The 2-3 character string that denotes the region (or state) that you want to target","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"[\n  {\n    name: 'Greenville-New Bern-Washington, NC',\n    code: '545',\n    regionCodes: [ 'NC' ]\n  },\n  {\n    name: 'Greenville-Spartanburg, SC-Asheville, NC-Anderson, SC',\n    code: '567',\n    regionCodes: [ 'SC', 'TN', 'GA', 'NC' ]\n  },\n  {\n    name: 'Knoxville, TN',\n    code: '557',\n    regionCodes: [ 'TN', 'VA', 'KY', 'NC' ]\n  },\n  {\n    name: 'Norfolk-Portsmouth-Newport News,VA',\n    code: '544',\n    regionCodes: [ 'VA', 'NC' ]\n  },\n  {\n    name: 'Tri-Cities, TN-VA',\n    code: '531',\n    regionCodes: [ 'TN', 'VA', 'KY', 'NC' ]\n  },\n  {\n    name: 'Raleigh-Durham (Fayetteville), NC',\n    code: '560',\n    regionCodes: [ 'VA', 'NC' ]\n  },\n  {\n    name: 'Atlanta, GA',\n    code: '524',\n    regionCodes: [ 'GA', 'AL', 'NC' ]\n  },\n  {\n    name: 'Chattanooga, TN',\n    code: '575',\n    regionCodes: [ 'TN', 'GA', 'AL', 'NC' ]\n  },\n  {\n    name: 'Greensboro-High Point-Winston Salem, NC',\n    code: '518',\n    regionCodes: [ 'VA', 'NC' ]\n  },\n  {\n    name: 'Florence-Myrtle Beach, SC',\n    code: '570',\n    regionCodes: [ 'SC', 'NC' ]\n  },\n  { name: 'Wilmington, NC', code: '550', regionCodes: [ 'NC' ] },\n  { name: 'Charlotte, NC', code: '517', regionCodes: [ 'SC', 'NC' ] }\n]"}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"## Returns metro codes in North Carolina (region code \"NC\")\ncurl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/region/NC\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function listMetroCodesForRegion() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let metros = await client.run(\"geoTargeting\", \"listMetroCodesForRegion\", {\n    regionCode: \"NC\"\n  });\n\n  // Print out the entire response tree\n  console.dir(metros, {depth: null});\n\n  // Print mapping of metro codes to names\n  let codesAndNames = metros.map(m => [m.code, m.name]);\n  console.log(codesAndNames);\n}\n\nlistMetroCodesForRegion();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef list_metro_codes()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    region = \"MN\"\n    pp client.flights.regions(region)\nend\nlist_metro_codes()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/country/{CountryCode}/region/{RegionCode}/cities":{"get":{"summary":"List Cities in Region","description":"Returns the cities within a specific region, sorted by name. Requires a `CountryCode` and `RegionCode`. City-level coverage is strongest in the US and more limited in other countries.","operationId":"list-cities-in-region","parameters":[{"name":"CountryCode","in":"path","description":"The 2-3 character string that denotes the country used for geotargeting","schema":{"type":"string"},"required":true},{"name":"RegionCode","in":"path","description":"The 2-3 character string that denotes the region (or state, province etc.) used for geotargeting","schema":{"type":"string"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"[\n  {\n    \"Name\": \"Cary\",\n    \"CityGeonameId\": 4460162\n  },\n  {\n    \"Name\": \"Charlotte\",\n    \"CityGeonameId\": 4460243\n  },\n  {\n    \"Name\": \"Durham\",\n    \"CityGeonameId\": 4464368\n  },\n  {\n    \"Name\": \"Greensboro\",\n    \"CityGeonameId\": 4469146\n  },\n  {\n    \"Name\": \"Raleigh\",\n    \"CityGeonameId\": 4487042\n  }\n]"}},"schema":{"type":"array","items":{"type":"object","properties":{"Name":{"type":"string","example":"Cary"},"CityGeonameId":{"type":"integer","example":4460162}}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" https://api.adzerk.net/v1/country/US/region/NC/cities"}],"samples-languages":["curl"]}}},"/v1/flight/{FlightID}/distance":{"post":{"summary":"Create Distance Targeting Geometry","description":"","operationId":"create-geodistance-targeting-geometry","parameters":[{"name":"FlightID","in":"path","description":"The ID of the flight","schema":{"type":"integer","format":"int32"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"Distance":{"type":"number","description":"The radius of the Distance geometry in kilometers. Min: 0.01, Max: 500. Optional on networks with user-specified radius features enabled; omit for user-specified radius.","format":"float"},"Latitude":{"type":"number","description":"The latitude of the Distance point. Saved up to 7 decimal places. Cannot be used with `StreetAddress`.","format":"float"},"Longitude":{"type":"number","description":"The longitude of the Distance point. Saved up to 7 decimal places. Cannot be used with `StreetAddress`.","format":"float"},"StreetAddress":{"type":"string","description":"The street address of the Distance point. This will be resolved to latitude and longitude. Cannot be used with `Latitude` and `Longitude` params."}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"Distance\": 42,\n  \"StreetAddress\": \"1 Kevel Boulevard, Keveltown NC 27701\",\n  \"FlightId\": 12345,\n  \"Latitude\": 35.9950488,\n  \"Longitude\": -78.9081815,\n  \"Id\": 123\n}"}},"schema":{"type":"object","properties":{"Distance":{"type":"integer","example":42,"default":0},"StreetAddress":{"type":"string","example":"1 Kevel Boulevard, Keveltown NC 27701"},"FlightId":{"type":"integer","example":12345,"default":0},"Latitude":{"type":"number","example":35.9950488,"default":0},"Longitude":{"type":"number","example":-78.9081815,"default":0},"Id":{"type":"integer","example":123,"default":0}}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Unresolvable address":{"value":"{\n  \"Errors\": [\n    {\n      \"message\": \"Address cannot be resolved\",\n      \"values\": {\n        \"Distance\": 42,\n        \"StreetAddress\": \"bad address\",\n        \"FlightId\": 12345\n      }\n    }\n  ]\n}"},"Validation errors":{"value":"{\n  \"Errors\": [\n    {\n      \"path\": [\n        \"Latitude\"\n      ],\n      \"value\": 200,\n      \"message\": \"Value '200' at '[\\\"Latitude\\\"]' Decimal value must be <= 90.0.\"\n    },\n    {\n      \"path\": [\n        \"Longitude\"\n      ],\n      \"value\": 200,\n      \"message\": \"Value '200' at '[\\\"Longitude\\\"]' Decimal value must be <= 180.0.\"\n    },\n    {\n      \"path\": [\n        \"Distance\"\n      ],\n      \"value\": 700,\n      \"message\": \"Value '700' at '[\\\"Distance\\\"]' Decimal value must be <= 500.\"\n    }\n  ]\n}"},"Max geometries reached":{"value":"{\n  \"Errors\": [\n    {\n      \"message\": \"Error inserting Geometry\",\n      \"values\": {\n        \"Distance\": 42,\n        \"Latitude\": 35.9950488,\n        \"Longitude\": -78.9081815,\n        \"FlightId\": 12345,\n        \"StreetAddress\": \"1 Adzerk Boulevard, Adzerktown NC 27701\"\n      }\n    }\n  ]\n}"},"Bad JSON":{"value":"{\n  \"Errors\": \"Invalid JSON payload\"\n}"}},"schema":{"oneOf":[{"title":"Unresolvable address","type":"object","properties":{"Errors":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string","example":"Address cannot be resolved"},"values":{"type":"object","properties":{"Distance":{"type":"integer","example":42,"default":0},"StreetAddress":{"type":"string","example":"bad address"},"FlightId":{"type":"integer","example":12345,"default":0}}}}}}}},{"title":"Validation errors","type":"object","properties":{"Errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":"string","example":"Latitude"}},"value":{"type":"integer","example":200,"default":0},"message":{"type":"string","example":"Value '200' at '[\"Latitude\"]' Decimal value must be <= 90.0."}}}}}},{"title":"Max geometries reached","type":"object","properties":{"Errors":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string","example":"Error inserting Geometry"},"values":{"type":"object","properties":{"Distance":{"type":"integer","example":42,"default":0},"Latitude":{"type":"number","example":35.9950488,"default":0},"Longitude":{"type":"number","example":-78.9081815,"default":0},"FlightId":{"type":"integer","example":12345,"default":0},"StreetAddress":{"type":"string","example":"1 Adzerk Boulevard, Adzerktown NC 27701"}}}}}}}},{"title":"Bad JSON","type":"object","properties":{"Errors":{"type":"string","example":"Invalid JSON payload"}}}]}}}},"503":{"description":"503","content":{"application/json":{"examples":{"Geocoding unavailable":{"value":"{\n  \"Errors\": [\n    {\n      \"message\": \"Geocoding service unavailable\"\n    }\n  ]\n}"}},"schema":{"type":"object","properties":{"Errors":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string","example":"Geocoding service unavailable"}}}}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"## Using street address \n\ncurl -X POST -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" -H \"Content-Type:application/json\" https://api.kevel.co/v1/flight/12345/distance --data-binary '{\"Distance\":42.0,\"StreetAddress\":\"1 Kevel Boulevard, Keveltown NC 27701\"}'\n\n## Using longitude and latitude\n\ncurl -X POST -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" -H \"Content-Type:application/json\" https://api.kevel.co/v1/flight/12345/distance --data-binary '{\"Distance\":42.0,\"Latitude\":35.9950488,\"Longitude\":-78.9081815}'","name":"cURL"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\n// Using street address\n\nasync function createDistanceTargeting() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications, logger});\n\n  let distanceTargeting = await client.run('distanceTargeting', 'create', {\n    flightId: 12345,\n    distance: 42,\n    streetAddress: \"1 Kevel Boulevard, Keveltown NC 27701\"\n  });\n\n  console.log(distanceTargeting);\n}\ncreateDistanceTargeting()\n\n// Using longitude and latitude\n\nasync function createDistanceTargeting() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications, logger});\n\n  let distanceTargeting = await client.run('distanceTargeting', 'create', {\n    flightId: 12345,\n    distance: 42,\n    latitude: 35.9950488,\n    longitude: -78.9081815\n  });\n\n  console.log(distanceTargeting);\n}\ncreateDistanceTargeting()"},{"language":"ruby","code":"require \"adzerk\"\n\n# Using street address\n\ndef create_distance_targeting()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    flight_id = 12345\n    data = {\n        distance: 42,\n        street_address: \"1 Kevel Boulevard, Keveltown NC 27701\"\n    }\n    pp client.distance_targetings.create(flight_id, data)\nend\ncreate_distance_targeting()\n\n# Using longitude and latitude\n\ndef create_distance_targeting()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    flight_id = 12345\n    data = {\n        distance: 42,\n        latitude: 35.9950488,\n      \tlongitude: -78.9081815,\n    }\n    pp client.distance_targetings.create(flight_id, data)\nend\ncreate_distance_targeting()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/flight/{FlightID}/distance/batch":{"post":{"summary":"Batch Upload Distance Targeting Geometries","description":"","operationId":"batch-upload-geodistance-targeting-geometries","parameters":[{"name":"FlightID","in":"path","description":"The ID of the flight","schema":{"type":"integer","format":"int32"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["Geometries"],"properties":{"ReplaceExisting":{"type":"boolean","description":"Whether to replace any existing geometries on a flight. Defaults to false.","default":false},"Geometries":{"type":"array","description":"Must contain at least 0 geometry objects. If 1 or more objects are present, `Distance`, `Latitude`, and `Longitude` (float) are all required.","items":{"properties":{"Latitude":{"type":"number","description":"Latitude of the geometry","format":"float"},"Longitude":{"type":"number","description":"Longitude of the geometry","format":"float"},"Distance":{"type":"number","description":"Distance of the geometry","format":"float"}},"required":["Latitude","Longitude","Distance"],"type":"object"}}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"## Batch create/override\n\n{\n  \"InsertedGeometries\": 2\n}\n\n## Remove all geometries on the flight\n\n{\n  \"InsertedGeometries\": 0\n}"}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"## Batch create/override\n\ncurl -X POST -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" https://api.kevel.co/v1/flight/1234567/distance/batch -d '{\"ReplaceExisting\": false, \"Geometries\": [{\"Latitude\": -89.05, \"Longitude\": -170.1, \"Distance\": 5},{\"Latitude\": 14, \"Longitude\": 57.1, \"Distance\": 5}]}'\n\n## Remove all geometries on the flight\n\ncurl -X POST -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" https://api.kevel.co/v1/flight/1234567/distance/batch -d '{\"ReplaceExisting\": true, \"Geometries\": []}'\n","name":"cURL"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\n// Batch create/override\n\nasync function uploadBatchDistanceTargeting() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications, logger});\n\n  let distanceTargeting = await client.run(\"distanceTargeting\", \"batchUpload\", {\n    flightId: 12345,\n    replaceExisting: false,\n    geometries: [\n      {\n        Latitude: -89.05,\n        Longitude: 57.1,\n        Distance: 5\n      },\n      {\n        Latitude: 14,\n        Longitude: 57.1,\n        Distance: 5\n      }\n    ]\n  });\n\n  console.log(distanceTargeting);\n}\nuploadBatchDistanceTargeting()\n\n// Remove all geometries on the flight\n\nasync function removeAllDistanceTargeting() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications, logger});\n\n  let distanceTargeting = await client.run(\"distanceTargeting\", \"batchUpload\", {\n    flightId: 12345,\n    replaceExisting: true,\n    geometries: []\n  });\n\n  console.log(distanceTargeting);\n}\nremoveAllDistanceTargeting()"},{"language":"ruby","code":"require \"adzerk\"\n\n# Batch create/override\n\ndef upload_batch_distance_targeting()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    flight_id = 12345\n    data = {\n        replace_existing: false,\n        geometries: [\n            {\n                latitude: -89.05,\n                longitude: 57.1,\n                distance: 5\n            },\n            {\n                latitude: 14,\n                longitude: 57.1,\n                distance: 5\n            }\n        ]\n    }\n    pp client.distance_targetings.batch_upload(flight_id, data)\nend\nupload_batch_distance_targeting()\n\n# Remove all geometries on the flight\n\ndef remove_all_distance_targeting()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    flight_id = 12345\n    data = {\n        replace_existing: true,\n        geometries: []\n    }\n    pp client.distance_targetings.batch_upload(flight_id, data)\nend\nremove_all_distance_targeting()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/flight/{FlightID}/distance/{GeometryID}":{"put":{"summary":"Update Distance Targeting Geometry","description":"","operationId":"updates-geodistance-targeting-geometry","parameters":[{"name":"FlightID","in":"path","description":"The ID of the flight","schema":{"type":"integer","format":"int32"},"required":true},{"name":"GeometryID","in":"path","description":"The ID of the Distance Targeting geometry","schema":{"type":"integer","format":"int32"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"Distance":{"type":"number","description":"The radius of the Distance geometry in kilometers. Min: 0.01, Max: 500 Optional on networks withuser-specified radius features enabled; omit for user-specified radius.","format":"float"},"Latitude":{"type":"number","description":"The latitude of the Distance point. Saved up to 7 decimal places. Cannot be used with `StreetAddress`.","format":"float"},"Longitude":{"type":"number","description":"The longitude of the Distance point. Saved up to 7 decimal places. Cannot be used with `StreetAddress`.","format":"float"},"StreetAddress":{"type":"string","description":"The street address of the Distance point. This will be resolved to latitude and longitude. Cannot be used with `Latitude` and `Longitude` params."}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"Distance\": 42,\n  \"StreetAddress\": \"1 Kevel Boulevard, Keveltown NC 27701\",\n  \"FlightId\": 12345,\n  \"Latitude\": 35.9950488,\n  \"Longitude\": -78.9081815,\n  \"Id\": 123\n}"}},"schema":{"type":"object","properties":{"Distance":{"type":"integer","example":42,"default":0},"StreetAddress":{"type":"string","example":"1 Kevel Boulevard, Keveltown NC 27701"},"FlightId":{"type":"integer","example":12345,"default":0},"Latitude":{"type":"number","example":35.9950488,"default":0},"Longitude":{"type":"number","example":-78.9081815,"default":0},"Id":{"type":"integer","example":123,"default":0}}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Unresolvable address":{"value":"{\n  \"Errors\": [\n    {\n      \"message\": \"Address cannot be resolved\",\n      \"values\": {\n        \"Distance\": 42,\n        \"StreetAddress\": \"bad address\",\n        \"FlightId\": 12345\n      }\n    }\n  ]\n}"},"Validation errors":{"value":"{\n  \"Errors\": [\n    {\n      \"path\": [\n        \"Latitude\"\n      ],\n      \"value\": 200,\n      \"message\": \"Value '200' at '[\\\"Latitude\\\"]' Decimal value must be <= 90.0.\"\n    },\n    {\n      \"path\": [\n        \"Longitude\"\n      ],\n      \"value\": 200,\n      \"message\": \"Value '200' at '[\\\"Longitude\\\"]' Decimal value must be <= 180.0.\"\n    },\n    {\n      \"path\": [\n        \"Distance\"\n      ],\n      \"value\": 700,\n      \"message\": \"Value '700' at '[\\\"Distance\\\"]' Decimal value must be <= 500.\"\n    }\n  ]\n}"},"Max geometries reached":{"value":"{\n  \"Errors\": [\n    {\n      \"message\": \"Error inserting Geometry\",\n      \"values\": {\n        \"Distance\": 42,\n        \"Latitude\": 35.9950488,\n        \"Longitude\": -78.9081815,\n        \"FlightId\": 12345,\n        \"StreetAddress\": \"1 Adzerk Boulevard, Adzerktown NC 27701\"\n      }\n    }\n  ]\n}"},"Bad JSON":{"value":"{\n  \"Errors\": \"Invalid JSON payload\"\n}"}},"schema":{"oneOf":[{"title":"Unresolvable address","type":"object","properties":{"Errors":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string","example":"Address cannot be resolved"},"values":{"type":"object","properties":{"Distance":{"type":"integer","example":42,"default":0},"StreetAddress":{"type":"string","example":"bad address"},"FlightId":{"type":"integer","example":12345,"default":0}}}}}}}},{"title":"Validation errors","type":"object","properties":{"Errors":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"type":"string","example":"Latitude"}},"value":{"type":"integer","example":200,"default":0},"message":{"type":"string","example":"Value '200' at '[\"Latitude\"]' Decimal value must be <= 90.0."}}}}}},{"title":"Max geometries reached","type":"object","properties":{"Errors":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string","example":"Error inserting Geometry"},"values":{"type":"object","properties":{"Distance":{"type":"integer","example":42,"default":0},"Latitude":{"type":"number","example":35.9950488,"default":0},"Longitude":{"type":"number","example":-78.9081815,"default":0},"FlightId":{"type":"integer","example":12345,"default":0},"StreetAddress":{"type":"string","example":"1 Adzerk Boulevard, Adzerktown NC 27701"}}}}}}}},{"title":"Bad JSON","type":"object","properties":{"Errors":{"type":"string","example":"Invalid JSON payload"}}}]}}}},"503":{"description":"503","content":{"application/json":{"examples":{"Geocoding unavailable":{"value":"{\n  \"Errors\": [\n    {\n      \"message\": \"Geocoding service unavailable\"\n    }\n  ]\n}"}},"schema":{"type":"object","properties":{"Errors":{"type":"array","items":{"type":"object","properties":{"message":{"type":"string","example":"Geocoding service unavailable"}}}}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"## Using street address \n\ncurl -X PUT -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" -H \"Content-Type:application/json\" https://api.kevel.co/v1/flight/12345/distance/123 --data-binary '{\"Distance\":42.0,\"StreetAddress\":\"1 Adzerk Boulevard, Adzerktown NC 27701\"}'\n\n## Using longitude and latitude\n\ncurl -X PUT -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" -H \"Content-Type:application/json\" https://api.kevel.co/v1/flight/12345/distance/123 --data-binary '{\"Distance\":42.0,\"Latitude\":35.9950488,\"Longitude\":-78.9081815}'","name":"cURL"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\n// Using street address \n\nasync function updateDistanceTargeting() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications, logger});\n\n  let distanceTargeting = await client.run(\"distanceTargeting\", \"update\", {\n    flightId: 12345,\n    geometryId: 123,\n    distance: 42.0,\n    streetAddress: \"1 Adzerk Boulevard, Adzerktown NC 27701\"\n  });\n\n  console.log(distanceTargeting);\n}\nupdateDistanceTargeting()\n\n// Using longitude and latitude\n\nasync function updateDistanceTargeting() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications, logger});\n\n  let distanceTargeting = await client.run(\"distanceTargeting\", \"update\", {\n    flightId: 12345,\n    geometryId: 123,\n    distance: 42.0,\n    latitude: 35.9950488,\n    longitude: -78.9081815\n  });\n\n  console.log(distanceTargeting);\n}\nupdateDistanceTargeting()"},{"language":"ruby","code":"require \"adzerk\"\n\n# Using street address \n\ndef update_distance_targeting()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    flight_id = 12345\n    geometry_id = 123\n    data = {\n        distance: 42,\n        street_address: \"1 Kevel Boulevard, Keveltown NC 27701\"\n    }\n    pp client.distance_targetings.update(flight_id, geometry_id, data)\nend\nupdate_distance_targeting()\n\n# Using longitude and latitude\n\ndef update_distance_targeting()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    flight_id = 12345\n    geometry_id = 123\n    data = {\n        distance: 42,\n        latitude: 35.9950488,\n        longitude: -78.9081815\n    }\n    pp client.distance_targetings.update(flight_id, geometry_id, data)\nend\nupdate_distance_targeting()"}],"samples-languages":["curl","javascript","ruby"]}},"get":{"summary":"Get Distance Targeting Geometry","description":"","operationId":"get-geodistance-targeting-geometry","parameters":[{"name":"FlightID","in":"path","description":"The ID of the flight","schema":{"type":"integer","format":"int32"},"required":true},{"name":"GeometryID","in":"path","description":"The ID of the Distance Targeting geometry","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"Distance\": 42,\n  \"StreetAddress\": \"1 Kevel Boulevard, Keveltown NC 27701\",\n  \"FlightId\": 12345,\n  \"Latitude\": 35.9950488,\n  \"Longitude\": -78.9081815,\n  \"Id\": 123\n}"}},"schema":{"type":"object","properties":{"Distance":{"type":"integer","example":42,"default":0},"StreetAddress":{"type":"string","example":"1 Kevel Boulevard, Keveltown NC 27701"},"FlightId":{"type":"integer","example":12345,"default":0},"Latitude":{"type":"number","example":35.9950488,"default":0},"Longitude":{"type":"number","example":-78.9081815,"default":0},"Id":{"type":"integer","example":123,"default":0}}}}}},"400":{"description":"400","content":{"text/plain":{"examples":{"Not found":{"value":"{\n  \"message\": \"GeoDistance Targeting Geometry not found.\"\n}"}},"schema":{"type":"object","properties":{"message":{"type":"string","example":"GeoDistance Targeting Geometry not found."}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" https://api.kevel.co/v1/flight/12345/distance/1234 \n","name":"cURL"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function getDistanceTargeting() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications, logger});\n  \n  let distanceTargeting = await client.run(\"distanceTargeting\", \"get\", {\n    flightId: 12345,\n    geometryId: 123\n  });\n  \n  console.log(distanceTargeting);\n}\ngetDistanceTargeting()"},{"language":"ruby","code":"require \"adzerk\"\n\ndef get_distance_targeting()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    flight_id = 12345\n    geometry_id = 123\n    pp client.distance_targetings.get(flight_id, geometry_id)\nend\nget_distance_targeting()"}],"samples-languages":["curl","javascript","ruby"]}},"delete":{"summary":"Delete Distance Targeting Geometry","description":"","operationId":"delete-geodistance-targeting-geometry","parameters":[{"name":"FlightID","in":"path","description":"The ID of the flight","schema":{"type":"integer","format":"int32"},"required":true},{"name":"GeometryID","in":"path","description":"The ID of the Distance Targeting geometry","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"## No response body"}}}}},"400":{"description":"400","content":{"text/plain":{"examples":{"Not found":{"value":"{\n  \"message\": \"GeoDistance Targeting Geometry not found.\"\n}"}},"schema":{"type":"object","properties":{"message":{"type":"string","example":"GeoDistance Targeting Geometry not found."}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X DELETE -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" https://api.kevel.co/v1/flight/12345/distance/1234 \n","name":"cURL"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function deleteDistanceTargeting() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications, logger});\n\n  let distanceTargeting = await client.run(\"distanceTargeting\", \"delete\", {\n    flightId: 12345,\n    geometryId: 123\n  });\n    \n  console.log(distanceTargeting);\n}\ndeleteDistanceTargeting()"},{"language":"ruby","code":"require \"adzerk\"\n\ndef delete_distance_targeting()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    flight_id = 12345\n    geometry_id = 123\n    pp client.distance_targetings.delete(flight_id, geometry_id)\nend\ndelete_distance_targeting()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/flight/{FlightID}/distance/":{"get":{"summary":"List Distance Targeting Geometries","description":"","operationId":"list-geodistance-targeting-geometries","parameters":[{"name":"FlightID","in":"path","description":"The ID of the flight","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"[\n  {\n    \"Id\": 12345,\n    \"Latitude\": 35.99505,\n    \"Longitude\": -78.90818,\n    \"StreetAddress\": \"kevel\",\n    \"FlightId\": 1234567,\n    \"Distance\": 10\n  },\n  {\n    \"Id\": 12346,\n    \"Latitude\": 35.99505,\n    \"Longitude\": -78.90818,\n    \"StreetAddress\": \"kevel uk\",\n    \"FlightId\": 1234567,\n    \"Distance\": 10\n  },\n  {\n    \"Id\": 12347,\n    \"Latitude\": 35.99505,\n    \"Longitude\": -78.90818,\n    \"StreetAddress\": \"kevel san francisco\",\n    \"FlightId\": 1234567,\n    \"Distance\": 10\n  }\n]"}},"schema":{"type":"array","items":{"type":"object","properties":{"Id":{"type":"integer","example":12345,"default":0},"Latitude":{"type":"number","example":35.99505,"default":0},"Longitude":{"type":"number","example":-78.90818,"default":0},"StreetAddress":{"type":"string","example":"kevel"},"FlightId":{"type":"integer","example":1234567,"default":0},"Distance":{"type":"integer","example":10,"default":0}}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" https://api.kevel.co/v1/flight/12345/distance \n","name":"cURL"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function listDistanceTargeting() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications, logger});\n    \n  let distanceTargeting = await client.run(\"distanceTargeting\", \"list\", {\n    flightId: 12345\n  });\n    \n  console.log(distanceTargeting);\n}\nlistDistanceTargeting()"},{"language":"ruby","code":"require \"adzerk\"\n\ndef list_distance_targeting()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    flight_id = 12345\n    pp client.distance_targetings.list(flight_id)\nend\nlist_distance_targeting()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/priority":{"post":{"summary":"Create Priority","description":"This API call adds a new priority to a specific channel.","operationId":"create-priorities","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["Name","ChannelId","Weight","SelectionAlgorithm"],"properties":{"Name":{"type":"string","description":"The Priority's Name"},"ChannelId":{"type":"string","description":"The Channel's ID"},"Weight":{"type":"integer","description":"The priority order within the channel. 1-100, 1 is highest priority","format":"int32"},"SelectionAlgorithm":{"type":"integer","description":"Choose which selector the ad engines use to select an ad from this priority. Defaults to 0 (lottery). See below for the full list.","format":"int32"},"IsDeleted":{"type":"boolean","description":"Do not use if creating a Priority. Defaults to `false`","default":false},"FloorPrice":{"type":"number","description":"Sets a floor price for second-price auction priority","format":"float"},"FloorCPC":{"type":"number","description":"(BETA) Read only - Floor CPC if the Floor CPC feature is used on the priority. Contact Kevel support to get started","format":"float"},"IsSecondPricing":{"type":"boolean","description":"Whether flight uses second-price auction model"},"SecondPriceGroupBy":{"type":"string","description":"Sets whether ads in a second-priced auction should *not* second price against the same: `advertiser`, `campaign`, `flight`,  or `ad`. Default is `null`, which is equivalent to `advertiser`. Can only be set when `IsSecondPricing` is true","default":"null"},"PassbackTimeout":{"type":"integer","description":"Sets the timeout (in ms) for flights passing back in an adChain priority","format":"int32"},"RemainderPercentage":{"type":"integer","description":"Auctions and AdChain Optimized only. Refers to the percentage of impressions that ads with lower eCPMs will receive, which is used to give poor-perfoming ads a \"second-chance\".","format":"int32"}}},"examples":{"JSON":{"value":{"name":"High Priority","channelId":12345,"weight":10,"isDeleted":false,"selectionAlgorithm":1,"isSecondPricing":true,"floorPrice":1}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"id\":12345,\n  \"name\":\"High Priority\",\n  \"channelId\":1234,\n  \"weight\":10,\n  \"isDeleted\":false,\n  \"selectionAlgorithm\": 0\n}"}},"schema":{"type":"object","properties":{"id":{"type":"integer","example":12345,"default":0},"name":{"type":"string","example":"High Priority"},"channelId":{"type":"integer","example":1234,"default":0},"weight":{"type":"integer","example":10,"default":0},"isDeleted":{"type":"boolean","example":false,"default":true},"selectionAlgorithm":{"type":"integer","example":0,"default":0}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X POST -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" -H \"Content-Type:application/json\" \"https://api.kevel.co/v1/priority\" --data-binary '{\"Name\":\"High Priority\",\"ChannelId\":12345,\"Weight\":10,\"IsDeleted\":false,\"SelectionAlgorithm\":0}'","name":"cURL"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function createPriority() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let priority = await client.run(\"priority\", \"create\", {\n    name: \"High Priority\",\n    channelId: 51393,\n    weight: 100, //lowest weight\n    selectionAlgorithm: Adzerk.SelectionAlgorithm.Lottery,\n  });\n\n  console.log(priority);\n}\n\ncreatePriority();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef create_priority()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    data = {\n        name: \"Test Priority Name\",\n        channel_id: 12345,\n        weight: 100,\n        selection_algorithm: 0 # default\n    }\n    pp client.priorities.create(data)\nend\ncreate_priority()"}],"samples-languages":["curl","javascript","ruby"]}},"get":{"summary":"List Priorities","description":"This API call returns a list of all the priorities in the network, along with a list of priorities that belong to the \"Channel ID.\"","operationId":"list-priorities-1","responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n    \"page\": 1,\n    \"items\": [\n        {\n            \"id\": 98765,\n            \"name\": \"High Priority\",\n            \"channelId\": 12345,\n            \"weight\": 1,\n            \"isDeleted\": false\n        },\n        .....\n\t\t]\n}"}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/priority\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function listPriorities() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let priorities = await client.run(\"priority\", \"list\");\n  console.log(priorities);\n\n  let names = priorities.items.map(a => a.name)\n  console.log(names);\n}\n\nlistPriorities();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef list_priorities()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    pp client.priorities.list()\nend\nlist_priorities()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/priority/{PriorityID}":{"put":{"summary":"Update Priority","description":"This API call updates an existing priority using the Priority ID. The user is unable to update the PriorityID or the SelectionAlgorithm.","operationId":"update-priorities","parameters":[{"name":"priorityId","in":"path","description":"The Priority's ID","schema":{"type":"integer","format":"int32"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["id","channelId","name","weight"],"properties":{"id":{"type":"integer","description":"The Priority's ID","format":"int32"},"channelId":{"type":"integer","description":"The Channel's ID","format":"int32"},"name":{"type":"string","description":"Friendly name of Priority"},"weight":{"type":"integer","description":"The priority order within the channel. 1-100, 1 is highest priority","format":"int32"},"isDeleted":{"type":"boolean","description":"If want to delete, set to `true`"},"secondPriceGroupBy":{"type":"string","description":"Sets whether ads in a second-priced auction should *not* second price against the same: `advertiser`, `campaign`, `flight`,  or `ad`. Default is `null`, which is equivalent to `advertiser`. Can only be set when `IsSecondPricing` is true","default":"null"}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"id\":98765,\n  \"name\":\"High Priority\",\n  \"channelId\":12345,\n  \"weight\":10,\n  \"isDeleted\":false,\n  \"selectionAlgorithm\": 0\n}"}},"schema":{"type":"object","properties":{"id":{"type":"integer","example":98765,"default":0},"name":{"type":"string","example":"High Priority"},"channelId":{"type":"integer","example":12345,"default":0},"weight":{"type":"integer","example":10,"default":0},"isDeleted":{"type":"boolean","example":false,"default":true},"selectionAlgorithm":{"type":"integer","example":0,"default":0}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X PUT -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" -H \"Content-Type:application/json\" \"https://api.kevel.co/v1/priority/98765\" --data-binary '{\"Id\":98765,\"Name\":\"High Priority\",\"ChannelId\":12345,\"Weight\":11,\"IsDeleted\":\"false\"}'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function updatePriority() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let priority = await client.run(\"priority\", \"update\", {\n    id: 98765, \n    name: \"High Priority\"\n  });\n  console.log(priority);\n}\n\nupdatePriority();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef update_priority()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    priority_id = 12345\n    data = client.priorities.get(priority_id)\n    data[:name] = \"Updated Name\"\n    pp client.priorities.update(data)\nend\nupdate_priority()"}],"samples-languages":["curl","javascript","ruby"]}},"get":{"summary":"Get Priority","description":"This API call returns properties for a specific priority. No parameters are needed as long as the \"Priority ID\" is in the URL.","operationId":"get-priorities","parameters":[{"name":"priorityId","in":"path","description":"The Priority's ID","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"id\":98765,\n  \"name\":\"High Priority\",\n  \"channelId\":12345,\n  \"weight\":10,\n  \"isDeleted\":false,\n  \"selectionAlgorithm\": 0,\n  \"isSecondPricing\":null,\n  \"floorPrice\":null\n}"}},"schema":{"type":"object","properties":{"id":{"type":"integer","example":98765,"default":0},"name":{"type":"string","example":"High Priority"},"channelId":{"type":"integer","example":12345,"default":0},"weight":{"type":"integer","example":10,"default":0},"isDeleted":{"type":"boolean","example":false,"default":true},"selectionAlgorithm":{"type":"integer","example":0,"default":0},"isSecondPricing":{},"floorPrice":{}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/priority/98765\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function getPriority() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let priority = await client.run(\"priority\", \"get\", {id: 98765});\n  console.log(priority);\n}\n\ngetPriority();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef get_priority()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    priority_id = 12345\n    pp client.priorities.get(priority_id)\nend\nget_priority()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/priority/{PriorityID}/delete":{"get":{"summary":"Delete Priority","description":"This API call removes an existing priority from the channel. No parameters are needed, except \"Priority ID\" in URL.","operationId":"delete-priority","parameters":[{"name":"priorityId","in":"path","description":"The Priority's ID","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"\"Successfully deleted\""}},"schema":{"type":"string","example":"Successfully deleted"}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/priority/98765/delete\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function deletePriority() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let response = await client.run(\"priority\", \"delete\", {id: 98765});\n  console.log(response);\n}\n\ndeletePriority();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef delete_priority()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    priority_id = 12345\n    pp client.priorities.delete(priority_id)\nend\ndelete_priority()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v2/creative-templates":{"post":{"summary":"Create Creative Template","description":"","operationId":"create-creative-template","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["Name","Description"],"properties":{"Name":{"type":"string","description":"The friendly name of the creative template, visible in the UI. Must be 50 characters or less"},"Description":{"type":"string","description":"A *short* description of a template, visible in the UI. Best used as a version number. Must be 100 characters or less"},"IsArchived":{"type":"boolean","description":"If true, archives the creative template. Defaults to `false`.","default":false},"Fields":{"type":"array","description":"Sets the creative template Fields. Requires zero or more objects. See above for more details."},"Contents":{"type":"array","description":"Sets the creative template Contents. Requires zero or more objects. See above for more details."}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{  \n  \"Id\":12345,\n  \"Description\": \"Template Description\",\n  \"Name\": \"Template Name v1\",\n  \"IsArchived\": false,\n  \"Fields\": [\n    {\n      \"Name\": \"Title\",\n      \"Description\": \"The Template Title\",\n      \"Type\": \"String\",\n      \"Variable\": \"ctTitle\",\n      \"Required\": true,\n      \"AdQuery\": false\n    },\n    {\n      \"Name\": \"Thumbnail\",\n      \"Description\": \"The URL of a Thumbnail Image\",\n      \"Type\": \"String\",\n      \"Variable\": \"ctThumbnailUrl\",\n      \"Required\": false,\n      \"AdQuery\": true\n    }\n  ],\n  \"Contents\": [\n    {\n      \"Type\": \"Raw\",\n      \"Body\": \"{\\\"title\\\": \\\"{{ctTitle}\\\", \\\"thumbnailUrl\\\": \\\"{{ctThumbnailUrl}}\\\" }\"\n    }\n  ]\n}"}},"schema":{"type":"object","properties":{"Id":{"type":"integer","example":12345,"default":0},"Description":{"type":"string","example":"Template Description"},"Name":{"type":"string","example":"Template Name v1"},"IsArchived":{"type":"boolean","example":false,"default":true},"Fields":{"type":"array","items":{"type":"object","properties":{"Name":{"type":"string","example":"Title"},"Description":{"type":"string","example":"The Template Title"},"Type":{"type":"string","example":"String"},"Variable":{"type":"string","example":"ctTitle"},"Required":{"type":"boolean","example":true,"default":true},"AdQuery":{"type":"boolean","example":false,"default":true}}}},"Contents":{"type":"array","items":{"type":"object","properties":{"Type":{"type":"string","example":"Raw"},"Body":{"type":"string","example":"{\"title\": \"{{ctTitle}\", \"thumbnailUrl\": \"{{ctThumbnailUrl}}\" }"}}}}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X POST -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" -H \"Content-Type: application/json\" -d '{\"Description\":\"Template Description\",\"Name\":\"Template Name v1\",\"IsArchived\":false,\"Fields\":[{\"Name\":\"Title\",\"Description\":\"The Template Title\",\"Type\":\"String\",\"Variable\":\"ctTitle\",\"Required\":true,\"AdQuery\":false},{\"Name\":\"Thumbnail\",\"Description\":\"The URL of a Thumbnail Image\",\"Type\":\"String\",\"Variable\":\"ctThumbnailUrl\",\"Required\":false,\"AdQuery\":true}],\"Contents\":[{\"Type\":\"Raw\",\"Body\":\"{\\\"title\\\":\\\"{{ctTitle}}\\\",\\\"thumbnailUrl\\\":\\\"{{ctThumbnailUrl}}\\\"}\"}]}' \"https://api.kevel.co/v2/creative-templates\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function createCreativeTemplate() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let creativeTemplate = await client.run('creativeTemplate', 'create', {\n    description: 'Template Description',\n    name: 'Template Name v1', // TIP: include version in name\n    isArchived: false,\n    fields: [{\n      name: 'Title',\n      description: 'The Template Title',\n      type: 'String',\n      variable: 'ctTitle',\n      required: true,\n      adQuery: false,\n    }, {\n      name: 'Thumbnail',\n      description: 'The URL of a Thumbnail Image',\n      type: 'String',\n      variable: 'ctThumbnailUrl',\n      required: false,\n      adQuery: true\n    }],\n    contents: [{\n      type: 'Raw', // Use \"Raw\" for JSON payloads\n      body: '{\"title\": \"{{ctTitle}}\", \"thumbnailUrl\": \"{{ctThumbnailUrl}}\" }'\n    }],\n  });\n  console.log(creativeTemplate);\n}\n\ncreateCreativeTemplate();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef create_creative_template()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    data = {\n        description: 'Template Description',\n        name: 'Template Name v3', # TIP: include version in name\n        is_archived: false,\n        fields: [{\n            name: 'Title',\n            description: 'The Template Title',\n            type: 'String',\n            variable: 'ctTitle',\n            required: true,\n          \tad_query: false,\n        },\n        {\n            name: 'Thumbnail',\n            description: 'The URL of a Thumbnail Image',\n            type: 'String',\n            variable: 'ctThumbnailUrl',\n            required: false,\n          \tad_query: true,\n        }],\n        contents: [{\n            type: 'Raw',  # Use \"Raw\" for JSON payloads\n            body: '{\"title\": \"{{ctTitle}}\", \"thumbnailUrl\": \"{{ctThumbnailUrl}}\" }'\n        }]\n    }\n    pp client.creative_templates.create(data)\nend\ncreate_creative_template()"}],"samples-languages":["curl","javascript","ruby"]}},"get":{"summary":"List Creative Templates","description":"This endpoint lists the creative templates in your network.","operationId":"list-creative-templates-1","parameters":[{"name":"page","in":"query","description":"Which page to view. Defaults to `1`.","schema":{"type":"integer","format":"int32","default":1}},{"name":"pageSize","in":"query","description":"The number of creative template objects per page. Max is 500. Defaults to `10`.","schema":{"type":"integer","format":"int32","default":10}},{"name":"includeArchived","in":"query","description":"If true, include archived creative templates. Defaults to `false`.","schema":{"type":"boolean","default":false}}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"page\": 1,\n  \"items\": [\n    {\n      \"Id\":12345,\n      .....\n    }\n  ]\n}"}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\"  \"https://api.kevel.co/v2/creative-templates?page=1&pageSize=50&includeArchived=true"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function listCreativeTemplates() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let list = await client.run('creativeTemplate', 'list');\n  console.log(list);\n}\n\nlistCreativeTemplates();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef list_creative_template()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    pp client.creative_templates.list()\nend\nlist_creative_template()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v2/creative-templates/{CreativeTemplateID}/update":{"post":{"summary":"Update Creative Template","description":"This updates a new creative template for your network and for all associated creatives. This endpoint is also used for archiving a creative template.\n\nYou can either update individual parameters on the creative template or you can send a whole template to be updated.","operationId":"update-creative-template-1","parameters":[{"name":"CreativeTemplateID","in":"path","description":"The ID from Create Creative Template","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"// The response will contain the updated creative template JSON object."}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"## Update template (individual parameters)\ncurl -X POST -H \"X-Adzerk-ApiKey: $ADZERK_API_KEY\" -H \"Content-Type: application/json\" -d '{\"Updates\":[{\"Path\":[\"Fields\",0,\"Description\"], \"Op\":\"Update\", \"Value\":\"New description\"}]}' https://api.kevel.co/v2/creative-templates/1234/update\n\n## Update template in its entirety\ncurl -X POST -H \"X-Adzerk-ApiKey: $ADZERK_API_KEY\" -H \"Content-Type: application/json\" -d '{\"Updates\":[{\"Path\":[], \"Op\":\"Update\", \"Value\":{\"Description\": \"v2\", \"Name\": \"Awesome Template\", \"IsArchived\": false, \"Fields\": [{\"Name\": \"Awesome Thing One\", \"Description\": \"Awesomeness to display\", \"Type\": \"String\", \"Required\": true, \"Variable\": \"ctThingOne\"}, {\"Name\": \"Awesome Thing Two\", \"Description\": \"A second thing to (maybe) display\", \"Type\": \"String\", \"Required\": false, \"Variable\": \"ctThingTwo\"} ], \"Contents\": [{\"Type\": \"HTML\", \"Body\": \"Guess what is awesome? {{ctThingOne}} is!\"}]}}]}' https://api.kevel.co/v2/creative-templates/12345/update \n\n## Archive template\ncurl -X POST -H \"X-Adzerk-ApiKey: $ADZERK_API_KEY\" -H \"Content-Type: application/json\" -d '{\"Updates\":[{\"Path\":\"IsArchived\",\"Value\":true}]}' https://api.kevel.co/v2/creative-templates/1234/update"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function updateCreativeTemplate() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let updatedCreativeTemplate = await client.run('creativeTemplate', 'update', {\n    id: 12345,\n    updates: [{\n      path: ['Description'],\n      value: 'Updated Creative Template Description'\n    }, {\n      path: ['Fields', 1],\n      op: 'InsertAfter',\n      value: {\n        name: 'Body',\n        description: 'The Body of an Ad',\n        type: 'String',\n        variable: 'ctBody',\n        required: false,\n        adQuery: true,\n      },\n    }],\n  });\n  console.log(updatedCreativeTemplate);\n}\n\nupdateCreativeTemplate();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef update_creative_template()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    creative_template_id = 1234\n    data = {\n        updates: [{\n            path: ['Description'],\n            value: 'Updated Creative Template Description'\n        }, {\n            path: ['Fields', 1],\n            op: 'InsertAfter',\n            value: {\n                name: 'Body',\n                description: 'The Body of an Ad',\n                type: 'String',\n                variable: 'ctBody',\n                required: false,\n              \tad_query: true,\n            }\n        }]\n    }\n    pp client.creative_templates.update(creative_template_id, data)\nend\nupdate_creative_template()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v2/creative-templates/{CreativeTemplateID}":{"get":{"summary":"Get Creative Template","description":"This endpoint returns a creative template object by `Id`.","operationId":"get-creative-template-1","parameters":[{"name":"CreativeTemplateID","in":"path","description":"The ID from the Create Creative Templates Endpoint","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{  \n  \"Id\":12345,\n  \"Description\": \"Template Description\",\n  \"Name\": \"Template Name v1\",\n  \"IsArchived\": false,\n  \"Fields\": [\n    {\n      \"Name\": \"Title\",\n      \"Description\": \"The Template Title\",\n      \"Type\": \"String\",\n      \"Variable\": \"ctTitle\",\n      \"Required\": true,\n    }, \n    {\n      \"Name\": \"Thumbnail\",\n      \"Description\": \"The URL of a Thumbnail Image\",\n      \"Type\": \"String\",\n      \"Variable\": \"ctThumbnailUrl\",\n      \"Required\": false,\n    }\n  ],\n  \"Contents\": [\n    {\n      \"Type\": \"Raw\",\n      \"Body\": '{\"title\": \"{{ctTitle}}\", \"thumbnailUrl\": \"{{ctThumbnailUrl}}\" }'\n    }\n  ]\n}"}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v2/creative-templates/12345\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function getCreativeTemplate() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let creativeTemplate = await client.run('creativeTemplate', 'get', {id: 12345});\n  console.log(creativeTemplate);\n}\n\ngetCreativeTemplate();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef get_creative_template()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    creative_template_id = 1234\n    pp client.creative_templates.get(creative_template_id)\nend\nget_creative_template()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/entitycounts":{"get":{"summary":"Get Entity Counts","description":"","operationId":"get-entity-counts","parameters":[{"name":"date","in":"query","description":"Get the entity counts for a specific date within the last 60 days by entering a date in the format `YYYY-MM-DD`. If no date is provided, the most recent entity count will be returned.","schema":{"type":"string"}}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"BillableZones\": 1,\n  \"BillableAds\": 8,\n  \"BillableAdvertisers\": 1,\n  \"BillableChannels\": 5,\n  \"EffectiveAt\": \"2023-08-09T00:00:00\",\n  \"NetworkId\": 10649,\n  \"BillableSites\": 5,\n  \"BillableFlights\": 1,\n  \"BillableCreatives\": 17,\n  \"BillableCampaigns\": 1\n}"}},"schema":{"type":"object","properties":{"BillableZones":{"type":"integer","example":1,"default":0},"BillableAds":{"type":"integer","example":8,"default":0},"BillableAdvertisers":{"type":"integer","example":1,"default":0},"BillableChannels":{"type":"integer","example":5,"default":0},"EffectiveAt":{"type":"string","example":"2023-08-09T00:00:00"},"NetworkId":{"type":"integer","example":10649,"default":0},"BillableSites":{"type":"integer","example":5,"default":0},"BillableFlights":{"type":"integer","example":1,"default":0},"BillableCreatives":{"type":"integer","example":17,"default":0},"BillableCampaigns":{"type":"integer","example":1,"default":0}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/entitycounts\"\n\n# Get entity counts for a specific date within the last 60 days\ncurl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/entitycounts?date=2023-08-08\""}],"samples-languages":["curl"]}}},"/v1/channel":{"post":{"summary":"Create Channels","description":"","operationId":"create-channels-1","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["Title","AdTypes","Engine"],"properties":{"Title":{"type":"string","description":"The channel's name"},"AdTypes":{"type":"array","description":"The [Ad Types](doc:ad-sizes) you want to use. Note - if the Ad Types aren't already created (you can check in UI by going to Inventory --> Ad Sizes), you'll need to first do that with the UI or [API](ref:ad-type).","items":{"type":"integer","format":"int32"}},"Engine":{"type":"string","description":"Set to 0 for all requests","default":"0"},"CPM":{"type":"number","description":"Set to 0 for all requests","format":"float"},"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."},"IsDeleted":{"type":"boolean","description":"Don't use when creating a Channel. Defaults to `false`","default":false}}},"examples":{"JSON":{"value":{"Title":"Finance Sites","AdTypes":[5],"Engine":0}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"Title\": \"Finance Sites\",\n  \"IsDeleted\": false,\n  \"CustomTargeting\": null,\n  \"AdTypes\": [\n    5\n  ],\n  \"Keywords\": null,\n  \"Commission\": 0,\n  \"Engine\": \"CPM\",\n  \"CPM\": 0,\n  \"Id\": 1234\n}"}},"schema":{"type":"object","properties":{"Title":{"type":"string","example":"Finance Sites"},"IsDeleted":{"type":"boolean","example":false,"default":true},"CustomTargeting":{},"AdTypes":{"type":"array","items":{"type":"integer","example":5,"default":0}},"Keywords":{},"Commission":{"type":"integer","example":0,"default":0},"Engine":{"type":"string","example":"CPM"},"CPM":{"type":"integer","example":0,"default":0},"Id":{"type":"integer","example":1234,"default":0}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X POST -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" -H \"Content-Type:application/json\" \"https://api.kevel.co/v1/channel\" --data-binary '{\"Title\":\"Finance Sites\",\"Engine\":0,\"AdTypes\":[5]}'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function createChannel() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let channel = await client.run(\"channel\", \"create\", {\n    title: \"Finance Sites\",\n    adTypes: [ 5 ],\n  });\n\n  console.log(channel);\n}\n\ncreateChannel();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef create_channel()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    opts = {\n        title: \"Channel Title\",\n        ad_types: [5, 6],\n        engine: 0 # set to 0 for all requests\n    }\n    pp client.channels.create(opts)\nend\ncreate_channel()"}],"samples-languages":["curl","javascript","ruby"]}},"get":{"summary":"List Channels","description":"","operationId":"list-channels","responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n   \"page\": 1,\n   \"items\": [\n       {\n           \"Id\": 1234,\n           \"Title\": \"All Sites\",\n           \"Commission\": 0,\n           \"Engine\": 0,\n           \"CPM\": 0,\n           \"AdTypes\": [\n               4,\n               5,\n               6,\n               9,\n               13\n           ],\n           \"IsDeleted\": false,\n           \"CustomTargeting\":\"\"\n       },\n       .....\n\t\t]\n }"}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/channel\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function listChannels() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let channels = await client.run(\"channel\", \"list\");\n  console.log(channels);\n\n  let titles = channels.items.map(a => a.title)\n  console.log(titles);\n}\n\nlistChannels();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef list_channels()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    pp client.channels.list()\nend\nlist_channels()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/channel/{ChannelID}":{"put":{"summary":"Update Channels","description":"","operationId":"update-channels","parameters":[{"name":"ChannelID","in":"path","description":"The ID of the Channel","schema":{"type":"integer","format":"int32"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["Id","Engine","Title","AdTypes"],"properties":{"Id":{"type":"integer","description":"Required - cannot be changed","format":"int32"},"Engine":{"type":"string","description":"Set to `0`","default":"0"},"Title":{"type":"string","description":"Change title if you want"},"AdTypes":{"type":"array","description":"This will reset the AdTypes associated with the Channel","items":{"type":"integer","format":"int32"}}}},"examples":{"JSON":{"value":{"Id":1234,"Title":"New Channel Name","Engine":0,"AdTypes":[5]}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"Id\":1234,\n  \"Title\":\"New Channel Name\",\n  \"Commission\":0,\n  \"Engine\":0,\n  \"Keywords\":null,\n  \"CPM\":0,\n  \"AdTypes\":[5],\n  \"IsDeleted\": false,\n  \"CustomTargeting\": null\n}"}},"schema":{"type":"object","properties":{"Id":{"type":"integer","example":1234,"default":0},"Title":{"type":"string","example":"New Channel Name"},"Commission":{"type":"integer","example":0,"default":0},"Engine":{"type":"integer","example":0,"default":0},"Keywords":{},"CPM":{"type":"integer","example":0,"default":0},"AdTypes":{"type":"array","items":{"type":"integer","example":5,"default":0}},"IsDeleted":{"type":"boolean","example":false,"default":true},"CustomTargeting":{}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X PUT -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" -H \"Content-Type:application/json\" \"https://api.kevel.co/v1/channel/1234\" --data-binary '{\"Id\":1234,\"Title\":\"New Channel Name\",\"Engine\":\"0\",\"AdTypes\":[5]}'\n\n"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function updateChannel() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let channel = await client.run(\"channel\", \"update\", {id: 1234, title: \"New Channel Name\"});\n  console.log(channel);\n}\n\nupdateChannel();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef update_channel()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    channel_id = 12345\n    opts = client.channels.get(channel_id)\n    opts[:title] = \"Updated Title\"\n    pp client.channels.update(opts)\nend\nupdate_channel()"}],"samples-languages":["curl","javascript","ruby"]}},"get":{"summary":"Get Channel","description":"","operationId":"get-channels","parameters":[{"name":"ChannelID","in":"path","description":"The ID of the Channel","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"Title\": \"Finance Sites\",\n  \"IsDeleted\": false,\n  \"CustomTargeting\": null,\n  \"AdTypes\": [\n    5\n  ],\n  \"Keywords\": null,\n  \"Commission\": 0.01,\n  \"Engine\": \"CPM\",\n  \"CPM\": 0.01,\n  \"Id\": 1234\n}"}},"schema":{"type":"object","properties":{"Title":{"type":"string","example":"Finance Sites"},"IsDeleted":{"type":"boolean","example":false,"default":true},"CustomTargeting":{},"AdTypes":{"type":"array","items":{"type":"integer","example":5,"default":0}},"Keywords":{},"Commission":{"type":"number","example":0.01,"default":0},"Engine":{"type":"string","example":"CPM"},"CPM":{"type":"number","example":0.01,"default":0},"Id":{"type":"integer","example":1234,"default":0}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/channel/1234\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function getChannel() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let channel = await client.run(\"channel\", \"get\", {id: 1234});\n  console.log(channel);\n}\n\ngetChannel();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef get_channel()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    channel_id = 12345\n    pp client.channels.get(channel_id)\nend\nget_channel()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/channelsInSite/{SiteID}":{"get":{"summary":"List Channels for a Site","description":"This API call returns all \"Channel IDs\" associated with a given Site.","operationId":"list-channels-for-a-site","parameters":[{"name":"SiteID","in":"path","description":"The ID of the Site","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n    \"ChannelIds\": [\n        45678\n    ]\n}"}},"schema":{"type":"object","properties":{"ChannelIds":{"type":"array","items":{"type":"integer","example":45678,"default":0}}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/channel/67890/site/12345\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function channelsInSite() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let channelsInSite = await client.run(\"channelsInSite\", \"get\", {\n    siteId: 12345,\n  });\n\n  console.log(channelsInSite);\n}\n\nchannelsInSite();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef list_channels_in_site()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    site_id = 12345\n    pp client.channelsInSite.list(site_id)\nend\nlist_channels_in_site()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/channel/{ChannelID}/priorities":{"get":{"summary":"Get Priorities for a Channel","description":"","operationId":"get-priorities-for-a-channel","parameters":[{"name":"ChannelID","in":"path","description":"The ID of the Channel","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"  [\n  {\n    \"IsAdChainOptimized\": false,\n    \"IsSecondPricing\": null,\n    \"IsAdChain\": false,\n    \"PassbackTimeout\": null,\n    \"ChannelId\": 12345,\n    \"RelevancyScoreConfig\": null,\n    \"IsAdChainOrdered\": false,\n    \"IsDeleted\": false,\n    \"IsKeywordOptimized\": null,\n    \"Weight\": 1,\n    \"SerializeRelevancyScoreConfigJSON\": null,\n    \"FloorPrice\": null,\n    \"IsAuction\": false,\n    \"RelevancyScoreConfigJSON\": null,\n    \"Name\": \"Sponsorship\",\n    \"SelectionAlgorithm\": 0,\n    \"Id\": 123456\n  },...\n  ]"}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/channel/12345/priorities\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function getPrioritiesForChannel() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let priorities = await client.run(\"channel\", \"getPriorities\", {id: 1234});\n  console.log(priorities);\n}\n\ngetPrioritiesForChannel();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef get_priorities_for_channel()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    channel_id = 12345\n    pp client.channels.get_priorities(channel_id)\nend\nget_priorities_for_channel()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/channel/{ChannelID}/delete":{"get":{"summary":"Delete Channels","description":"","operationId":"delete-channels","parameters":[{"name":"ChannelID","in":"path","description":"The ID of the Channel","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"\"Successfully Deleted\""}},"schema":{"type":"string","example":"Successfully Deleted"}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/channel/1234/delete\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function deleteChannel() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let channel = await client.run(\"channel\", \"delete\", {id: 1234});\n  console.log(channel);\n}\n\ndeleteChannel();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef delete_channel()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    channel_id = 12345\n    pp client.channels.delete(channel_id)\nend\ndelete_channel()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/site":{"post":{"summary":"Create Site","description":"This API call adds a new site to the network. The result includes the unique \"Site ID\" that can be used to update or remove the site. \n\nBy default, all new sites are mapped to the All Sites channel. If the All Sites channel is deleted or the site is removed from that channel, the site must be mapped to another channel to be used in ad requests.","operationId":"create-site","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["Title","URL"],"properties":{"Title":{"type":"string","description":"The site's name"},"URL":{"type":"string","description":"The new site's link. Must be in the format `https://path of URL`"},"NetworkMargin":{"type":"number","description":"Sets a network margin for a site in a network. The network margin adjusts the price a site bids at in auctions but not its revenue in reporting","format":"float"},"CustomRelevancyScore":{"type":"integer","description":"The site's relevancy score, an integer between 1 and 1000. The lower the relevancy score, the lower the ad will be ranked in the auction. A site that does not have a defined relevancy score will have a default relevancy score of `500`. [Learn more](https://dev.kevel.com/docs/relevancy-score).","format":"int32"},"IsDeleted":{"type":"boolean","description":"Don't use when creating a Site. Defaults to `false`","default":false}}},"examples":{"JSON":{"value":{"Title":"Your Site Name","Url":"http://www.example.com"}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"Id\":12345,\n  \"Title\":\"Your Site Name\",\n  \"Url\":\"http://www.example.com\",\n  \"NetworkMargin\":null,\n  \"IsDeleted\":false\n}"}},"schema":{"type":"object","properties":{"Id":{"type":"integer","example":12345,"default":0},"Title":{"type":"string","example":"Your Site Name"},"Url":{"type":"string","example":"http://www.example.com"},"NetworkMargin":{},"IsDeleted":{"type":"boolean","example":false,"default":true}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X POST -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" -H \"Content-Type:application/json\" \"https://api.kevel.co/v1/site\" --data-binary '{\"Title\":\"Your Site Name\",\"URL\":\"https://www.example.com\"}'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function createSite() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let site = await client.run(\"site\", \"create\", {\n    title: \"Your Site Name\",\n    url: \"https://www.example.com/\",\n  });\n\n  console.log(site);\n}\n\ncreateSite();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef create_site()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    data = {\n        title: \"Site Title\",\n        url: \"https://www.example.com/\"\n    }\n    pp client.sites.create(data)\nend\ncreate_site()"}],"samples-languages":["curl","javascript","ruby"]}},"get":{"summary":"List Sites","description":"This API call returns a list of all the sites in the network. For the explorer, use the assigned API Key.","operationId":"list-sites","responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n    \"page\": 1,\n    \"items\": [\n        {\n            \"Id\": 1234,\n            \"Title\": \"Adzerk\",\n            \"Url\": \"http://www.adzerk.com\",\n            \"NetworkMargin\":null,\n            \"IsDeleted\": false\n        },\n        .....\n\t\t]\n}"}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/site\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function listSites() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let sites = await client.run(\"site\", \"list\");\n  console.log(sites);\n\n  let titles = sites.items.map(a => a.title)\n  console.log(titles);\n}\n\nlistSites();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef list_sites()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    pp client.sites.list()\nend\nlist_sites()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/site/{SiteID}":{"put":{"summary":"Update Sites","description":"This API call updates a site with a new URL and/or title, using the \"Site ID\". Please note that the \"Site ID cannot be changed.","operationId":"update-sites","parameters":[{"name":"SiteID","in":"path","description":"ID of the Site","schema":{"type":"integer","format":"int32"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["Id","Title","Url"],"properties":{"Id":{"type":"string","description":"The id of the Site. Cannot be changed."},"Title":{"type":"string","description":"Update the friendly name title if needed"},"Url":{"type":"string","description":"Update the URL in format `https://path of URL` if needed"},"IsDeleted":{"type":"boolean","description":"If want to delete, set to `true`"}}},"examples":{"JSON":{"value":{"Id":12345,"Url":"http://www.example.com","Title":"New Title","IsDeleted":false}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"Id\":12345,\n  \"Title\":\"New Title\",\n  \"Url\":\"http://www.example.com\",\n  \"NetworkMargin\":null,\n  \"IsDeleted\":false\n}"}},"schema":{"type":"object","properties":{"Id":{"type":"integer","example":12345,"default":0},"Title":{"type":"string","example":"New Title"},"Url":{"type":"string","example":"http://www.example.com"},"NetworkMargin":{},"IsDeleted":{"type":"boolean","example":false,"default":true}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X PUT -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" -H \"Content-Type:application/json\" \"https://api.kevel.co/v1/site/12345\" --data-binary '{\"Id\":12345,\"Url\":\"http://www.example.com\",\"Title\":\"New Title\"}'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function updateSite() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let site = await client.run(\"site\", \"update\", {id: 12345, title: \"New Title\"});\n  console.log(site);\n}\n\nupdateSite();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef update_site()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    id = 12345\n    data = client.sites.get(id)\n    data[:title] = \"Updated Site Title\"\n    pp client.sites.update(data)\nend\nupdate_site()"}],"samples-languages":["curl","javascript","ruby"]}},"get":{"summary":"Get Site","description":"This API call returns the properties of a single site based on \"Site ID\". No parameters are needed except \"Site ID\" in the URL.","operationId":"get-site","parameters":[{"name":"SiteID","in":"path","description":"The ID of the Site","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"Id\":1234,\n  \"Title\":\"Your Site Name\",\n  \"Url\":\"http://www.example.com\",\n  \"NetworkMargin\":null,\n  \"IsDeleted\":false\n}"}},"schema":{"type":"object","properties":{"Id":{"type":"integer","example":1234,"default":0},"Title":{"type":"string","example":"Your Site Name"},"Url":{"type":"string","example":"http://www.example.com"},"NetworkMargin":{},"IsDeleted":{"type":"boolean","example":false,"default":true}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/site/12345\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function getSite() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let site = await client.run(\"site\", \"get\", {id: 1234});\n  console.log(site);\n}\n\ngetSite();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef get_site()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    id = 12345\n    pp client.sites.get(id)\nend\nget_site()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/fast/site":{"get":{"summary":"Site Filtering","description":"This API call returns a stream of line-delimited JSON where each line of output is a single JSON object representing one site. The site object contains the site ID, its title, `IsDeleted`, the Pub Account ID, and the URL. By default, the endpoint returns all *non-deleted* sites saved in an account.","operationId":"site-filtering","parameters":[{"name":"titleLike","in":"query","description":"Filters the stream of sites based on the Title. This is a simple match - if the string provided in the query parameter is present anywhere in a site's Title, that site will be returned in the results. Example: `?titleLike=adzerk`","schema":{"type":"string"}},{"name":"urlLike","in":"query","description":"Filters the stream of sites based on the Url. This is a simple match - if the string provided in the query parameter is present anywhere in a site's Url, that site will be returned in the results. Example: `?urlLike=adzerk.com`","schema":{"type":"string"}}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"Id\": 1234,\n  \"Title\": \"A Site Name\",\n  \"IsDeleted\": false,\n  \"NetworkMargin\":null,\n  \"Url\": \"http://www.example.com\"\n}\n{\n  \"Id\": 1235,\n  \"Title\": \"Another Site Name\",\n  \"IsDeleted\": false,\n  \"NetworkMargin\":null,\n  \"Url\": \"http://www.example2.com\"\n}"}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"## Return all sites\ncurl -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" -N \"https://api.kevel.co/v1/fast/site\"\n\n## Filter based on title & URL\ncurl -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" -N \"https://api.kevel.co/v1/fast/site?titleLike=site&urlLike=.com\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function filterSites() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let sitesByTitle = await client.run(\"site\", \"filter\", {titleLike: \"site\"});\n  console.log(\"Sites with 'Site' in title:\", sitesByTitle);\n\n  let sitesByUrl = await client.run(\"site\", \"filter\", {urlLike: \".com\"});\n  console.log(\"Sites with 'example' in URL:\", sitesByUrl);\n}\n\nfilterSites();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef filter_sites()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    site_data = {\n        title_like: \"site\",\n        url_like: \".com\"\n    }\n    pp client.sites.filter_sites(site_data)\nend\nfilter_sites()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/channelSite":{"post":{"summary":"Create Channel Site Map","description":"This API call connects a Site to a Channel. By default, any time a site is created, it is automatically added to the \"All Sites\" channel.","operationId":"create-channel-site-map","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["siteId","channelId"],"properties":{"siteId":{"type":"integer","description":"The site's ID","format":"int32"},"channelId":{"type":"integer","description":"The channel's ID","format":"int32"},"priority":{"type":"integer","description":"Also known as **affinity**. This is different from the Priority associated with Channels. See [here](doc:sites#adding-a-site-to-a-channel) for info.","format":"int32"}}},"examples":{"JSON":{"value":{"SiteId":12345,"ChannelId":67890,"Priority":10}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"SiteId\":12345,\n  \"ChannelId\":67890,\n  \"FixedPaymentAmount\":null,\n  \"Priority\":10\n}"}},"schema":{"type":"object","properties":{"SiteId":{"type":"integer","example":12345,"default":0},"ChannelId":{"type":"integer","example":67890,"default":0},"FixedPaymentAmount":{},"Priority":{"type":"integer","example":10,"default":0}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X POST -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" -H \"Content-Type:application/json\" \"https://api.kevel.co/v1/channelSite\" --data-binary '{\"SiteId\":12345,\"ChannelId\":67890,\"Priority\":5}'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function createChannelSiteMap() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let channelSiteMap = await client.run(\"channelSiteMap\", \"create\", {\n    channelId: 67890,\n    siteId: 12345,\n\n    // NOTE: affinity or weight of site inside channel; \n    // not a Priority object ID!\n    priority: 10,\n  });\n\n  console.log(channelSiteMap);\n}\n\ncreateChannelSiteMap();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef create_channel_site_map()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    data = {\n        channel_id: 12345,\n        site_id: 67890,\n        # NOTE: affinity or weight of site inside channel; not a Priority object ID!\n        priority: 100\n    }\n    pp client.channel_site_maps.create(data)\nend\ncreate_channel_site_map()"}],"samples-languages":["curl","javascript","ruby"]}},"put":{"summary":"Update Channel Site Map","description":"This API call updates a Site's channel mapping.","operationId":"update-channel-site-map","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["siteId","channelId","priority"],"properties":{"siteId":{"type":"integer","description":"The Site's ID","format":"int32"},"channelId":{"type":"integer","description":"The Channel's ID","format":"int32"},"priority":{"type":"integer","description":"Also known as **affinity**. This is different from the Priority associated with Channels. See [here](doc:sites#adding-a-site-to-a-channel) for info.","format":"int32"}}},"examples":{"JSON":{"value":{"SiteId":12345,"ChannelId":67890,"Priority":10}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"SiteId\":12345,\n  \"ChannelId\":67890,\n  \"FixedPaymentAmount\":null,\n  \"Priority\":10\n}"}},"schema":{"type":"object","properties":{"SiteId":{"type":"integer","example":12345,"default":0},"ChannelId":{"type":"integer","example":67890,"default":0},"FixedPaymentAmount":{},"Priority":{"type":"integer","example":10,"default":0}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X PUT -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" -H \"Content-Type:application/json\" \"https://api.kevel.co/v1/channelSite\" --data-binary '{\"SiteId\":12345,\"ChannelId\":67890,\"Priority\":10}'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function updateChannelSiteMap() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let channelSiteMap = await client.run(\"channelSiteMap\", \"update\", {\n    channelId: 67890,\n    siteId: 12345,\n\n    // NOTE: affinity or weight of site inside channel; \n    // not a Priority object ID!\n    priority: 10,\n  });\n\n  console.log(channelSiteMap);\n}\n\nupdateChannelSiteMap();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef update_channel_site_map()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    channel_id = 12345\n    site_id = 67890\n    data = client.channel_site_maps.get(channel_id, site_id)\n    data[:priority] = 250\n    pp client.channel_site_maps.update(data)\nend\nupdate_channel_site_map()"}],"samples-languages":["curl","javascript","ruby"]}},"get":{"summary":"List Channel Site Maps","description":"This API call returns a list of all channel site maps (associations between a site and channels) in a user's account. For the explorer, use the assigned API Key.","operationId":"list-channel-sites","responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n    \"page\": 1,\n    \"items\": [\n        {\n            \"SiteId\": 12345,\n            \"ChannelId\": 1234,\n            \"Priority\": 10\n        },\n        .....\n}"}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/channelSite\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function listChannelSiteMaps() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let channelSiteMaps = await client.run(\"channelSiteMap\", \"list\");\n  console.log(channelSiteMaps);\n}\n\nlistChannelSiteMaps();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef list_channel_site_map()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    pp client.channel_site_maps.list()\nend\nlist_channel_site_map()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/channel/{ChannelID}/site/{SiteID}":{"get":{"summary":"Get Channel Site Map","description":"This API call returns the channel site map for a specific \"Site ID\" and \"Channel ID.\"","operationId":"get-channel-site-map","parameters":[{"name":"ChannelID","in":"path","description":"The ID of the Channel","schema":{"type":"integer","format":"int32"},"required":true},{"name":"SiteID","in":"path","description":"The ID of the Site","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"SiteId\":12345,\n  \"ChannelId\":67890,\n  \"FixedPaymentAmount\":null,\n  \"Priority\":10\n}"}},"schema":{"type":"object","properties":{"SiteId":{"type":"integer","example":12345,"default":0},"ChannelId":{"type":"integer","example":67890,"default":0},"FixedPaymentAmount":{},"Priority":{"type":"integer","example":10,"default":0}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/channel/67890/site/12345\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function getChannelSiteMap() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let channelSiteMap = await client.run(\"channelSiteMap\", \"get\", {\n    channelId: 67890,\n    siteId: 12345,\n  });\n  console.log(channelSiteMap);\n}\n\ngetChannelSiteMap();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef get_channel_site_map()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    channel_id = 12345\n    site_id = 67890\n    pp client.channel_site_maps.get(channel_id, site_id)\nend\nget_channel_site_map()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/channel/{ChannelID}/site/{SiteID}/delete":{"get":{"summary":"Delete Channel Site Map","description":"This API call removes the association of a site and channel.","operationId":"delete-channel-site-map","parameters":[{"name":"ChannelID","in":"path","description":"The ID of the Channel","schema":{"type":"integer","format":"int32"},"required":true},{"name":"SiteID","in":"path","description":"The ID of the Site","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"\"Successfully deleted\""}},"schema":{"type":"string","example":"Successfully deleted"}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/channel/67890/site/12345/delete\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function deleteChannelSiteMap() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let channelSiteMap = await client.run(\"channelSiteMap\", \"delete\", {\n    channelId: 67890,\n    siteId: 12345,\n  });\n\n  console.log(channelSiteMap);\n}\n\ndeleteChannelSiteMap();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef delete_channel_site_map()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    channel_id = 12345\n    site_id = 67890\n    pp client.channel_site_maps.delete(channel_id, site_id)\nend\ndelete_channel_site_map()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/zone":{"post":{"summary":"Create Zone","description":"This API call adds a new zone to the network. A user can choose to create a zone as either a Site Zone (used by only a single site) or a Network Zone (available to any site in the network). Only `name` is required. If `SiteID` is not added, the Zone is added at the Network level.","operationId":"create-zone","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["Name"],"properties":{"Name":{"type":"string","description":"The zone's name"},"SiteId":{"type":"integer","description":"The site's ID","format":"int32"},"IsDeleted":{"type":"boolean","description":"Don't use when creating a Zone. Defaults to `false`","default":false}}},"examples":{"JSON":{"value":{"Name":"Zone Name","SiteId":12345}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"Id\":98765,\n  \"Name\":\"Zone Name\",\n  \"SiteId\":12345,\n  \"IsDeleted\":false\n}"}},"schema":{"type":"object","properties":{"Id":{"type":"integer","example":98765,"default":0},"Name":{"type":"string","example":"Zone Name"},"SiteId":{"type":"integer","example":12345,"default":0},"IsDeleted":{"type":"boolean","example":false,"default":true}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X POST -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" -H \"Content-Type:application/json\" \"https://api.kevel.co/v1/zone\" --data-binary '{\"Name\":\"Zone Name\",\"SiteId\":12345}'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function createZone() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let zone = await client.run(\"zone\", \"create\", {\n    name: \"Zone Name\",\n    siteId: 12345,\n  });\n\n  console.log(zone);\n}\n\ncreateZone();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef create_zone()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    data = {\n        name: \"Zone Name\",\n        site_id: 12345\n    }\n    pp client.zones.create(data)\nend\ncreate_zone()"}],"samples-languages":["curl","javascript","ruby"]}},"get":{"summary":"List Zones","description":"This API call returns a list of all the zones in the network. For the API Explorer, use the assigned API Key.","operationId":"list-zones","responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{  \n    \"page\":1,\n    \"items\":[  \n        {  \n            \"Id\":98765,\n            \"Name\":\"Zone Name\",\n            \"SiteId\":12345,          \n            \"IsDeleted\":false\n        },\n        {  \n            \"Id\":98766,\n            \"Name\":\"A Network Zone for All Sites\",\n            \"IsDeleted\":false\n        },\n        .....\n\t\t]\n}"}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/zone\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function listZones() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let zones = await client.run(\"zone\", \"list\");\n  console.log(zones);\n\n  let names = zones.items.map(a => a.name)\n  console.log(names);\n}\n\nlistZones();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef list_zones()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    pp client.zones.list()\nend\nlist_zones()\n"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/zone/{ZoneID}":{"put":{"summary":"Update Zone","description":"This API call updates the name of the zone or the SiteId that has an associated target.","operationId":"update-zone","parameters":[{"name":"ZoneID","in":"path","description":"The ID of the Zone","schema":{"type":"integer","format":"int32"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["Id","Name"],"properties":{"Id":{"type":"integer","description":"ID of the Zone","format":"int32"},"Name":{"type":"string","description":"Name of the Zone"},"SiteID":{"type":"integer","description":"ID of the Site","format":"int32"},"IsDeleted":{"type":"boolean","description":"If want to delete, set to `true`"}}},"examples":{"JSON":{"value":{"Id":98765,"Name":"A Different Name","SiteId":12345}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"Id\":98765,\n  \"Name\":\"A Different Name\",\n  \"SiteId\":12345,\n  \"IsDeleted\":false\n}"}},"schema":{"type":"object","properties":{"Id":{"type":"integer","example":98765,"default":0},"Name":{"type":"string","example":"A Different Name"},"SiteId":{"type":"integer","example":12345,"default":0},"IsDeleted":{"type":"boolean","example":false,"default":true}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X PUT -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/zone/12345\" --data-urlencode 'zone={ \"Id\":98765, \"Name\":\"A Different Name\", \"SiteId\":12345}'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function updateZone() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let zone = await client.run(\"zone\", \"update\", {id: 98765, name: \"A Different Name\"});\n  console.log(zone);\n}\n\nupdateZone();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef update_zone()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    id = 12345\n    data = client.zones.get(id)\n    data[:name] = \"Updated Zone Name\"\n    pp client.zones.update(data)\nend\nupdate_zone()"}],"samples-languages":["curl","javascript","ruby"]}},"get":{"summary":"Get Zone","description":"This API call returns the properties for a specific zone.","operationId":"get-zone","parameters":[{"name":"ZoneID","in":"path","description":"The ID of the Zone","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"Id\":98765,\n  \"Name\":\"Zone Name\",\n  \"SiteId\":12345,\n  \"IsDeleted\":false\n}"}},"schema":{"type":"object","properties":{"Id":{"type":"integer","example":98765,"default":0},"Name":{"type":"string","example":"Zone Name"},"SiteId":{"type":"integer","example":12345,"default":0},"IsDeleted":{"type":"boolean","example":false,"default":true}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/zone/98765\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function getZone() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let zone = await client.run(\"zone\", \"get\", {id: 98765});\n  console.log(zone);\n}\n\ngetZone();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef get_zone()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    id = 12345\n    pp client.zones.get(id)\nend\nget_zone()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/adtypes":{"post":{"summary":"Create Ad Type","description":"This API call creates an ad type at the network level, making the ad type available on any channel. If the ad type already exists, it will return the existing ad type. In the response the user will receive the unique `adTypeID` in `id` field.","operationId":"create-ad-types","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["Width","Height"],"properties":{"Width":{"type":"integer","description":"Width (pixels)","format":"int32"},"Height":{"type":"integer","description":"Height (pixels)","format":"int32"},"Name":{"type":"string","description":"Optional name. Defaults to `[width] x [height]`"}}},"examples":{"JSON":{"value":{"Width":"100","Height":"100","Name":"Native Sponsored Ingredient"}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"Id\":123\n  \"Width\":100,\n  \"Height\":100,\n  \"Name\":\"Native Sponsored Ingredient\"\n}"}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X POST -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" -H \"Content-Type:application/json\" \"https://api.kevel.co/v1/adtypes\" --data-binary '{\"Width\":100,\"Height\":100,\"Name\":\"Native Sponsored Ingredient\"}'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function createAdType() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  //NOTE: only creates new ad type if the width & height combo are new;\n  //if combo already exists this will return the pre-existing, matching ad type\n  let adType = await client.run(\"adType\", \"create\", {\n    name: \"Native Sponsored Ingredient\",\n    width: 100,\n    height: 100,\n  });\n\n  console.log(adType);\n}\n\ncreateAdType();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef create_ad_type()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    data = {\n        name: \"New AdType Name\",\n        width: 100,\n        height: 100\n    }\n    pp client.ad_types.create(data)\nend\ncreate_ad_type()"}],"samples-languages":["curl","javascript","ruby"]}},"get":{"summary":"List Ad Types","description":"This API call returns a list of all ad types available in the network.","operationId":"list-ad-types","responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"page\": 1,\n  \"items\": [\n    { \"id\": 4, \"name\": 'Leaderboard', \"width\": 728, \"height\": 90 },\n    { \"id\": 5, \"name\": 'Medium Rectangle', \"width\": 300, \"height\": 250 },\n    { \"id\": 6, \"name\": 'Wide Skyscraper', \"width\": 160, \"height\": 600 },\n    { \"id\": 9, \"name\": 'Rectangle', \"width\": 180, \"height\": 150 },\n    { \"id\": 13, \"name\": 'Micro Bar', \"width\": 88, \"height\": 31 },\n    { \"id\": 14, \"name\": 'Button 2', \"width\": 120, \"height\": 60 },\n    { \"id\": 16, \"name\": 'Square Button', \"width\": 125, \"height\": 125 },\n    .....\n  ]\n}"}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/adtypes\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function listAdTypes() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let adTypes = await client.run(\"adType\", \"list\");\n  console.log(adTypes);\n\n  let names = adTypes.items.map(a => a.name)\n  console.log(names);\n}\n\nlistAdTypes();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef list_ad_types()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    pp client.ad_types.list()\nend\nlist_ad_types()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/channel/{ChannelID}/adtypes":{"post":{"summary":"Create Ad Type for Channel","description":"This API call creates a new Ad Type for a Channel. If necessary, it will also create the Ad Type if it does not already exist. The parameters are the same for the Create Ad Types Network endpoint, except the 'Channel ID' needs to be in the URL.","operationId":"create-ad-types-channel","parameters":[{"name":"ChannelID","in":"path","description":"The ID of the Channel you want to add an Ad Type to","schema":{"type":"integer","format":"int32"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["Width","Height"],"properties":{"Width":{"type":"integer","description":"Width (pixels)","format":"int32"},"Height":{"type":"integer","description":"Height (pixels)","format":"int32"},"Name":{"type":"string","description":"Friendly name (like 100x100 or Native Ad)"}}},"examples":{"JSON":{"value":{"Width":"100","Height":"100","Name":"Native Sponsored Ingredient"}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"Id\":123\n  \"Width\":100,\n  \"Height\":100,\n  \"Name\":\"Native Sponsored Ingredient\"\n}"}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X POST -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" -H \"Content-Type:application/json\" \"https://api.kevel.co/v1/channel/12345/adtypes\" --data-binary '{\"Width\":100,\"Height\":100,\"Name\":\"Native Sponsored Ingredient\"}'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function createAdTypeForChannel() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  //NOTE: only creates new ad type if the width & height combo are new;\n  //if combo already exists this will return the pre-existing, matching ad type\n  let adType = await client.run(\"adType\", \"createForChannel\", {\n    name: \"Native Sponsored Ingredient\",\n    width: 100,\n    height: 100,\n    channelId: 12345\n  });\n\n  console.log(adType);\n}\n\ncreateAdTypeForChannel();"},{"language":"ruby","code":"require \"adzerk\"\n\n#NOTE: only creates new ad type if the width & height combo are new;\n#if combo already exists this will return the pre-existing, matching ad type\n\ndef create_ad_type_for_channel()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    data = {\n        name: \"AdType For Channel\",\n        width: 127,\n        height: 127,\n        channel_id: 12345\n    }\n    pp client.ad_types.create(data)\nend\ncreate_ad_type_for_channel()"}],"samples-languages":["curl","javascript","ruby"]}},"get":{"summary":"List Ad Types for Channel","description":"This API call returns a list of all Ad Types enabled for a specific channel.","operationId":"list-ad-types-channel","parameters":[{"name":"channelId","in":"path","description":"ID of the Channel","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"page\": 1,\n  \"items\": [\n    { \"id\": 4, \"name\": 'Leaderboard', \"width\": 728, \"height\": 90 },\n    { \"id\": 5, \"name\": 'Medium Rectangle', \"width\": 300, \"height\": 250 },\n    { \"id\": 6, \"name\": 'Wide Skyscraper', \"width\": 160, \"height\": 600 },\n    { \"id\": 9, \"name\": 'Rectangle', \"width\": 180, \"height\": 150 },\n    { \"id\": 13, \"name\": 'Micro Bar', \"width\": 88, \"height\": 31 },\n    { \"id\": 14, \"name\": 'Button 2', \"width\": 120, \"height\": 60 },\n    { \"id\": 16, \"name\": 'Square Button', \"width\": 125, \"height\": 125 },\n    .....\n  ]\n}"}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/channel/12345/adtypes\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function listAdTypesForChannel() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let adTypes = await client.run(\"adType\", \"listForChannel\", {channelId: 12345});\n  console.log(adTypes);\n\n  let names = adTypes.items.map(a => a.name)\n  console.log(names);\n}\n\nlistAdTypesForChannel();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef list_ad_types_for_channel()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    channel_id = 12345\n    pp client.ad_types.list(channel_id)\nend\nlist_ad_types_for_channel()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/adtypes/{AdTypeID}/delete":{"get":{"summary":"Delete Ad Type","description":"This API call removes an existing Ad Type from the network. Any channels with the Ad Type enabled will no longer have this ad type. The user will receive a `\"Successfully Deleted\"` message, or a `\"No Record to Delete\"` message if no Ad Type was deleted.","operationId":"delete-ad-type-network","parameters":[{"name":"adTypeId","in":"path","description":"ID of Ad Type from Create Ad Type Endpoint","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"\"Successfully Deleted\""}},"schema":{"type":"string","example":"Successfully Deleted"}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/adtypes/987/delete\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function deleteAdType() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let adType = await client.run(\"adType\", \"delete\", {id: 987});\n  console.log(adType);\n}\n\ndeleteAdType();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef delete_ad_type()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    ad_type_id = 987\n    pp client.ad_types.delete(ad_type_id)\nend\ndelete_ad_type()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/channel/{ChannelID}/adtypes/{AdTypeID}/delete":{"get":{"summary":"Delete Ad Type from Channel","description":"This API call removes an existing Ad Type from a specific channel. Use the \"Channel ID and \"Ad Type ID\". The user will receive a `\"Successfully Deleted\"` message, or a `\"No Record to Delete\"` message if no Ad Type was deleted.","operationId":"delete-ad-type-channel","parameters":[{"name":"channelId","in":"path","description":"ID of the Channel","schema":{"type":"integer","format":"int32"},"required":true},{"name":"adTypeId","in":"path","description":"ID of Ad Type from Create Ad Type Endpoint","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"\"Successfully Deleted\""}},"schema":{"type":"string","example":"Successfully Deleted"}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/channel/12345/adtypes/987/delete\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function deleteAdTypeFromChannel() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let adType = await client.run(\"adType\", \"deleteForChannel\", {\n    id: 987, \n    channelId: 12345\n  });\n  console.log(adType);\n}\n\ndeleteAdTypeFromChannel();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef delete_ad_type_for_channel()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    ad_type_id = 100\n    channel_id = 12345\n    pp client.ad_types.delete(ad_type_id, channel_id)\nend\ndelete_ad_type_for_channel()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/itemdb/ingest-url":{"post":{"summary":"Create Ingest URL","description":"","operationId":"create-ingest-url","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["folder","filename"],"properties":{"folder":{"type":"string","description":"The folder or directory where the source file should be uploaded. When using with Kevel Catalog, this is generally `products` or `categories`."},"filename":{"type":"string","description":"The name of the file that will be uploaded to the returned URL. This must include a file type extension (eg `products.ndjson.gz`). Note: Kevel will automatically prepend a datetime string to the provided file name."}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\"url\": \"https://kevel-prod-itemdb-ingest-default.s3.amazonaws.com/99999/products/incoming/2024-04-12T20%3A02%3A18.425674978-products.ndjson?x-amz-security-token=xxx&AWSAccessKeyId=xxx&Expires=1712955738&Signature=xxx\",\"status\":\"https://api.kevel.co/v1/itemdb/ingest-status?folder=products&file=2024-04-12T20%3A02%3A18.425674978-products.ndjson\"}"}},"schema":{"type":"object","properties":{"url":{"type":"string","example":"https://kevel-prod-itemdb-ingest-default.s3.amazonaws.com/99999/products/incoming/2024-04-12T20%3A02%3A18.425674978-products.ndjson?x-amz-security-token=xxx&AWSAccessKeyId=xxx&Expires=1712955738&Signature=xxx"},"status":{"type":"string","example":"https://api.kevel.co/v1/itemdb/ingest-status?folder=products&file=2024-04-12T20%3A02%3A18.425674978-products.ndjson"}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"# Request an ingest URL\ncurl --request POST \\\n     --url https://api.kevel.co/v1/itemdb/ingest-url \\\n     --header 'accept: application/json' \\\n     --header 'content-type: application/json' \\\n     --header 'X-Kevel-ApiKey: <API-KEY>' \\\n     --data '\n{\n  \"folder\": \"products\",\n  \"filename\": \"products.ndjson.gz\"\n}\n'\n\n# Upload a file to the URL received from the request above\ncurl --request PUT --upload-file products.ndjson.gz '{SIGNED_URL_RETURNED_ABOVE}'\n\n# Check the status of the ingestion\ncurl '{STATUS_URL_RETURNED_ABOVE}' \\\n     --header 'X-Kevel-ApiKey: <API-KEY>'","name":"cURL: Request + Upload"}],"samples-languages":["curl"]}}},"/v1/category-catalog":{"get":{"summary":"List Category Catalog","description":"Returns the categories you can choose from when you set up [category targeting](doc:category): the categories in your network's `kevel/targetable-categories` table. It returns the first 10,000 categories in ascending `Id` order, and does not say if there are more.","operationId":"list-category-catalog","parameters":[{"name":"search","in":"query","description":"Returns only the categories whose `Id` or `Name` contains this text, ignoring case.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"[\n  {\n    \"Id\": \"Grocery\",\n    \"Name\": \"Grocery\",\n    \"ParentId\": null\n  },\n  {\n    \"Id\": \"Grocery > Dairy\",\n    \"Name\": \"Dairy\",\n    \"ParentId\": \"Grocery\"\n  }\n]"}},"schema":{"type":"array","items":{"type":"object","properties":{"Id":{"type":"string","description":"The category ID. This is the value to send in `placements[].category` and the value saved in `CategoryTargeting`."},"Name":{"type":"string","description":"The category name, or null.","nullable":true},"ParentId":{"type":"string","description":"The ID of the parent category, or null.","nullable":true}}}}}}},"400":{"description":"Your network has no `kevel/targetable-categories` table, or has more than one.","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}}},"deprecated":false}},"/v1/itemdb/ingest-status":{"get":{"summary":"Ingest Status","description":"","operationId":"ingest-status","parameters":[{"name":"folder","in":"query","description":"The name of the folder provided when creating the ingest url.","required":true,"schema":{"type":"string"}},{"name":"file","in":"query","description":"The name of the file with an automatically generated timestamp prepended to it.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}}},"deprecated":false}},"/v1/login":{"post":{"summary":"Create Login","description":"This adds a new user to your account. The result will include the unique Login ID that can be used to update or remove the login.","operationId":"create-login","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["email"],"properties":{"email":{"type":"string","description":"The email used to login and used for alerts and notifications. A valid email address must be entered."},"name":{"type":"string","description":"Friendly name of user. Defaults to `null`.","default":"Null"},"defaultTimeZone":{"type":"string","description":"If allowed by the network, the preferred time zone of the user. [Must be a string in this list.](doc:time-zones-1#available-time-zones-strings) If none supplied, the time zone for the user defaults to the network setting, or if no network setting, GMT.","default":"null"},"accessLevel":{"type":"string","description":"The [user permission level](doc:user-permissions-new). Must be one of `admn`, `edit`, or `read`. Defaults to `read`.","default":"read"},"canAccessStudio":{"type":"boolean","description":"Must be `true` or `false`. Controls whether or not this user can access [Studio](doc:studio-overview). Defaults to `false`. Setting `CanAccessStudio` to `true` requires that `AccessLevel` be set to `admn` or `edit`.","default":false}}},"examples":{"JSON":{"value":{"email":"george.harrison@example.com","name":"George Harrison","defaultTimeZone":"Antarctica/Vostok","accessLevel":"read","canAccessStudio":"false"}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n    \"id\":12345,\n    \"email\":\"george.harrison@example.com\",\n    \"password\":\"\",\n    \"name\":\"George Harrison\",\n    \"defaultTimeZone\": \"Antarctica/Vostok\",\n    \"accessLevel\":\"read\",\n  \t\"canAccessStudio\": \"false\"\n}"}},"schema":{"type":"object","properties":{"id":{"type":"integer","example":12345,"default":0},"email":{"type":"string","example":"george.harrison@example.com"},"password":{"type":"string","example":""},"name":{"type":"string","example":"George Harrison"},"defaultTimeZone":{"type":"string","example":"Antarctica/Vostok"},"accessLevel":{"type":"string","example":"read"},"canAccessStudio":{"type":"string","example":"false"}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X POST -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" -H \"Content-Type:application/json\" \"https://api.kevel.co/v1/login\" --data-binary '{\"Email\":\"george.harrison@example.com\",\"Name\":\"George Harrison\",\"Password\":\"password\", \"DefaultTimeZone\":\"Antarctica/Vostok\",\"AccessLevel\":\"read\",\"CanAccessStudio\":\"false\"}'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function createUser() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let user = await client.run('user', 'create', {\n    email: 'george.harrison@example.com',\n    password: 'password',\n    name: 'George Harrison',\n    defaultTimeZone: 'Antarctica/Vostok',\n    accessLevel: 'read',\n  });\n  console.log(user);\n}\n\ncreateUser();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef create_user()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    data = {\n        email: 'user@example.com',\n        password: '*****',\n        name: 'User Name',\n        default_time_zone: 'America/Detroit',\n      \taccess_level: 'read',\n    }\n    pp client.logins.create(data)\nend\ncreate_user()"}],"samples-languages":["curl","javascript","ruby"]}},"get":{"summary":"List Logins","description":"This returns a list of all users in your account.","operationId":"list-logins","responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{  \n    \"page\":1,\n    \"items\":[  \n        {  \n            \"id\":12345,\n            \"email\":\"george.harrison@example.com\",\n            \"password\":\"\",\n            \"name\":\"George Harrison\",\n            \"defaultTimeZone\": \"Antarctica/Vostok\",\n            \"accessLevel\":\"read\",\n            \"canAccessStudio\": \"false\"\n        },\n        .....\n\t\t]\n}\n"}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/login\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function listUsers() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let list = await client.run('user', 'list');\n  console.log(list);\n}\n\nlistUsers();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef list_users()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    pp client.logins.list()\nend\nlist_users()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/login/{LoginID}":{"put":{"summary":"Update Login","description":"This updates the name or time zone of a user. This will NOT update the password or email address.","operationId":"update-login","parameters":[{"name":"loginId","in":"path","description":"ID from the Create Login Endpoint. Can get from List Logins endpoint.","schema":{"type":"integer","format":"int32"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["id","email","name"],"properties":{"id":{"type":"string","description":"Login ID of the user"},"email":{"type":"string","description":"Required by the API, but not updated. You can send as an empty string."},"name":{"type":"string","description":"Friendly name of the user. If not included, will reset to `null`"},"defaultTimeZone":{"type":"string","description":"If allowed by the network, the preferred time zone of the user."},"accessLevel":{"type":"string","description":"The [user permission level](doc:user-permissions-new). Must be one of admn, edit, or read. If AccessLevel is not set, the user will retain the current AccessLevel.","default":"<current AccessLevel>"},"canAccessStudio":{"type":"boolean","description":"Must be `true` or `false`. Controls whether or not this user can access [Studio](doc:studio-overview). Defaults to `false`. Setting `CanAccessStudio` to `true` requires that `AccessLevel` be set to `admn` or `edit`.","default":false}}},"examples":{"Request Example":{"value":{"id":12345,"email":"","name":"George Harrison","defaultTimeZone":"UTC","accessLevel":"read","canAccessStudio":"false"}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n    \"id\":12345,\n    \"email\":\"george.harrison@example.com\",\n    \"password\":\"\",\n    \"name\":\"George Harrison\",\n    \"defaultTimeZone\": \"UTC\",\n    \"accessLevel\":\"read\",\n    \"canAccessStudio\": \"false\"\n}"}},"schema":{"type":"object","properties":{"id":{"type":"integer","example":12345,"default":0},"email":{"type":"string","example":"george.harrison@example.com"},"password":{"type":"string","example":""},"name":{"type":"string","example":"George Harrison"},"defaultTimeZone":{"type":"string","example":"UTC"},"accessLevel":{"type":"string","example":"read"},"canAccessStudio":{"type":"string","example":"false"}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X PUT -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" -H \"Content-Type:application/json\" \"https://api.kevel.co/v1/login/12345\" --data-binary '{\"Id\":12345,\"Email\":\"\",\"Name\":\"George Harrison\",\"DefaultTimeZone\":\"UTC\",\"AccessLevel\":\"read\",\"CanAccessStudio\":\"false\"}'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function updateUser() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let user = await client.run('user', 'update', {\n    id: 12345,\n    email: '',\n    name: 'George Harrison',\n    defaultTimeZone: 'UTC',\n    accessLevel: 'read',\n  });\n  console.log(user);\n}\n\nupdateUser();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef update_user()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    data = {\n        id: 12345,\n        email: 'user@example.com',\n        name: 'New User Name',\n        default_time_zone: 'UTC',\n      \taccess_level: 'read',\n    }\n    pp client.logins.update(data)\nend\nupdate_user()"}],"samples-languages":["curl","javascript","ruby"]}},"get":{"summary":"Get Login","description":"This returns the data for a specific user. No parameters are needed, besides the \"Log-in ID\" in the URL.","operationId":"get-login","parameters":[{"name":"loginId","in":"path","description":"ID from Create Login Endpoint","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"id\":12345,\n  \"email\":\"george.harrison@example.com\",\n  \"password\":\"\",\n  \"name\":\"George Harrison\",\n  \"defaultTimeZone\": \"Antarctica/Vostok\",\n  \"accessLevel\":\"read\",\n  \"canAccessStudio\": \"false\"\n}"}},"schema":{"type":"object","properties":{"id":{"type":"integer","example":12345,"default":0},"email":{"type":"string","example":"george.harrison@example.com"},"password":{"type":"string","example":""},"name":{"type":"string","example":"George Harrison"},"defaultTimeZone":{"type":"string","example":"Antarctica/Vostok"},"accessLevel":{"type":"string","example":"read"},"canAccessStudio":{"type":"string","example":"false"}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/login/12345\""},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function getUser() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let user = await client.run('user', 'get', {id: 12345});\n  console.log(user);\n}\n\ngetUser();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef get_user()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    id = 12345\n    pp client.logins.get(id)\nend\nget_user()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/advertiser/{AdvertiserId}/segment":{"post":{"summary":"Copy of Create Ad Segment Targeting Rule","description":"Create an Ad to Segment targeting rule","operationId":"post_v1ad{AdId}segmenttargeting-1","parameters":[{"in":"path","name":"AdvertiserId","schema":{"type":"integer","format":"int32"},"required":true,"description":"The ID of the Advertiser."}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["SegmentId"],"properties":{"AdvertiserId":{"type":"integer","format":"int32","description":"The ID of the Advertiser."},"SegmentId":{"type":"integer","description":"The ID of the Segment.","format":"int32"}}}}}},"responses":{"200":{"description":"Response from the Create Advertiser Segment endpoint.","content":{"application/json":{"schema":{"type":"object","properties":{"Id":{"type":"integer","example":56789,"default":0,"description":"The ID of the Advertiser Segment.","format":"int32"},"AdvertiserId":{"type":"integer","example":111111,"default":0,"format":"int32","description":"The ID of the Advertiser."},"SegmentId":{"type":"integer","example":222222,"default":0,"format":"int32","description":"The ID of the Segment."},"Segment":{"type":"object","properties":{"Id":{"type":"integer","example":222222,"default":0,"format":"int32","description":"The ID of the Segment."},"Source":{"type":"string","example":"audience","description":"Where the Segment came from.","default":""},"Name":{"type":"string","example":"best customers","description":"The human-friendly name of the Segment."},"Reach":{"type":"object","properties":{"all_time":{"type":"integer","example":3187463,"default":0,"description":"All time estimated reach.","format":"int32"},"28d":{"type":"integer","example":387434,"default":0,"description":"Last 4 weeks estimated reach.","format":"int32"}},"description":"The estimated reach of the segment for all time and the last 4 weeks."},"Description":{"type":"string","example":"top 1% spenders in the last 30 days.","description":"An extended human-friendly description of the Segment."},"Category":{"type":"string","example":"CRM","description":"The Category a Segment belongs to."}},"required":["Id","Name"]}},"required":["SegmentId","AdvertiserId","Id","Segment"]},"examples":{"OK":{"summary":"OK","value":{"Id":56789,"AdvertiserId":111111,"SegmentId":222222,"Segment":{"Id":222222,"Source":"audience","Name":"best customers","Reach":{"all_time":3187463,"28d":387434},"Description":"top 1% spenders in the last 30 days.","Category":"CRM"}}}}}}},"400":{"description":"An error signifying that the client has issued a bad request","content":{"application/json":{"examples":{"Result":{"value":{"Errors":[{"message":"Advertiser segment already exists."}]}}},"schema":{"type":"object","properties":{"Errors":{"type":"array","items":{"properties":{"message":{"type":"string","description":"Error that occurred."}},"type":"object","required":["message"]},"description":"Collection of errors."}},"required":["Errors"]}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X POST -H \"X-Adzerk-ApiKey:<APIKEY>\" -H \"Content-Type:application/json\" https://api.kevel.co/v1/advertiser/{AdvertiserId}/segment --data-binary '{\"AdvertiserId\":111111,\"SegmentId\":222222}'"},{"code":"// coming soon to @adzerk-management-sdk\n\nconst Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function createAdvertiserSegment() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let advertiserSegment = await client.run(\"advertiserSegment\", \"create\", {\n    advertiserId: 111111,\n    segmentId: 222222\n  });\n\n  console.log(advertiserSegment);\n}\n\nawait createAdvertiserSegment();","language":"javascript","name":""},{"code":"## coming soon to @adzerk-management-sdk\n\nrequire \"adzerk\"\n\ndef create_advertiser_segment()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    pp client.advertiserSegment.create(advertiserId: 11111, segmentId: 222222)\nend\ncreate_advertiser_segment()","language":"ruby","name":""}],"samples-languages":["curl","javascript","ruby"]}},"get":{"summary":"Copy of Copy of Create Ad Segment Targeting Rule","description":"Create an Ad to Segment targeting rule","operationId":"post_v1advertiser{AdvertiserId}segment-1","parameters":[{"in":"path","name":"AdvertiserId","schema":{"type":"integer","format":"int32","default":""},"required":true,"description":"The ID of the Advertiser."},{"in":"query","name":"pageSize","schema":{"type":"integer","format":"int32"},"description":"The size of the page to be returned."},{"in":"query","name":"page","schema":{"type":"integer","format":"int32"},"description":"The page number to be returned."}],"responses":{"200":{"description":"Response from the List Advertiser Segments endpoint.","content":{"application/json":{"schema":{"type":"object","properties":{"page":{"type":"integer","format":"int32","default":"","description":"The page number to be returned."},"Items":{"type":"array","items":{"properties":{"Id":{"type":"integer","format":"int32","description":"The ID of the Advertiser Segment."},"AdvertiserId":{"type":"string","description":"The ID of the Advertiser."},"SegmentId":{"type":"string","description":"The ID of the Segment."},"Segment":{"type":"object","properties":{"Id":{"type":"integer","description":"The ID of the Segment.","format":"int32"},"Source":{"type":"string","description":"Where the Segment came from."},"Name":{"type":"string","description":"The human-friendly name of the Segment."},"Reach":{"type":"object","properties":{"28d":{"type":"integer","description":"Last 4 weeks estimated reach.","format":"int32"},"all_time":{"type":"integer","format":"int32","description":"All time estimated reach."}}},"Description":{"type":"string","description":"An extended human-friendly description of the Segment."},"Category":{"type":"string","description":"The Category a Segment belongs to."}},"required":["Id","Source","Name"]}},"type":"object","required":["Id","Segment","SegmentId","AdvertiserId"]},"description":"The items on the page."},"pageSize":{"type":"integer","description":"The size of the page to be returned.","format":"int32"},"totalPages":{"type":"integer","format":"int32","description":"The total number of pages."},"totalItems":{"type":"integer","description":"The total number of items.","format":"int32"}},"required":["page","Items"]},"examples":{"OK":{"summary":"OK","value":{"page":1,"items":[{"Id":56789,"AdvertiserId":111111,"SegmentId":222222,"Segment":{"Id":222222,"Source":"audience","Name":"best customers","Reach":{"all_time":3187463,"28d":387434},"Description":"top 1% spenders in the last 30 days.","Category":"CRM"}}],"pageSize":1,"totalPages":1,"totalItems":1}}}}}},"400":{"description":"An error signifying that the client has issued a bad request","content":{"application/json":{"examples":{"Result":{"value":{"Errors":[{"message":"Advertiser not found"}]}}},"schema":{"type":"object","properties":{"Errors":{"type":"array","items":{"properties":{"message":{"type":"string","description":"Error that occurred."}},"type":"object","required":["message"]},"description":"Collection of errors."}},"required":["Errors"]}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl --request GET \\\n     --url https://api.kevel.co/v1/advertiser/111111/segment \\\n     --header 'accept: application/json'"},{"code":"// coming soon to @adzerk-management-sdk\n\nconst Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function listAdvertiserSegments() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let advertiserSegments = await client.run(\"advertiserSegment\", \"list\", {\n    advertiserId: 111111\n  });\n\n  console.log(advertiserSegments);\n}\n\nawait listAdvertiserSegments();","language":"javascript","name":""},{"code":"## coming soon to @adzerk-management-sdk\n\nrequire \"adzerk\"\n\ndef create_advertiser_segment()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    pp client.advertiserSegment.list(advertiserId: 11111)\nend\nlist_advertiser_segment()","language":"ruby","name":""}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/advertiser/{AdvertiserId}/segment/{AdvertiserSegmentId}":{"delete":{"summary":"Copy of Copy of Copy of Create Ad Segment Targeting Rule","description":"Create an Ad to Segment targeting rule","operationId":"get_v1advertiser{AdvertiserId}segment-1","parameters":[{"in":"path","name":"AdvertiserId","schema":{"type":"integer","format":"int32","default":""},"required":true,"description":"The ID of the Advertiser."},{"in":"path","name":"AdvertiserSegmentId","schema":{"type":"integer","format":"int32"},"required":true,"description":"The ID of the Advertiser Segment mapping."}],"responses":{"200":{"content":{"application/json":{"examples":{"OK":{"summary":"OK","value":"Successfully deleted."}},"schema":{"type":"object","properties":{}}}},"description":"Successfully deleted message."},"400":{"description":"An error signifying that the client has issued a bad request","content":{"application/json":{"examples":{"Result":{"value":{"Errors":[{"path":["path-params","advertiser-id"],"value":"abc","message":"Value at '[:path-params :advertiser-id]' must be a number."}]}}},"schema":{"type":"object","properties":{"Errors":{"type":"array","items":{"properties":{"message":{"type":"string","description":"Error that occurred."}},"type":"object","required":["message"]},"description":"Collection of errors."}},"required":["Errors"]}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl --request DELETE \\\n     --url https://api.kevel.co/v1/advertiser/111111/segment/56789 \\\n     --header 'accept: application/json'"},{"code":"// coming soon to @adzerk-management-sdk\n\nconst Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function listAdvertiserSegments() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let result = await client.run(\"advertiserSegment\", \"delete\", {\n    advertiserId: 111111,\n    advertiserSegmentId: 56789\n  });\n\n  console.log(result);\n}\n\nawait listAdvertiserSegments();","language":"javascript","name":""},{"code":"## coming soon to @adzerk-management-sdk\n\nrequire \"adzerk\"\n\ndef create_advertiser_segment()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    pp client.advertiserSegment.delete(advertiserId: 11111, advertiserSegmentId: 56789)\nend\nlist_advertiser_segment()","language":"ruby","name":""}],"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}