{"openapi":"3.1.0","info":{"title":"adzerk-management-apis","version":"1.0"},"servers":[{"url":"https://api.kevel.co"}],"components":{"securitySchemes":{"sec0":{"type":"apiKey","name":"X-Adzerk-ApiKey","in":"header"}}},"security":[{"sec0":[]}],"paths":{"/v1/report/queue":{"post":{"summary":"Create Queued Report","description":"This endpoint makes a request in the Kevel database for the criteria passed in the parameters, and then returns a GUID that can be used to pull the finished report. Criteria can be specified for the report using an object titled \"criteria\". Report IDs will persist for 10 days.","operationId":"create-queued-report","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["StartDateISO","EndDateISO","GroupBy","Parameters"],"properties":{"StartDateISO":{"type":"string","description":"The start date of the report in ISO 8601 format. Format: `YYYY-MM-DDTHH:MM:SS`, such as: '2016-06-01T00:00:00'"},"EndDateISO":{"type":"string","description":"The end date of the report in ISO 8601 format. Format: `YYYY-MM-DDTHH:MM:SS`, such as: '2016-06-01T00:00:00'"},"GroupBy":{"type":"array","description":"Object containing list of strings. One is required: `day`, `week`, `month`, or empty array (for total). You can also optionally break down by additional parameters listed [here](https://dev.kevel.com/reference/reporting-api-1#groupby-and-parameter-fields---optional). Such as `\"GroupBy\": [\"day\",\"campaignId\"]`.","items":{"type":"string"}},"Parameters":{"type":"object","description":"List of key/value pairs used for filtering. It's an unlimited number of criteria that will filter the report. More info [here](https://dev.kevel.com/reference/reporting-api-1#groupby-and-parameter-fields---optional). Such as `\"Parameters\": [{\"brandId\": 12}]`","properties":{"":{"type":"string","description":"The name of the parameter you want to filter by"}}},"ExcludeParameters":{"type":"object","description":"List of key/value pairs used for filtering. It's an unlimited number of criteria that will filter the report. More info [here](https://dev.kevel.com/reference/reporting-api-1#groupby-and-parameter-fields---optional). Such as `\"ExcludeParameters\": [{\"brandId\": 12}]`","properties":{"":{"type":"string","description":"The name of the parameter you want to filter by"}}},"TimeZone":{"type":"string","description":"Generates the report for a specific timezone from the [list of valid timezone strings](doc:time-zones-1#available-time-zones-strings). Default is GMT (UTC). Ex. \"TimeZone\": \"America/New_York\""},"CustomizedCsvColumnNames":{"type":"array","description":"Provide a list of original-to-new mappings to rename CSV column names.","items":{"properties":{"original":{"type":"string","description":"The name of the original CSV column name that you want to rename."},"new":{"type":"string","description":"The name of the new CSV column name that you want `original` to be renamed to."}},"type":"object"}},"CsvReportVisibility":{"type":"string","description":"Specify whether the report will be publicly available via CSV download link. Allowed options: (\"none\", \"public\"), defaults to \"none\" for Queued Reports, \"public\" for Scheduled Reports. This is useful if you intend to run a Queued Report and then embed the (`report_run_csv_url` in /v2/reportruns) into an email / Self-Serve without authentication. (e.g. `curl -XGET https://api.kevel.co/v2/report/download/a87ece06-28cd-4267-9314-e830af7eaa12/public?filename=foobar`)","default":"none"},"CsvColumns":{"type":"array","description":"List of CSV columns to export in the generated CSV. If undefined or empty, all columns are exported.","items":{"type":"string"}},"ExcludeCsvColumns":{"type":"array","description":"List of CSV columns to exclude from the exported CSV.","items":{"type":"string"}},"ReportDateFormat":{"type":"string","description":"Date format to display in the \"Date\" column of the Report CSV, possible values: \"us\", \"iso8601\"","enum":["us","iso8601"]},"FlatRateAccrualMethod":{"type":"string","description":"Strategy to use to when considering revenue from flat rate flights. If undefined, the network default is used.\n - startdateaccrual: Assign the revenue to the timeslice at the flight's start date\n - norevenueaccrual: Ignore the revenue from flat rate flights.","enum":["startdateaccrual","norevenueaccrual"]}}},"examples":{"JSON":{"value":{"StartDateISO":"2017-01-01T00:00:00","EndDateISO":"2017-05-16T00:00:00","GroupBy":["day","campaignId"],"Parameters":[{"brandId":12}],"TimeZone":"America/New_York","CsvReportVisibility":"none"}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n    \"Id\": \"a87ece06-28cd-4267-9314-e830af7eaa12\"\n}"}},"schema":{"type":"object","properties":{"Id":{"type":"string","example":"a87ece06-28cd-4267-9314-e830af7eaa12"}}}}}}},"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/report/queue --data-binary '{\"StartDateISO\": \"2017-01-01\",\"EndDateISO\": \"2017-05-16\",\"GroupBy\":[\"campaignId\"], \"Parameters\":[{\"siteId\":123456}]}'","name":"cURL"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function createQueuedReport() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let response = await client.run('queuedReport', 'create', {\n    startDateIso: '2020-01-01T00:00:00',\n    endDateIso: '2020-10-01T23:59:59',\n    groupBy: ['month'],\n    parameters: [{\n      brandId: 898066, // Advertiser ID\n    }],\n  });\n\n  console.log(response);\n}\n\ncreateQueuedReport();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef create_queued_report()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    data = {\n        # Start and end date must be PascalCase\n        StartDateISO: '2020-01-01T00:00:00',\n        EndDateISO: '2021-01-01T23:59:59',\n        group_by: ['month'],\n        parameters: [{\n          brand_id: 12345, # Advertiser ID\n        }],\n    }\n    pp client.reports.create_queued_report(data)\nend\ncreate_queued_report()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/report/queue/{GUID}":{"get":{"summary":"Poll for Queued Report Result","description":"After a GUID has been generated by the Create Queued Report endpoint, append the GUID to retrieve the finished report. Some reports may take longer periods to finish, so the report will also contain a status code.","operationId":"poll-for-queued-report-result","parameters":[{"name":"GUID","in":"path","description":"The GUID from Create Queued Report","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n    \"Id\": \"b0e0v47-be95-4f4e-8d01-090xx55gg44\",\n    \"Status\": 2,\n    \"Result\": {\n        \"TotalGMV\": 34270.73,\n        \"TotalPurchases\": 139,\n        \"TotalRevenue\": 939.84,\n        \"TotalLTVOrders\": 132.650000,\n        \"TotalLTVROAS\": 0.000000,\n        \"TotalLTVSales\": 3630.630000,\n        \"TotalROAS\": 2934.38,\n        \"TotalUnfilteredImpressions\": 923938,\n        \"OptionRecords\": [],\n        \"IsTotal\": false,\n        \"TotalRawBucketClicks\": 9715,\n        \"Title\": null,\n        \"TotalCPC\": 0.923,\n        \"RecordTitle\": null,\n        \"TotalUniqueCTR\": 0.966948,\n        \"TotalTrueRevenue\": 400.93,\n        \"TotalImpressions\": 923938,\n        \"StartDate\": \"2024-05-10T00:00:00\",\n        \"EndDate\": \"2014-03-31T00:00:00\",\n        \"TotalTestBucketClicks\": 0,\n        \"TotalD7Purchases\": 0,\n        \"TotalPostViewPurchases\": 0,\n        \"TotalInvalidUABucketClicks\": 0,\n        \"TotalCVR\": 0.834,\n        \"TotalSupiciousBucketClicks\": 0,\n        \"TotalClicks\": 8934,\n        \"TotalCTR\": 0.966948,\n        \"TotalPostClickPurchases\": 0,\n        \"TotalSameProductCategoryPurchases\": 0,\n        \"TotalSameProductSkuPurchases\": 0,\n        \"TotalSameProductBrandPurchases\": 0,\n        \"TotalDuplicateIPBucketClicks\": 0,\n        \"ReportId\": \"00000000-0000-0000-0000-000000000000\",\n        \"Grouping\": [\n            \"day\",\n            \"optionId\"\n        ],\n        \"TotalD30Purchases\": 0,\n        \"LoginId\": null,\n        \"TotalUniqueBucketClicks\": 8934,\n        \"StartDateISO\": \"2024-05-10T00:00:00.0000000\",\n        \"EndDateISO\": \"2024-05-13T00:00:00.0000000\",\n        \"EndDate\": \"2024-05-13T00:00:00\",\n        \"TotalECPM\": 1.234,\n        \"TotalInvalidUAImpressions\": 0,\n        \"Critiera\": [\n            {\n                \"priorityId\": 1234\n            },\n            {\n                \"adTypeId\": 123\n            },\n            {\n                \"keyword\": \"someKeyword=false\"\n            },\n            {\n                \"keyword\": \"country=us\"\n            },\n            {\n                \"keyword\": \"language=en\"\n            },\n            {\n                \"keyword\": \"IsSponsored=false\"\n            }\n        ],\n        \"TotalServerConversions\": 0,\n        \"TotalD14Purchases\": 0,\n        \"TotalD1Purchases\": 0,\n        \"TotalDuplicateImpressionBucketClicks\": 781,\n        \"Records\": [\n            {\n                \"UnfilteredImpressions\": 141423,\n                \"InvalidUAImpressions\": 0,\n                \"CPC\": 0.834,\n                \"LTVSales\": 3630.630000,\n                \"LTVOrders\": 132.650000,\n                \"LTVROAS\": 0.000000,\n                \"SameProductCategoryPurchases\": 0,\n                \"SameProductBrandPurchases\": 0,\n                \"SameProductSkuPurchases\": 0,\n                \"PostViewPurchases\": 0,\n                \"GMV\": 3151.46,\n                \"Events\": {\n                    \"1\": 29,\n                    \"2\": 8\n                },\n                \"Title\": null,\n                \"PostClickPurchases\": 0,\n                \"D30Purchases\": 0,\n                \"D14Purchases\": 0,\n                \"UniqueCTR\": 1.048627,\n                \"D1Purchases\": 0,\n                \"FirstDate\": \"2024-05-13T00:00:00Z\",\n                \"LastDate\": \"2024-05-13T00:00:00Z\",\n                \"DateType\": \"day\",\n                \"Date\": \"2024-05-13T00:00:00Z\",\n                \"Grouping\": null,\n                \"SuspiciousBucketClicks\": 0,\n                \"Clicks\": 1483,\n                \"_title\": null,\n                \"ROAS\": 923.394,\n                \"RawBucketClicks\": 1606,\n                \"Purchases\": 16,\n                \"Revenue\": 200.30,\n                \"TrueRevenue\": 200.30,\n                \"Impressions\": 141423,\n                \"CVR\": 0.834,\n                \"eCPM\": 34.834,\n                \"CTR\": 1.048627,\n                \"D7Purchases\": 0,\n                \"UniqueBucketClicks\": 1483,\n                \"Details\": [\n                    {\n                        \"UnfilteredImpressions\": 15,\n                        \"InvalidUAImpressions\": 0,\n                        \"CPC\": 10.82,\n                        \"LTVSales\": 3630.630000,\n                        \"LTVOrders\": 132.650000,\n                        \"LTVROAS\": 0.000000,\n                        \"SameProductCategoryPurchases\": 0,\n                        \"SameProductBrandPurchases\": 0,\n                        \"PostViewPurchases\": 0,\n\t\t\t\t\t\t\t\t\t\t\t\t\"GMV\": 3151.46,\n                        \"Events\": {\n                            \"1\": 29,\n                            \"2\": 8\n                        },\n                        \"TestBucketClicks\": 0,\n                        \"Title\": \"Some Flight Name\",\n                        \"PostClickPurchases\": 0,\n                        \"D30Purchases\": 0,\n                        \"D14Purchases\": 0,\n                        \"UniqueCTR\": 0.834,\n                        \"D1Purchases\": 0,\n                        \"FirstDate\": \"2024-05-13T00:00:00Z\",\n                        \"SameProductSkuPurchases\": 0,\n                        \"InvalidUABucketClicks\": 0,\n                        \"LastDate\": \"2024-05-13T00:00:00Z\",\n                        \"DateType\": null,\n                        \"Date\": \"2024-05-13T00:00:00Z\",\n                        \"Grouping\": {\n                            \"OptionId\": 1234,\n                            \"Flight\": \"Some Flight Name\",\n                            \"FlightStartDate\": \"2024-01-24 11:00:00\",\n                            \"FlightEndDate\": \"2025-01-01 00:00:00\",\n                            \"Campaign\": null,\n                            \"Channel\": null,\n                            \"Advertiser\": null,\n                            \"Ad\": null,\n                            \"BrandName\": null,\n                            \"Region\": null,\n                            \"CampaignId\": 0,\n                            \"Creative\": null,\n                            \"ZoneId\": 0,\n                            \"RateTypeId\": 0,\n                            \"Site\": null,\n                            \"CreativeId\": 0,\n                            \"SiteId\": 0,\n                            \"BrandId\": 0,\n                            \"AdTypeId\": 0,\n                            \"ChannelId\": 0,\n                            \"City\": null,\n                            \"CountryCode\": null,\n                            \"AdType\": null,\n                            \"Priority\": null,\n                            \"Price\": null,\n                            \"Date\": 0,\n                            \"DateType\": \"day\",\n                            \"AdId\": 0,\n                            \"PriorityId\": 0,\n                            \"Zone\": null,\n                            \"MetroCode\": 0,\n                            \"Keyword\": null,\n                            \"Browser\": null,\n                            \"ModelName\": null,\n                            \"FormFactor\": null,\n                            \"AdvertisedOs\": null,\n                            \"BrowserMajorVersion\": null,\n                            \"BrowserMinorVersion\": null,\n                            \"OsMajorVersion\": null,\n                            \"OsMinorVersion\": null,\n                            \"BidModifierType\": null,\n                            \"BidModifierValue\": null,\n              \t\t\t\t\t\t\t\"BidModifierMultiplier\": null,\n                            \"BidModifierPrice\": null,\n                            \"ProductSkuId\": null,\n                            \"ProductSkuName\": null,\n                            \"ProductMerchantId\": null,\n                            \"ProductBrandName\": null,\n                            \"ProductMerchantName\": null,\n                            \"ProductMainCategoryId\": null,\n                            \"ProductMainCategoryName\": null,\n                            \"ProductBrandId\": null\n                        },\n                        \"SuspiciousBucketClicks\": 0,\n                        \"DuplicateImpressionBucketClicks\": 0,\n                        \"DuplicateIPBucketClicks\": 0,\n                        \"Clicks\": 0,\n                        \"_title\": null,\n                        \"ROAS\": 34.38,\n                        \"RawBucketClicks\": 0,\n                        \"Purchases\": 0,\n                        \"Revenue\": 388.8483,\n                        \"TrueRevenue\": 388.8483,\n                        \"Impressions\": 15,\n                        \"Details\": [],\n                        \"CVR\": 0.343,\n                        \"eCPM\": 939.93,\n                        \"CTR\": 1.27,\n                        \"D7Purchases\": 0,\n                        \"UniqueBucketClicks\": 0\n                    }\n                ]\n            }\n        ]\n    }\n}"}},"schema":{"type":"object","properties":{"Id":{"type":"string","example":"b0e0v47-be95-4f4e-8d01-090xx55gg44"},"Status":{"type":"integer","example":2,"default":0},"Result":{"type":"object","properties":{"TotalGMV":{"type":"number","example":34270.73,"default":0},"TotalPurchases":{"type":"integer","example":139,"default":0},"TotalRevenue":{"type":"number","example":939.84,"default":0},"TotalLTVOrders":{"type":"number","example":132.65,"default":0},"TotalLTVROAS":{"type":"integer","example":0,"default":0},"TotalLTVSales":{"type":"number","example":3630.63,"default":0},"TotalROAS":{"type":"number","example":2934.38,"default":0},"TotalUnfilteredImpressions":{"type":"integer","example":923938,"default":0},"OptionRecords":{"type":"array"},"IsTotal":{"type":"boolean","example":false,"default":true},"TotalRawBucketClicks":{"type":"integer","example":9715,"default":0},"Title":{},"TotalCPC":{"type":"number","example":0.923,"default":0},"RecordTitle":{},"TotalUniqueCTR":{"type":"number","example":0.966948,"default":0},"TotalTrueRevenue":{"type":"number","example":400.93,"default":0},"TotalImpressions":{"type":"integer","example":923938,"default":0},"StartDate":{"type":"string","example":"2024-05-10T00:00:00"},"EndDate":{"type":"string","example":"2024-05-13T00:00:00"},"TotalTestBucketClicks":{"type":"integer","example":0,"default":0},"TotalD7Purchases":{"type":"integer","example":0,"default":0},"TotalPostViewPurchases":{"type":"integer","example":0,"default":0},"TotalInvalidUABucketClicks":{"type":"integer","example":0,"default":0},"TotalCVR":{"type":"number","example":0.834,"default":0},"TotalSupiciousBucketClicks":{"type":"integer","example":0,"default":0},"TotalClicks":{"type":"integer","example":8934,"default":0},"TotalCTR":{"type":"number","example":0.966948,"default":0},"TotalPostClickPurchases":{"type":"integer","example":0,"default":0},"TotalSameProductCategoryPurchases":{"type":"integer","example":0,"default":0},"TotalSameProductSkuPurchases":{"type":"integer","example":0,"default":0},"TotalSameProductBrandPurchases":{"type":"integer","example":0,"default":0},"TotalDuplicateIPBucketClicks":{"type":"integer","example":0,"default":0},"ReportId":{"type":"string","example":"00000000-0000-0000-0000-000000000000"},"Grouping":{"type":"array","items":{"type":"string","example":"day"}},"TotalD30Purchases":{"type":"integer","example":0,"default":0},"LoginId":{},"TotalUniqueBucketClicks":{"type":"integer","example":8934,"default":0},"StartDateISO":{"type":"string","example":"2024-05-10T00:00:00.0000000"},"EndDateISO":{"type":"string","example":"2024-05-13T00:00:00.0000000"},"TotalECPM":{"type":"number","example":1.234,"default":0},"TotalInvalidUAImpressions":{"type":"integer","example":0,"default":0},"Critiera":{"type":"array","items":{"type":"object","properties":{"priorityId":{"type":"integer","example":1234,"default":0}}}},"TotalServerConversions":{"type":"integer","example":0,"default":0},"TotalD14Purchases":{"type":"integer","example":0,"default":0},"TotalD1Purchases":{"type":"integer","example":0,"default":0},"TotalDuplicateImpressionBucketClicks":{"type":"integer","example":781,"default":0},"Records":{"type":"array","items":{"type":"object","properties":{"UnfilteredImpressions":{"type":"integer","example":141423,"default":0},"InvalidUAImpressions":{"type":"integer","example":0,"default":0},"CPC":{"type":"number","example":0.834,"default":0},"LTVSales":{"type":"number","example":3630.63,"default":0},"LTVOrders":{"type":"number","example":132.65,"default":0},"LTVROAS":{"type":"integer","example":0,"default":0},"SameProductCategoryPurchases":{"type":"integer","example":0,"default":0},"SameProductBrandPurchases":{"type":"integer","example":0,"default":0},"SameProductSkuPurchases":{"type":"integer","example":0,"default":0},"PostViewPurchases":{"type":"integer","example":0,"default":0},"GMV":{"type":"number","example":3151.46,"default":0},"Events":{"type":"object","properties":{"1":{"type":"integer","example":29,"default":0},"2":{"type":"integer","example":8,"default":0}}},"Title":{},"PostClickPurchases":{"type":"integer","example":0,"default":0},"D30Purchases":{"type":"integer","example":0,"default":0},"D14Purchases":{"type":"integer","example":0,"default":0},"UniqueCTR":{"type":"number","example":1.048627,"default":0},"D1Purchases":{"type":"integer","example":0,"default":0},"FirstDate":{"type":"string","example":"2024-05-13T00:00:00Z"},"LastDate":{"type":"string","example":"2024-05-13T00:00:00Z"},"DateType":{"type":"string","example":"day"},"Date":{"type":"string","example":"2024-05-13T00:00:00Z"},"Grouping":{},"SuspiciousBucketClicks":{"type":"integer","example":0,"default":0},"Clicks":{"type":"integer","example":1483,"default":0},"_title":{},"ROAS":{"type":"number","example":923.394,"default":0},"RawBucketClicks":{"type":"integer","example":1606,"default":0},"Purchases":{"type":"integer","example":16,"default":0},"Revenue":{"type":"number","example":200.3,"default":0},"TrueRevenue":{"type":"number","example":200.3,"default":0},"Impressions":{"type":"integer","example":141423,"default":0},"CVR":{"type":"number","example":0.834,"default":0},"eCPM":{"type":"number","example":34.834,"default":0},"CTR":{"type":"number","example":1.048627,"default":0},"D7Purchases":{"type":"integer","example":0,"default":0},"UniqueBucketClicks":{"type":"integer","example":1483,"default":0},"Details":{"type":"array","items":{"type":"object","properties":{"UnfilteredImpressions":{"type":"integer","example":15,"default":0},"InvalidUAImpressions":{"type":"integer","example":0,"default":0},"CPC":{"type":"number","example":10.82,"default":0},"LTVSales":{"type":"number","example":3630.63,"default":0},"LTVOrders":{"type":"number","example":132.65,"default":0},"LTVROAS":{"type":"integer","example":0,"default":0},"SameProductCategoryPurchases":{"type":"integer","example":0,"default":0},"SameProductBrandPurchases":{"type":"integer","example":0,"default":0},"PostViewPurchases":{"type":"integer","example":0,"default":0},"GMV":{"type":"number","example":3151.46,"default":0},"Events":{"type":"object","properties":{"1":{"type":"integer","example":29,"default":0},"2":{"type":"integer","example":8,"default":0}}},"TestBucketClicks":{"type":"integer","example":0,"default":0},"Title":{"type":"string","example":"Some Flight Name"},"PostClickPurchases":{"type":"integer","example":0,"default":0},"D30Purchases":{"type":"integer","example":0,"default":0},"D14Purchases":{"type":"integer","example":0,"default":0},"UniqueCTR":{"type":"number","example":0.834,"default":0},"D1Purchases":{"type":"integer","example":0,"default":0},"FirstDate":{"type":"string","example":"2024-05-13T00:00:00Z"},"SameProductSkuPurchases":{"type":"integer","example":0,"default":0},"InvalidUABucketClicks":{"type":"integer","example":0,"default":0},"LastDate":{"type":"string","example":"2024-05-13T00:00:00Z"},"DateType":{},"Date":{"type":"string","example":"2024-05-13T00:00:00Z"},"Grouping":{"type":"object","properties":{"OptionId":{"type":"integer","example":1234,"default":0},"Flight":{"type":"string","example":"Some Flight Name"},"FlightStartDate":{"type":"string","example":"2024-01-24 11:00:00"},"FlightEndDate":{"type":"string","example":"2025-01-01 00:00:00"},"Campaign":{},"Channel":{},"Advertiser":{},"Ad":{},"BrandName":{},"Region":{},"CampaignId":{"type":"integer","example":0,"default":0},"Creative":{},"ZoneId":{"type":"integer","example":0,"default":0},"RateTypeId":{"type":"integer","example":0,"default":0},"Site":{},"CreativeId":{"type":"integer","example":0,"default":0},"SiteId":{"type":"integer","example":0,"default":0},"BrandId":{"type":"integer","example":0,"default":0},"AdTypeId":{"type":"integer","example":0,"default":0},"ChannelId":{"type":"integer","example":0,"default":0},"City":{},"CountryCode":{},"AdType":{},"Priority":{},"Price":{},"Date":{"type":"integer","example":0,"default":0},"DateType":{"type":"string","example":"day"},"AdId":{"type":"integer","example":0,"default":0},"PriorityId":{"type":"integer","example":0,"default":0},"Zone":{},"MetroCode":{"type":"integer","example":0,"default":0},"Keyword":{},"Browser":{},"ModelName":{},"FormFactor":{},"AdvertisedOs":{},"BrowserMajorVersion":{},"BrowserMinorVersion":{},"OsMajorVersion":{},"OsMinorVersion":{},"BidModifierType":{},"BidModifierValue":{},"BidModifierMultiplier":{},"BidModifierPrice":{},"ProductSkuId":{},"ProductSkuName":{},"ProductMerchantId":{},"ProductBrandName":{},"ProductMerchantName":{},"ProductMainCategoryId":{},"ProductMainCategoryName":{},"ProductBrandId":{},"FlatRateGroup":{"type":"boolean","description":"If true, this group corresponds to flat rate revenue that couldn't be assigned to another group (e.g. flat rate revenue cannot be assigned to any city)","example":false,"default":false}}},"SuspiciousBucketClicks":{"type":"integer","example":0,"default":0},"DuplicateImpressionBucketClicks":{"type":"integer","example":0,"default":0},"DuplicateIPBucketClicks":{"type":"integer","example":0,"default":0},"Clicks":{"type":"integer","example":0,"default":0},"_title":{},"ROAS":{"type":"number","example":34.38,"default":0},"RawBucketClicks":{"type":"integer","example":0,"default":0},"Purchases":{"type":"integer","example":0,"default":0},"Revenue":{"type":"number","example":388.8483,"default":0},"TrueRevenue":{"type":"number","example":388.8483,"default":0},"Impressions":{"type":"integer","example":15,"default":0},"Details":{"type":"array"},"CVR":{"type":"number","example":0.343,"default":0},"eCPM":{"type":"number","example":939.93,"default":0},"CTR":{"type":"number","example":1.27,"default":0},"D7Purchases":{"type":"integer","example":0,"default":0},"UniqueBucketClicks":{"type":"integer","example":0,"default":0}}}}}}}}}}}}}}},"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"X-Adzerk-ApiKey:<APIKEY>\" https://api.kevel.co/v1/report/queue/b0e0v47-be95-4f4e-8d01-090xx55gg44"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function pollQueuedReport() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let report = undefined;\n\n  do {\n    report = await client.run('queuedReport', 'poll', { id: \"b0e0v47-be95-4f4e-8d01-090xx55gg44\" });\n    await sleep(2000);\n  } while(report.status == undefined || report.status === 1);\n\n  console.log(report);\n}\n\npollQueuedReport();"}],"samples-languages":["curl","javascript"]}}},"/v1/report/schedule":{"post":{"summary":"Create Scheduled Report","description":"This creates a Scheduled Report. This endpoint uses the same body params as a queued report for the `Criteria` field.","operationId":"create-scheduled-report","requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["Name","LoginID","KickoffDate","SchedulingWindow","RecurrenceType","Criteria"],"properties":{"Name":{"type":"string","description":"A friendly name for the report"},"LoginID":{"type":"integer","description":"The `LoginId` for the user who should receive the report. This is the ID that's returned in the [User Management API](ref:log-in-endpoints) endpoints. You can pull a list [here](ref:list-logins)","format":"int32"},"KickoffDate":{"type":"string","description":"The date to begin generating the report. We will use this date and the `RecurrenceType` to determine when the report should recur. Will accept a valid ISO 8601 date string."},"SchedulingWindow":{"type":"integer","description":"The timeframe in which the report should be delivered. All times are in GMT. Key  `0 = Midnight to 6:00AM`  `1 = Between 6:00AM and Noon`  `2 = Between Noon and 6:00PM (18:00)`  `3 = Between 6:00PM (18:00) and Midnight`","format":"int32"},"RecurrenceType":{"type":"integer","description":"How often the report should be delivered. We will use the `RecurrenceType` to adjust the `StartDate` and `EndDate` from the criteria object with each recurring report. Key:  `0 = no recurrence`  `1 = daily` `2 = weekly` `3 = monthly`","format":"int32"},"Criteria":{"type":"object","description":"Object. Use same body params from [Queued Reports](ref:queued-reports). You'll effectively be placing the Queued Report fields into this object.","properties":{"StartDateISO":{"type":"string","format":"date"},"EndDateISO":{"type":"string","format":"date"},"GroupBy":{"type":"array","items":{"type":"string"}},"Parameters":{"type":"array","items":{"properties":{"":{"type":"string","description":"The name of the parameter you want to filter by"}},"type":"object"}},"ExcludeParameters":{"type":"array","items":{"properties":{"":{"type":"string","description":"The name of the parameter you want to filter by"}},"type":"object"}},"CustomizedCsvColumnNames":{"type":"array","items":{"properties":{"original":{"type":"string","description":"The name of the original CSV column name that you want to rename."},"new":{"type":"string","description":"The name of the new CSV column name that you want `original` to be renamed to."}},"type":"object"}},"ReportDateFormat":{"type":"string","description":"Date format to display in the \"Date\" column of the Report CSV, possible values: \"us\", \"iso8601\"","enum":["us","iso8601"]}}},"Emails":{"type":"array","description":"The [external email addresses](doc:scheduled-reporting#adding-additional-emails-to-report) to email with the completed report. Each email address is a string, like ```\"Emails\":[\"1@2.com\", \"3@4.com\"]```","items":{"type":"string"}},"ShowEvents":{"type":"boolean","description":"Display events (conversions, custom events, etc.). Default is `false`","default":false},"ShowClickBucketing":{"type":"boolean","description":"Display clicks sorted by click bucketing. Default is `false`","default":false},"ShowRevenue":{"type":"boolean","description":"Display revenue. Default is `false`","default":false},"ShowConversions":{"type":"boolean","description":"Display conversions. Default is `false`","default":false},"fixedDate":{"type":"boolean","description":"Prevents the time frame of the report from incrementing with each send. Default is `false`","default":false}}},"examples":{"JSON":{"value":{"Name":"Daily Report for Nike","LoginId":12345,"KickoffDate":"11/30/2015","SchedulingWindow":1,"RecurrenceType":1,"Criteria":{"StartDate":"2014-03-01","EndDate":"2014-03-31","Parameters":[{"siteId":12345}],"GroupBy":["day"]}}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{  \n    \"Id\":1234,\n    \"Name\":\"Daily Report for Nike\",\n    \"Criteria\":{  \n        \"StartDate\":\"2017-01-01T00:00:00\",\n        \"EndDate\":\"2017-01-31T00:00:00\",\n        \"Parameters\":[  \n            {  \n                \"siteId\":123456\n            }\n        ],\n        \"GroupBy\":[  \n            \"day\"\n        ],\n        \"Top30countries\":false,\n\t\t\t\t\"ReportDateFormat\": \"iso8601\",\n        \"Exclude3rdParty\":false,\n        \"IsTotal\":false\n    },\n    \"LoginId\":12345,\n    \"KickoffDate\":\"2017-01-01T00:00:00\",\n    \"SchedulingWindow\":1,\n    \"RecurrenceType\":1,\n    \"IsDeleted\":false\n}"}},"schema":{"type":"object","properties":{"Id":{"type":"integer","example":1234,"default":0},"Name":{"type":"string","example":"Daily Report for Nike"},"Criteria":{"type":"object","properties":{"StartDate":{"type":"string","example":"2017-01-01T00:00:00"},"EndDate":{"type":"string","example":"2017-01-31T00:00:00"},"Parameters":{"type":"array","items":{"type":"object","properties":{"siteId":{"type":"integer","example":123456,"default":0}}}},"GroupBy":{"type":"array","items":{"type":"string","example":"day"}},"Top30countries":{"type":"boolean","example":false,"default":true},"ReportDateFormat":{"type":"string","example":"iso8601"},"Exclude3rdParty":{"type":"boolean","example":false,"default":true},"IsTotal":{"type":"boolean","example":false,"default":true}}},"LoginId":{"type":"integer","example":12345,"default":0},"KickoffDate":{"type":"string","example":"2017-01-01T00:00:00"},"SchedulingWindow":{"type":"integer","example":1,"default":0},"RecurrenceType":{"type":"integer","example":1,"default":0},"IsDeleted":{"type":"boolean","example":false,"default":true}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -H 'X-Adzerk-ApiKey:<API-KEY>' -H \"Content-Type:application/json\" https://api.kevel.co/v1/report/schedule -X POST --data-binary '{\"Name\": \"Test\", \"LoginId\": 12345, \"KickoffDate\": \"2018-11-30\", \"SchedulingWindow\": 1, \"RecurrenceType\": 1, \"Criteria\": {\"StartDate\": \"2017-11-28\", \"EndDate\": \"2017-11-28\", \"Parameters\":[],\"GroupBy\": [\"day\"]}}'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function createScheduledReport() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let scheduledReport = await client.run('scheduledReport', 'create', {\n    name: 'API Test Scheduled Report 1',\n      loginId: 12345,\n      kickoffDate: '2020-11-23T00:00:00',\n      schedulingWindow: 1,\n      recurrenceType: 2,\n      criteria: {\n        startDateIso: '2020-01-01T00:00:00',\n        endDateIso: '2020-11-23T23:59:59',\n        groupBy: ['month'],\n        parameters: [{\n          brandId: 737031\n        }],\n      },\n      emails: ['user@example.com'],\n      showEvents: true,\n      showClickBucketing: true,\n      showRevenue: true,\n      showConversions: true,\n  });\n  console.log(scheduledReport);\n}\n\ncreateScheduledReport();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef create_report()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    data = {\n        name: 'API Test Scheduled Report 1',\n        login_id: 12345,\n        kickoff_date: '2020-11-23T00:00:00',\n        scheduling_window: 1,\n        recurrence_type: 2,\n        criteria: {\n            start_date_iso: '2020-01-01T00:00:00',\n            end_date_iso: '2020-11-23T23:59:59',\n            group_by: ['month'],\n            parameters: [{\n                country_code: 'US'\n            }],\n        },\n        emails: ['user@example.com'],\n        show_events: true,\n        show_click_bucketing: true,\n        show_revenue: true,\n        show_conversions: true,\n    }\n    pp client.scheduled_reports.create(data)\nend\ncreate_report()"}],"samples-languages":["curl","javascript","ruby"]}},"get":{"summary":"List Scheduled Reports","description":"This returns a list of all scheduled reports in your account.","operationId":"list-scheduled-reports","responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{  \n    \"page\":1,\n    \"pageSize\":10,\n    \"totalPages\":2,\n    \"totalItems\":15,\n    \"items\":[  \n        {  \n            \"Id\":12345,\n            \"Criteria\":{  \n                \"StartDate\":\"2017-01-01T00:00:00\",\n                \"EndDate\":\"2017-01-31T00:00:00\",\n                \"Parameters\":[  \n                    {  \n                        \"siteId\":123456\n                    }\n                ],\n                \"GroupBy\":[  \n                    \"day\"\n                ],\n                \"Top30countries\":false,\n                \"Exclude3rdParty\":false,\n                \"IsTotal\":false\n            },\n            \"LoginId\":1234,\n            \"KickoffDate\":\"2017-01-01T00:00:00\",\n            \"SchedulingWindow\":1,\n            \"RecurrenceType\":1,\n            \"IsDeleted\":false\n        },..."}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -H 'X-Adzerk-ApiKey: <APIKEY>' 'https://api.kevel.co/v1/report/schedule'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function listScheduledReports() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let list = await client.run('scheduledReport', 'list');\n  console.log(list);\n}\n\nlistScheduledReports();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef list_reports()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    pp client.scheduled_reports.list()\nend\nlist_reports()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/report/schedule/{ScheduledReportID}":{"get":{"summary":"Get Scheduled Report","description":"This returns the properties of a scheduled report given a `ScheduledReportId` (the `id` from the Create Scheduled Reports Response).","operationId":"get-scheduled-report","parameters":[{"name":"ScheduledReportID","in":"path","description":"The ID from the Create Scheduled Reports response","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{  \n    \"Id\":1234,\n    \"Name\":\"Daily Report for Nike\",\n    \"Criteria\":{  \n        \"StartDate\":\"2017-01-01T00:00:00\",\n        \"EndDate\":\"2017-01-31T00:00:00\",\n        \"Parameters\":[  \n            {  \n                \"siteId\":123456\n            }\n        ],\n        \"GroupBy\":[  \n            \"day\"\n        ],\n        \"Top30countries\":false,\n\t\t\t\t\"ReportDateFormat\": \"iso8601\",\n        \"Exclude3rdParty\":false,\n        \"IsTotal\":false\n    },\n    \"LoginId\":1234,\n    \"KickoffDate\":\"2017-01-31T00:00:00\",\n    \"SchedulingWindow\":1,\n    \"RecurrenceType\":1,\n    \"IsDeleted\":false\n}"}},"schema":{"type":"object","properties":{"Id":{"type":"integer","example":1234,"default":0},"Name":{"type":"string","example":"Daily Report for Nike"},"Criteria":{"type":"object","properties":{"StartDate":{"type":"string","example":"2017-01-01T00:00:00"},"EndDate":{"type":"string","example":"2017-01-31T00:00:00"},"Parameters":{"type":"array","items":{"type":"object","properties":{"siteId":{"type":"integer","example":123456,"default":0}}}},"GroupBy":{"type":"array","items":{"type":"string","example":"day"}},"Top30countries":{"type":"boolean","example":false,"default":true},"ReportDateFormat":{"type":"string","example":"iso8601"},"Exclude3rdParty":{"type":"boolean","example":false,"default":true},"IsTotal":{"type":"boolean","example":false,"default":true}}},"LoginId":{"type":"integer","example":1234,"default":0},"KickoffDate":{"type":"string","example":"2017-01-31T00:00:00"},"SchedulingWindow":{"type":"integer","example":1,"default":0},"RecurrenceType":{"type":"integer","example":1,"default":0},"IsDeleted":{"type":"boolean","example":false,"default":true}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -H 'X-Adzerk-ApiKey: <APIKEY>' 'https://api.kevel.co/v1/report/schedule/1234'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function getScheduledReport() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let report = await client.run('scheduledReport', 'get', {id: 1234});\n  console.log(report);\n}\n\ngetScheduledReport();\n"},{"language":"ruby","code":"require \"adzerk\"\n\ndef get_report()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    report_id = 1234\n    pp client.scheduled_reports.get(report_id)\nend\nget_report()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/report/schedule/{ScheduledReportID}/delete":{"get":{"summary":"Delete Scheduled Reports","description":"This removes a scheduled report from your account. No parameters are needed, except `ScheduledReportId` in the URL.","operationId":"delete-scheduled-reports","parameters":[{"name":"ScheduledReportID","in":"path","description":"This is the ID from Create Scheduled Report","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 -H 'X-Adzerk-ApiKey: API-KEY' 'https://api.kevel.co/v1/report/schedule/1234/delete'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function deleteScheduledReport() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let result = await client.run('scheduledReport', 'delete', {id: 1234});\n  console.log(result);\n}\n\ndeleteScheduledReport();"},{"language":"ruby","code":"def delete_report()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    report_id = 1234\n    pp client.scheduled_reports.delete(report_id)\nend\ndelete_report()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v2/reportruns":{"get":{"summary":"Get Report Runs","description":"Every time a report is executed (UI, API or scheduled), a new Report Run record is generated and can be access via the UI or this API endpoint with the help of filters and pagination. Report Runs are persisted for 10 days, after which they are deleted as report results are only stored for up to 10 days.","operationId":"get-report-runs","parameters":[{"name":"filters","in":"query","description":"Filters JSON (URL encoded)","schema":{"type":"string","format":"json","default":"{\"trigger\": [\"ui\",\"scheduled\",\"api\"], \"report_type\": [\"custom\", \"pacing\"]}"}},{"name":"X-Adzerk-ApiKey","in":"header","description":"API Key","schema":{"type":"string"}},{"name":"pageSize","in":"query","description":"Number of ReportRuns to be returned per page","schema":{"type":"integer","format":"int32","default":10}},{"name":"page","in":"query","description":"The page offset","schema":{"type":"integer","format":"int32","default":0}}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"items\": [\n    {\n      \"report_template_id\": 3377,\n      \"report_template_version_id\": 3377,\n      \"report_type\": \"custom\",\n      \"status\": {\n        \"json-status\": \"done\",\n        \"csv1-status\": \"done\",\n        \"redshift-status\": \"done\"\n      },\n      \"id\": 3378,\n      \"csv_report_visibility\": \"public\",\n      \"report_schedule_id\": 1234,\n      \"uuid\": \"5ad75fb4-5fe7-4a48-93ba-45e9588c84eb\",\n      \"report_run_csv_url\": \"https://reports.adzerk.com/r/5ad75fb4-5fe7-4a48-93ba-45e9588c84eb/srr/12345/e/1234\"\n      \"trigger\": \"ui\",\n      \"created_at\": \"2024-03-25T16:14:51Z\",\n      \"network_id\": 11261\n    }\n  ]\n}"}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X GET -H \"Content-Type:application/json\" -H 'X-Adzerk-ApiKey:<APIKEY>' -G https://api.kevel.co/v2/reportruns --data-urlencode 'page=0' --data-urlencode 'pageSize=10' --data-urlencode 'filters={\"trigger\":[\"ui\",\"scheduled\",\"api\"],\"report_type\":[\"custom\", \"pacing\"]}'","name":"cURL"}],"samples-languages":["curl"]}}},"/v1/advertiser/search":{"post":{"summary":"Search Advertisers","description":"","operationId":"search-advertisers","responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"Page\": 1,\n  \"Items\": [\n    {\n      \"IsActive\": true,\n      \"DailyCapAmount\": null,\n      \"FreqCapType\": 0,\n      \"Title\": \"Nike\",\n      \"CapType\": null,\n      \"IsFreqCap\": null,\n      \"IsDeleted\": false,\n      \"RtbCustomFields\": null,\n      \"LifetimeCapAmount\": null,\n      \"FreqCapDuration\": null,\n      \"PlacementLimit\": null,\n      \"FreqCap\": null,\n      \"PartnerId\": null,\n      \"Id\": 123456\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":true,"default":true},"DailyCapAmount":{},"FreqCapType":{"type":"integer","example":0,"default":0},"Title":{"type":"string","example":"Nike"},"CapType":{},"IsFreqCap":{},"IsDeleted":{"type":"boolean","example":false,"default":true},"RtbCustomFields":{},"LifetimeCapAmount":{},"FreqCapDuration":{},"PlacementLimit":{},"FreqCap":{},"PartnerId":{},"Id":{"type":"integer","example":123456,"default":0}}}}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X POST -H 'X-Adzerk-ApiKey:<APIKEY>' https://api.kevel.co/v1/advertiser/search --data-urlencode \"advertiserName=%Nike%\"","name":"cURL"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function searchAdvertisers() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let advertisers = await client.run(\"advertiser\", \"search\", {advertiserName: \"Ni%\"});\n  console.log(advertisers);\n\n  let titles = advertisers.items.map(a => a.title)\n  console.log(titles);\n}\n\nsearchAdvertisers();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef search_advertiser()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    title = \"Advertiser Title\"\n    pp client.advertisers.search(title)\nend\nsearch_advertiser()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/campaign/search":{"post":{"summary":"Search Campaigns","description":"","operationId":"search-campaigns","responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"PageNumber\": 1,\n  \"Items\": [\n    {\n      \"IsActive\": true,\n      \"DontAffectParentFreqCap\": true,\n      \"Flights\": [],\n      \"DailyCapAmount\": 5000,\n      \"FreqCapType\": 1,\n      \"CapType\": 4,\n      \"IsFreqCap\": null,\n      \"IsDeleted\": false,\n      \"EndDateISO\": null,\n      \"Price\": 0,\n      \"IsArchived\": false,\n      \"LifetimeCapAmount\": 50000,\n      \"FreqCapDuration\": 10,\n      \"FreqCap\": 2,\n      \"SalespersonId\": null,\n      \"AdvertiserId\": 12345,\n      \"Name\": \"Nike Shoes\",\n      \"Id\": 567890,\n      \"CustomFieldsJson\": null,\n      \"StartDateISO\": \"2017-01-01T00:00:00.0000000\"\n    }\n  ]\n}"}},"schema":{"type":"object","properties":{"PageNumber":{"type":"integer","example":1,"default":0},"Items":{"type":"array","items":{"type":"object","properties":{"IsActive":{"type":"boolean","example":true,"default":true},"DontAffectParentFreqCap":{"type":"boolean","example":true,"default":true},"Flights":{"type":"array"},"DailyCapAmount":{"type":"integer","example":5000,"default":0},"FreqCapType":{"type":"integer","example":1,"default":0},"CapType":{"type":"integer","example":4,"default":0},"IsFreqCap":{},"IsDeleted":{"type":"boolean","example":false,"default":true},"EndDateISO":{},"Price":{"type":"integer","example":0,"default":0},"IsArchived":{"type":"boolean","example":false,"default":true},"LifetimeCapAmount":{"type":"integer","example":50000,"default":0},"FreqCapDuration":{"type":"integer","example":10,"default":0},"FreqCap":{"type":"integer","example":2,"default":0},"SalespersonId":{},"AdvertiserId":{"type":"integer","example":12345,"default":0},"Name":{"type":"string","example":"Nike Shoes"},"Id":{"type":"integer","example":567890,"default":0},"CustomFieldsJson":{},"StartDateISO":{"type":"string","example":"2017-01-01T00:00:00.0000000"}}}}}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X POST -H 'X-Adzerk-ApiKey:<APIKEY>' 'https://api.kevel.co/v1/campaign/search' --data-urlencode 'campaignName=%Nike%'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function searchCampaigns() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let campaigns = await client.run(\"campaign\", \"search\", {campaignName: \"%Nike%\"});\n  console.log(campaigns);\n\n  let names = campaigns.items.map(a => a.name)\n  console.log(names);\n}\n\nsearchCampaigns();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef search_campaign()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    name = \"Campaign%\"\n    pp client.campaigns.search(name)\nend\nsearch_campaign()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/flight/{FlightID}/creative":{"post":{"summary":"Create Ads","description":"","operationId":"create-ads","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":["Creative"],"properties":{"Creative":{"type":"object","description":"The `creativeID` you'll get when you create a creative, wrapped in an object, like `{\"Id\":12345}`. Or you may omit the `id` and specify a new Creative using the object structure described on [Create Creative](ref:create-creative).","required":["id"],"properties":{"id":{"type":"integer","description":"The ID of an existing Creative.","format":"int32"}}},"IsActive":{"type":"boolean","description":"Whether ad should be eligible to serve. Defaults to `false`","default":false},"RtbCustomFields":{"type":"string","description":"Required for RTB ads _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"},"ActiveKeywords":{"type":"array","description":"For Keyword Targeting. Instructions [here](doc:enabling-keyword-targeting)","items":{"type":"string"}},"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."},"SiteId":{"type":"integer","description":"Site ID for Site Specific targeting","format":"int32"},"ZoneId":{"type":"integer","description":"Zone ID for Zone Specific targeting","format":"int32"},"IsDeleted":{"type":"boolean","description":"Whether it should be deleted"},"Iframe":{"type":"boolean","description":"Whether Creative should use iFrame"},"SizeOverride":{"type":"boolean","description":"Whether size needs to be overridden. Defaults to `false`","default":false},"IsStartEndDateOverride":{"type":"boolean","description":"Whether you are overriding the start and end date"},"StartDateISO":{"type":"string","description":"The start date for this ad in ISO 8601 format"},"EndDateISO":{"type":"string","description":"The end date for this ad in ISO 8601 format"},"IsGoalOverride":{"type":"boolean","description":"Whether you are overriding the goal on the ad"},"GoalType":{"type":"integer","description":"If you are overriding the flight's goal, sets the target goal metric for ad. Key follows: `1 = Impressions` `2 = Percentage` `3 = Click` `7 = Any Conversions` `8 = Lifetime Revenue (integer)` `9 = Daily Revenue (integer)` `10 = Monthly Revenue (integer)`","format":"int32"},"Goal":{"type":"integer","description":"The Goal Amount of `GoalType`","format":"int32"},"Price":{"type":"number","description":"The Price value - instructions [here](https://dev.kevel.com/docs/ads#general-settings-of-an-ad)","format":"float"},"AttributionSettings":{"type":"object","description":"Specify the products, categories, brands, and/or merchants that make a purchase eligible for attribution to this Ad. See [Attribution Overview](doc:attribution-overview) for more details.","properties":{"AttributableItems":{"type":"array","description":"The set of products, categories, and brands that may be attributed to this Ad. See [Kevel Attribution](doc:attribution-overview) for more details.","items":{"properties":{"MatchType":{"type":"string","description":"The match type value determines the other keys included and corresponds to the Flight-level attribution setting for the specificity of the match.","enum":["SameProduct","SameCategoryBrand","SameBrand","SameMerchant"]},"ProductId":{"type":"string","description":"The Product ID to use with the match. Use with `\"MatchType\": \"SameProduct\"` only."},"MerchantId":{"type":"string","description":"The Merchant ID to use with the match. Use with `\"MatchType\": \"SameProduct\"` only."},"CategoryId":{"type":"string","description":"The Category ID to use with the match. Use with `\"MatchType\": \"SameCategoryBrand\"` only."},"BrandId":{"type":"string","description":"The Brand ID to use with the match. Use with `\"MatchType\": \"SameCategoryBrand\"` and `\"MatchType\": \"SameBrand\"`."}},"type":"object"}}}},"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\""]}}},"CategoryTargeting":{"type":"array","description":"The category targeting rules for the Ad, in the same format as on a Flight. An Ad that has category rules uses them instead of its Flight's rules, and the two lists are not merged. An Ad with no rules uses its Flight's rules. An Ad 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 ad. Please contact support.\" Set the field to `null` or `[]` to remove the Ad's 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."}}}}}},"examples":{"JSON":{"value":{"Creative":{"Id":12345},"FlightId":1234,"IsActive":true,"StartDateISO":"2017-05-01T00:00:00.0000000","EndDateISO":"2017-12-05T00:00:00.0000000","ActiveKeywords":["kittens","cats"],"CustomTargeting":"$keywords contains \"dean\"","SiteID":1234,"ZoneId":12345,"IsDeleted":false,"Iframe":false,"SizeOverride":false,"FreqCap":5,"FreqCapDuration":1,"FreqCapType":2,"GoalType":1,"Goal":200000,"Price":1}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"IsActive\": true,\n  \"DontAffectParentFreqCap\": false,\n  \"Creative\": {\n    \"IsActive\": true,\n    \"ImageName\": \"\",\n    \"SaveEmptyCreative\": null,\n    \"Body\": \"\",\n    \"IsNetworkAd\": null,\n    \"Alt\": null,\n    \"Title\": \"Adzerk 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/\",\n    \"ScriptBody\": \"\",\n    \"AdvertiserId\": 123,\n    \"Metadata\": null,\n    \"AdTypeId\": 5,\n    \"IsHTMLJS\": false,\n    \"Id\": 12345\n  },\n  \"FreqCapType\": null,\n  \"EndDate\": null,\n  \"Iframe\": null,\n  \"ZoneId\": null,\n  \"IsDeleted\": false,\n  \"CustomTargeting\": \"$keywords contains \\\"dean\\\"\",\n  \"EndDateISO\": null,\n  \"RtbCustomFields\": null,\n  \"Impressions\": 100,\n  \"GoalType\": 1,\n  \"Goal\": 200000,\n  \"Price\": 1,\n  \"FreqCapDuration\": null,\n  \"Percentage\": 0,\n  \"FreqCap\": null,\n  \"IsStartEndDateOverride\": true,\n  \"CustomRelevancyScore\": null,\n  \"FlightId\": 7290072,\n  \"ActiveKeywords\": [\"kittens\", \"cats\"],\n  \"SiteId\": null,\n  \"CampaignId\": 123,\n  \"Id\": 12345,\n  \"IsGoalOverride\": true,\n  \"StartDateISO\": \"2017-05-01T12:00:00.0000000\",\n  \"EndDateISO\": \"2017-12-05T12:00:00.0000000\"\n}"}},"schema":{"type":"object","properties":{"IsActive":{"type":"boolean","example":true,"default":true},"DontAffectParentFreqCap":{"type":"boolean","example":false,"default":true},"Creative":{"type":"object","properties":{"IsActive":{"type":"boolean","example":true,"default":true},"ImageName":{"type":"string","example":""},"SaveEmptyCreative":{},"Body":{"type":"string","example":""},"IsNetworkAd":{},"Alt":{},"Title":{"type":"string","example":"Adzerk 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/"},"ScriptBody":{"type":"string","example":""},"AdvertiserId":{"type":"integer","example":123,"default":0},"Metadata":{},"AdTypeId":{"type":"integer","example":5,"default":0},"IsHTMLJS":{"type":"boolean","example":false,"default":true},"Id":{"type":"integer","example":12345,"default":0}}},"FreqCapType":{},"EndDate":{},"Iframe":{},"ZoneId":{},"IsDeleted":{"type":"boolean","example":false,"default":true},"CustomTargeting":{"type":"string","example":"$keywords contains \"dean\""},"EndDateISO":{"type":"string","example":"2017-12-05T12:00:00.0000000"},"RtbCustomFields":{},"Impressions":{"type":"integer","example":100,"default":0},"GoalType":{"type":"integer","example":1,"default":0},"Goal":{"type":"integer","example":200000,"default":0},"Price":{"type":"integer","example":1,"default":0},"FreqCapDuration":{},"Percentage":{"type":"integer","example":0,"default":0},"FreqCap":{},"IsStartEndDateOverride":{"type":"boolean","example":true,"default":true},"CustomRelevancyScore":{},"FlightId":{"type":"integer","example":7290072,"default":0},"ActiveKeywords":{"type":"array","items":{"type":"string","example":"kittens"}},"SiteId":{},"CampaignId":{"type":"integer","example":123,"default":0},"Id":{"type":"integer","example":12345,"default":0},"IsGoalOverride":{"type":"boolean","example":true,"default":true},"StartDateISO":{"type":"string","example":"2017-05-01T12:00:00.0000000"},"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":"## A minimally viable ad:\ncurl -X POST -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" -H \"Content-Type:application/json\" \"https://api.kevel.co/v1/flight/12345/creative\" --data-binary '{\"Creative\":{\"Id\":12345},\"FlightId\":12345,\"IsActive\":true}'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function createAd() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let ad = await client.run('ad', 'create', {\n    creative: { id: 12345 },\n    flightId: 67890,\n    isActive: true,\n  });\n\n  console.log(ad);\n}\n\ncreateAd();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef create_ad()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    creative = {\n        id: 12345\n    }\n    data = {\n        flight_id: 67890,\n        creative: creative \n    }\n    pp client.ads.create(data)\nend\ncreate_ad()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/flight/{FlightID}/creative/{AdID}":{"put":{"summary":"Update Ad","description":"","operationId":"update-ad","parameters":[{"name":"FlightID","in":"path","description":"The ID of the Flight","schema":{"type":"integer","format":"int32"},"required":true},{"name":"AdID","in":"path","description":"This is the ID from the Ad / Creative Flight Map Endpoint. It's not the ID from the Create Creatives endpoint.","schema":{"type":"integer","format":"int32"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["Id","FlightID","Creative","IsActive","IsDeleted"],"properties":{"Id":{"type":"integer","description":"ID of the Creative Flight Map / Ad","format":"int32"},"CampaignID":{"type":"integer","description":"ID of the Campaign","format":"int32"},"FlightID":{"type":"integer","description":"ID of the Flight","format":"int32"},"Creative":{"type":"object","description":"A `creative` object that contains the ID (`id`) of the Creative","properties":{}},"IsActive":{"type":"boolean","description":"If Ad is active or not"},"IsDeleted":{"type":"boolean","description":"If Ad is deleted or not"},"Iframe":{"type":"boolean","description":"Whether Creative should use iFrame"},"DistributionType":{"type":"integer","description":"Determines how the Ad is distributed within the flight","format":"int32"},"RtbCustomFields":{"type":"string","description":"Required for RTB ads only. JSON Object in a String. It's JSON data provided by the RTB partner"},"AttributionSettings":{"type":"object","properties":{"AttributableItems":{"type":"array","description":"The set of products, categories, and brands that may be attributed to this Ad. See [Kevel Attribution](doc:attribution-overview) for more details.","items":{"properties":{"MatchType":{"type":"string","description":"The match type value determines the other keys included and corresponds to the Flight-level attribution setting for the specificity of the match.","enum":["SameProduct","SameCategoryBrand","SameBrand","SameMerchant"]},"ProductId":{"type":"string","description":"The Product ID to use with the match. Use with `\"MatchType\": \"SameProduct\"` only."},"MerchantId":{"type":"string","description":"The Merchant ID to use with the match. Use with `\"MatchType\": \"SameProduct\"` only."},"CategoryId":{"type":"string","description":"The Category ID to use with the match. Use with `\"MatchType\": \"SameCategoryBrand\"` only."},"BrandId":{"type":"string","description":"The Brand ID to use with the match. Use with `\"MatchType\": \"SameCategoryBrand\"` and `\"MatchType\": \"SameBrand\"`."}},"type":"object"}}}},"DontAffectParentFreqCap":{"type":"boolean","description":"\"Opts-out\" of frequency cap settings imposed on it by entities above","default":false},"FreqCap":{"type":"integer","description":"The value of the frequency cap","format":"int32"},"FreqCapDuration":{"type":"integer","description":"How long the frequency cap should apply","format":"int32"},"FreqCapType":{"type":"integer","description":"The unit for the frequency cap: `1 = Hour 2 = Day 3 = Minute`.","format":"int32"},"CategoryTargeting":{"type":"array","description":"The category targeting rules for the Ad, in the same format as on a Flight. An Ad that has category rules uses them instead of its Flight's rules, and the two lists are not merged. An Ad with no rules uses its Flight's rules. An Ad 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 ad. Please contact support.\" Set the field to `null` or `[]` to remove the Ad's 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":12345,"CampaignId":123,"Creative":{"Id":12345},"FlightId":1234,"IsActive":false,"SizeOverride":false,"IsDeleted":false,"Iframe":false,"DistributionType":1}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{  \n  \"Id\":12345,\n  \"CampaignId\":123,\n  \"FlightId\":1234,\n  \"ZoneId\":1234,\n  \"SiteId\":12345,\n  \"Iframe\":false,\n  \"Impressions\":0,\n  \"Percentage\":0,\n  \"DistributionType\":1,\n  \"IsDeleted\":false,\n  \"IsActive\":false,\n  \"Creative\": {  \n    \"Id\":123456,\n    \"Title\":\"Adzerk Blue Creative\",\n    \"ImageName\":\"\",\n    \"Url\":\"https://adzerk.com\",\n    \"Body\":\"\",\n    \"AdvertiserId\":1234,\n    \"IsActive\":true,\n    \"AdTypeId\":5,\n    \"Alt\":\"Adzerk - Native Ads\",\n    \"IsDeleted\":false,\n    \"IsSync\":false,\n    \"IsHTMLJS\":true,\n    \"ScriptBody\":\"Flight Creative Map\",\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\":null,\n  \"EndDate\":null,\n  \"GoalType\":1,\n  \"Goal\":20000,\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":12345,"default":0},"CampaignId":{"type":"integer","example":123,"default":0},"FlightId":{"type":"integer","example":1234,"default":0},"ZoneId":{"type":"integer","example":1234,"default":0},"SiteId":{"type":"integer","example":12345,"default":0},"Iframe":{"type":"boolean","example":false,"default":true},"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":123456,"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":1234,"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":"Flight Creative Map"},"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":{},"EndDate":{},"GoalType":{"type":"integer","example":1,"default":0},"Goal":{"type":"integer","example":20000,"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":"## A minimally viable ad update:\ncurl -X PUT -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" -H \"Content-Type:application/json\" \"https://api.kevel.co/v1/flight/123456/creative/12345\" --data-binary '{\"Id\":12345, \"IsDeleted\":false, \"Creative\":{\"Id\":1234567}, \"IsActive\":true, \"FlightId\":123456}'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function updateAd() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let updatedAd = await client.run('ad', 'update', {\n    id: 12345, \n    flightId: 67890,\n    isActive: false\n  });\n  console.log(updatedAd);\n}\n\nupdateAd();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef update_ad()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    ad_id = 12345\n    flight_id = 67890\n    data = client.ads.get(ad_id, flight_id)\n    data[:is_active] = true\n    data[:creative] = {id: data[:creative][:id]}\n    pp client.ads.update(data)\nend\nupdate_ad()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/flight/{FlightID}/dayparting":{"post":{"summary":"Create Day Part","description":"","operationId":"create-day-part","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":["StartTime","EndTime","WeekDays"],"properties":{"StartTime":{"type":"string","description":"A start time for the day part, in the format of `HH:MM:SS`. Uses the local time of the flight based on the flight's TimeZone. Granularity is at the minute level."},"EndTime":{"type":"string","description":"A start time for the day part, in the format of `HH:MM:SS`. Uses the local time of the flight based on the flight's TimeZone. Granularity is at the minute level."},"WeekDays":{"type":"array","description":"One or more days of the week the day part applies to, in the form of: `\"SU\" \"MO\" \"TU\" \"WE\" \"TH\" \"FR\" \"SA\"`","items":{"type":"string"}}}},"examples":{"Request Example":{"value":{"StartTime":"09:30:00","EndTime":"17:00:00","WeekDays":["MO","TU"]}}}}}},"responses":{"201":{"description":"201","content":{"application/json":{"examples":{"Result":{"value":"{\n  \"TimepartId\": 67890\n}"}},"schema":{"type":"object","properties":{"TimepartId":{"type":"integer","example":67890,"default":0}}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Overlap":{"value":"{\n  'message': 'Overlapping timeparts found. Failed verification.',\n  'error-code': 'FlightTimepartsOverlap'\n}"}}}}}},"deprecated":false,"x-readme":{"code-samples":[{"language":"curl","code":"curl -X POST -H \"X-Adzerk-ApiKey:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/flight/12345/dayparting\" -d '{\"StartTime\":\"09:30:00\",\"EndTime\":\"17:00:00\",\"WeekDays\":[\"MO\",\"TU\"]}'"},{"language":"javascript","code":"const Adzerk = require('@adzerk/management-sdk');\nconst apiKey = process.env.ADZERK_API_KEY;\n\nasync function createDayPart() {\n  let specifications = await Adzerk.fetchSpecifications();\n  let client = await Adzerk.buildClient({apiKey, specifications});\n\n  let dayPart = await client.run('dayPart', 'create', {\n    flightId: 12345,\n    startTime: '09:30:00',\n    endTime: '17:00:00',\n    weekDays: ['MO','TU']\n  });\n  console.log(dayPart);\n}\n\ncreateDayPart();"},{"language":"ruby","code":"require \"adzerk\"\n\ndef create_day_parting()\n    client = Adzerk::Client.new(ENV[\"ADZERK_API_KEY\"])\n    flight_id = 12345\n    data = {\n        start_time: '09:30:00',\n        end_time: '17:00:00',\n        week_days: ['MO','TU']\n    }\n    pp client.day_parts.create(flight_id, data)\nend\ncreate_day_parting()"}],"samples-languages":["curl","javascript","ruby"]}}},"/v1/advertiser/{advertiser_id}/asset":{"post":{"summary":"Create Asset","description":"Create a new Asset to get a direct Upload URL.","operationId":"create-asset","parameters":[{"name":"advertiser_id","in":"path","description":"The ID of the Kevel Advertiser that the Asset belongs to","schema":{"type":"integer","format":"int32"},"required":true}],"requestBody":{"content":{"application/json":{"schema":{"type":"object","required":["Name","Type"],"properties":{"Name":{"type":"string","description":"The Asset name."},"Type":{"type":"string","description":"The type of Asset.","enum":["video","image"]},"ContentURL":{"type":"string","description":"Optionally provide a link to your own externally hosted file instead of uploading a file to Kevel storage."}}}}}},"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n    \"Id\": 12345,\n    \"AdvertiserId\": 56789,\n    \"Name\": \"The Asset name\",\n    \"Status\": \"pending\",\n    \"Type\": \"video\",\n    \"UploadURL\": \"The direct upload URL\",\n    \"IsDeleted\": false\n}"}},"schema":{"type":"object","properties":{"Id":{"type":"integer","example":12345,"default":0},"AdvertiserId":{"type":"integer","example":56789,"default":0},"Name":{"type":"string","example":"The Asset name"},"Status":{"type":"string","example":"pending"},"Type":{"type":"string","example":"video"},"UploadURL":{"type":"string","example":"The direct upload URL"},"IsDeleted":{"type":"boolean","example":false,"default":true}}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}}},"deprecated":false}},"/v1/advertiser/{AdvertiserID}/asset":{"get":{"summary":"List Advertiser Assets","description":"Returns a list of assets for a given advertiser.","operationId":"list-advertiser-assets","parameters":[{"name":"AdvertiserID","in":"path","description":"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\": 12345,\n    \t\t\t\t\"AdvertiserId\": 56789,\n    \t\t\t\t\"Name\": \"The Asset name\",\n    \t\t\t\t\"Status\": \"pending\",\n    \t\t\t\t\"Type\": \"video\",\n   \t\t\t\t \t\"UploadURL\": \"The direct upload URL\",\n    \t\t\t\t\"IsDeleted\": 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":12345,"default":0},"AdvertiserId":{"type":"integer","example":56789,"default":0},"Name":{"type":"string","example":"The Asset name"},"Status":{"type":"string","example":"pending"},"Type":{"type":"string","example":"video"},"UploadURL":{"type":"string","example":"The direct upload URL"},"IsDeleted":{"type":"boolean","example":false,"default":true}}}}}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}}},"deprecated":false}},"/v1/asset":{"get":{"summary":"List Network Assets","description":"Returns a list of assets in your network.","operationId":"list-network-assets","responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n    \"pageSize\": 1,\n    \"items\": [\n        {\n            \"Id\": 12345,\n    \t\t\t\t\"AdvertiserId\": 56789,\n    \t\t\t\t\"Name\": \"The Asset name\",\n    \t\t\t\t\"Status\": \"pending\",\n    \t\t\t\t\"Type\": \"video\",\n   \t\t\t\t \t\"UploadURL\": \"The direct upload URL\",\n    \t\t\t\t\"IsDeleted\": false\n        }\n    ]\n}"}},"schema":{"type":"object","properties":{"pageSize":{"type":"integer","example":1,"default":0},"items":{"type":"array","items":{"type":"object","properties":{"Id":{"type":"integer","example":12345,"default":0},"AdvertiserId":{"type":"integer","example":56789,"default":0},"Name":{"type":"string","example":"The Asset name"},"Status":{"type":"string","example":"pending"},"Type":{"type":"string","example":"video"},"UploadURL":{"type":"string","example":"The direct upload URL"},"IsDeleted":{"type":"boolean","example":false,"default":true}}}}}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}}},"deprecated":false}},"/v1/asset/{AssetID}":{"get":{"summary":"Get Asset","description":"Returns a single asset.","operationId":"get-asset","parameters":[{"name":"AssetID","in":"path","description":"ID of the Asset","schema":{"type":"integer","format":"int32"},"required":true}],"responses":{"200":{"description":"200","content":{"application/json":{"examples":{"Result":{"value":"{\n    \"Type\": \"video\",\n    \"ContentURL\": \"https://stream.video-assets.kevel.com/F02sQ4e4VovltQ3xxxAMv008RpJufiNY.m3u8\",\n    \"IsDeleted\": false,\n    \"Status\": \"ready\",\n    \"AdvertiserId\": 45678,\n    \"Metadata\": {\n        \"Height\": 360,\n        \"Width\": 640,\n        \"FileExtension\": \".m3u8\",\n        \"AspectRatio\": \"16:9\",\n        \"Duration\": 15.006633,\n        \"PlaybackId\": \"F02sQ4e4VovltQ3xxxAMv008RpJufiNY\"\n    },\n    \"Name\": \"Example Video Asset\",\n    \"Id\": 1234\n}"}},"schema":{"type":"object","properties":{"Type":{"type":"string","example":"video"},"ContentURL":{"type":"string","example":"https://stream.video-assets.kevel.com/F02sQ4e4VovltQ3xxxAMv008RpJufiNY.m3u8"},"IsDeleted":{"type":"boolean","example":false,"default":true},"Status":{"type":"string","example":"ready"},"AdvertiserId":{"type":"integer","example":45678,"default":0},"Metadata":{"type":"object","properties":{"Height":{"type":"integer","example":360,"default":0},"Width":{"type":"integer","example":640,"default":0},"FileExtension":{"type":"string","example":".m3u8"},"AspectRatio":{"type":"string","example":"16:9"},"Duration":{"type":"number","example":15.006633,"default":0},"PlaybackId":{"type":"string","example":"F02sQ4e4VovltQ3xxxAMv008RpJufiNY"}}},"Name":{"type":"string","example":"Example Video Asset"},"Id":{"type":"integer","example":1234,"default":0}}}}}},"400":{"description":"400","content":{"application/json":{"examples":{"Result":{"value":"{}"}},"schema":{"type":"object","properties":{}}}}}},"deprecated":false}},"/v1/asset/{AssetID}/delete":{"post":{"summary":"Delete Asset","description":"Deletes a single asset.","operationId":"delete-asset","parameters":[{"name":"AssetID","in":"path","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}},"/v1/channel/{ChannelID}/sites":{"get":{"summary":"List Sites for a Channel","description":"List Sites within a given Channel.","operationId":"list-sites-for-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    \"pageSize\": 1,\n    \"items\": [\n        {\n            \"Created\": \"2024-01-01T00:00:00.000Z\",\n            \"Title\": \"iOS\",\n            \"IsDeleted\": false,\n            \"Url\": \"https://www.kevel.co\",\n            \"LastModified\": \"2024-01-01T00:00:00.000Z\",\n            \"Version\": 1,\n            \"Id\": 56789\n        },\n    ]\n}"}}}}},"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:$ADZERK_API_KEY\" \"https://api.kevel.co/v1/channel/12345/sites\""}],"samples-languages":["curl"]}}}},"x-readme":{"headers":[],"explorer-enabled":false,"proxy-enabled":true},"x-readme-fauxas":true}