Create a new campaign or modify an existing campaign - DEPRECATED

Creates or modifies a campaign. If the request includes a valid Campaign ID, the existing Campaign will be modified; if the ID field is omitted or the value is null, a new Campaign will be created.

Recent Requests
Log in to see full request history
TimeStatusUser Agent
Retrieving recent requests…
LoadingLoading…

Note

io_number and externalCampaignId both serve the same purpose and refer to the same value: an external ID for use by clients. These fields point to the same value; on input, a caller should use one field or the other, not both; on output, both fields are provided (currently), and will have the same value.

Request

POST /campaign/save

Request Body

NameTypeDescriptionRequired
idNumberCampaign ID.Required for update.
advertiserIdNumberAdvertiser ID associated with the campaign.Yes
nameStringCampaign name.Yes
domainStringThe advertiser domain for the campaign (e.g. viant.com).Yes
maxBudgetNumberTotal lifetime budget for the campaign in USD.Yes
dailyBudgetNumberMaximum daily spend in USD.No
dailyFrequencyCapNumberThe maximum number of impressions a user is exposed to per frequency cap time period duration. Note: The name of this field is misleading since it is not necessarily "daily". The name of this field remains unchanged for backwards compatibility and will be updated on the next major version. See frequencyCapDuration and frequencyCapTimePeriod.Yes (if frequencyCapDuration or frequencyCapTimePeriod present)
frequencyCapDurationNumberThe number of given frequencyCapTimePeriod.Yes (if dailyFrequencyCap or frequencyCapTimePeriod present)
frequencyCapTimePeriodString"MINUTE", "HOUR", "DAY"Yes (if dailyFrequencyCap or frequencyCapDuration present)
startDateNumberStart date (Unix time in milliseconds).Yes
endDateNumberEnd date (Unix time in milliseconds).Yes
iabCategoryString Array

An array of IAB category codes (e.g. "IAB8-6").

See reference table here

Yes
markupRateNumberMarkup as a decimal (e.g. 0.10 for 10%).No
lifetimeImpressionCapNumberLifetime impression cap.No
dailyImpressionCapNumberDaily impression cap.No
lifetimeClickCapNumberLifetime click cap.No
dailyClickCapNumberDaily click cap.No
ioNumberStringIO Number. Used as client ID; mutually exclusive with externalCampaignId.No
externalCampaignIdStringClient campaign ID; mutually exclusive with ioNumber.No
minBidMultiplierNumberMinimum bid multiplier.No
maxBidMultiplierNumberMaximum bid multiplier.No
flightsObject ArrayArray of campaign flights.Yes for campaign flights, No for order flights
autoAdvertisingBooleanWhether Viant AI is enabled for this campaign.No
pacingModeStringOne of: ASAP, SPEND_EVENLYNo
intradayFrontloadPctNumberIncrease hourly budget to frontload spend.No
objectiveStringOne of: AWARENESS, ENGAGEMENT, CONVERSIONNo

Response

JSON Fields Type Description
messagesObject ArrayAn array of any error messages.
messages[].levelStringError level.
messages[].codeStringError code.
messages[].messageStringError message.
entityObject ArrayAn array of campaign objects.
entity[].idNumberCampaign ID.
entity[].advertiserIdNumberAdvertiser ID associated with the campaign.
entity[].nameStringCampaign name.
entity[].domainStringThe advertiser domain for the campaign (e.g. viant.com).
entity[].maxBudgetNumberTotal lifetime budget for the campaign in USD.
entity[].dailyBudgetNumberMaximum daily spend in USD.
entity[].dailyFrequencyCap

Note: The name of this field is misleading since it is not necessarily "daily". The name of this field remains unchanged for backwards compatibility and will be updated on the next major version.
Number The maximum number of impressions a user is exposed to per frequency cap time period duration.

See frequencyCapDuration and frequencyCapTimePeriod.
entity[].frequencyCapDurationNumberThe number of given frequencyCapTimePeriod.
entity[].frequencyCapTimePeriodString"MINUTE", "HOUR", or "DAY"
entity[].startDateNumberStart date as Unix time in milliseconds.
entity[].endDateNumberEnd date as Unix time in milliseconds.
entity[].iabCategoryString ArrayIAB category codes associated with the campaign (e.g., "IAB8-6").
entity[].markupRateNumberPercentage markup (e.g., 0.10 for 10%).
entity[].lifetimeImpressionCapNumberLifetime impression cap.
entity[].dailyImpressionCapNumberDaily impression cap.
entity[].lifetimeClickCapNumberLifetime click cap.
entity[].dailyClickCapNumberDaily click cap.
entity[].ioNumberStringIO Number.
entity[].externalCampaignIdStringExternal (Client) campaign ID.
entity[].channelGroupStringDeprecated. Generally displays as "MOBILE_COMPUTER_CTV".
entity[].minBidMultiplierNumberMinimum bid multiplier.
entity[].maxBidMultiplierNumberMaximum bid multiplier.
entity[].hasFlightsBooleanTrue if this campaign has campaign flights (read-only).
entity[].flightsObject ArrayArray of Campaign Flights.
entity[].autoAdvertisingBooleanFlag indicating if Viant AI is enabled for this campaign.
entity[].pacingModeString One of:
  • ASAP
  • SPEND_EVENLY
entity[].intradayFrontloadPctNumberIncreases hourly budget to spend more at the beginning of the day.
entity[].objectiveString One of:
  • AWARENESS
  • ENGAGEMENT
  • CONVERSION

Examples

Request to create a new campaign

curl -u <user>:<password> -X POST -H "Content-Type: application/json" -d '{"id":null, "advertiserId":456, "name":"Retargeting Campaign", "domain":"bigbox.com", "maxBudget":100000, "dailyBudget":1000, "dailyFrequencyCap":5, "frequencyCapDuration":24, "frequencyCapTimePeriod":"HOUR", "startDate":1464739200000, "endDate":1483228800000, "agencyCommissionRate":0.10, "iabCategory":["IAB22", "IAB18"], "lifetimeImpressionCap": 100000,"dailyImpressionCap": 100,"lifetimeClickCap": 15000,"dailyClickCap": 10,"ioNumber": "12345"}' https://sandbox-api.viant.com/v1/campaign/save

Since the ID field is null, this creates a new campaign.

Response

{
  "messages": [],
  "entity": {
    "id": 92,
    "advertiserId": 456,
    "name": "Retargeting Campaign",
    "domain": "bigbox.com",
    "maxBudget": 100000,
    "dailyBudget": 1000,
    "dailyFrequencyCap": 5,
    "frequencyCapDuration": 24,
    "frequencyCapTimePeriod": "HOUR",
    "startDate": 1464739200000,
    "endDate": 1483228800000,
    "markupRate": 0.10,
    "iabCategory": [
      "IAB22",
      "IAB18"
    ],
    "lifetimeImpressionCap": 100000,
    "dailyImpressionCap": 100,
    "lifetimeClickCap": 15000,
    "dailyClickCap": 10,
    "ioNumber": "12345",
    "externalCampaignId": "12345",
    "channelGroup": "MOBILE_COMPUTER_CTV",
    "minBidMultiplier": null,
    "maxBidMultiplier": null,
    "autoAdvertising": false,
    "pacingMode": "SPEND_EVENLY",
    "intradayFrontloadPct": 0.0,
    "hasFlights": false,
    "flights": []
  }
}

Request to edit an existing campaign

curl -u <user>:<password> -X POST -H "Content-Type: application/json" -d '{"id":null, "advertiserId":456, "name":"Retargeting Campaign", "domain":"bigbox.com", "maxBudget":100000, "dailyBudget":2000, "dailyFrequencyCap":5, "frequencyCapDuration":3, "frequencyCapTimePeriod":"DAY", "startDate":1464739200000, "endDate":1483228800000, "agencyCommissionRate":0.10, "iabCategory":["IAB22", "IAB18"],"lifetimeImpressionCap": 100000,"dailyImpressionCap": 100, "lifetimeClickCap": 15000, "dailyClickCap": 10,"ioNumber": "12345"}' https://sandbox-api.viant.com/v1/campaign/save

In this example we updated the daily max budget of the previously created campaign.

Response

{
  "messages": [],
  "entity": {
    "id": 92,
    "advertiserId": 456,
    "name": "Retargeting Campaign",
    "domain": "bigbox.com",
    "maxBudget": 100000,
    "dailyBudget": 2000,
    "dailyFrequencyCap": 5,
    "frequencyCapDuration": 3,
    "frequencyCapTimePeriod": "DAY",
    "startDate": 1464739200000,
    "endDate": 1483228800000,
    "markupRate": 0.10,
    "iabCategory": [
      "IAB22",
      "IAB18"
    ],
    "lifetimeImpressionCap": 100000,
    "dailyImpressionCap": 100,
    "lifetimeClickCap": 15000,
    "dailyClickCap": 10,
    "ioNumber": "12345",
    "externalCampaignId": "12345",
    "channelGroup": "MOBILE_COMPUTER_CTV",
    "minBidMultiplier": null,
    "maxBidMultiplier": null,
    "autoAdvertising": false,
    "pacingMode": "SPEND_EVENLY",
    "intradayFrontloadPct": 0.0,
    "hasFlights": false,
    "flights": []
  }
}

Request to create a new campaign with campaign flights

curl -u <user>:<password> -X POST -H "Content-Type: application/json" -d '{"id": null,"advertiserId": 55812,"name": "New Campaign with Campaign Flights","domain": "viant.com","iabCategory": ["IAB1-1"],"channelGroup": "MOBILE_COMPUTER_CTV","flights": [{"id": null,"status": null,"budgetType": "AUTO_BUDGET","dailyBudget": null,"dailyFrontload": 0.0,"maxBudget": 90.0,"remainingBudget": null,"dailyImpCap": null,"lifetimeImpCap": null,"startDate": 1631836800000,"endDate": 1633046340000}]}' https://sandbox-api.viant.com/v1/campaign/save

Response

{
  "messages": [],
  "entity": {
    "id": 303435,
    "advertiserId": 55812,
    "name": "New Campaign with Campaign Flights",
    "domain": "viant.com",
    "maxBudget": 90.0,
    "dailyBudget": null,
    "dailyFrequencyCap": null,
    "frequencyCapDuration": null,
    "frequencyCapTimePeriod": null,
    "startDate": 1631836800000,
    "endDate": 1633046340000,
    "iabCategory": [
      "IAB1-1"
    ],
    "markupRate": null,
    "lifetimeImpressionCap": null,
    "dailyImpressionCap": null,
    "lifetimeClickCap": null,
    "dailyClickCap": null,
    "ioNumber": null,
    "externalCampaignId": null,
    "channelGroup": "MOBILE_COMPUTER_CTV",
    "minBidMultiplier": null,
    "maxBidMultiplier": null,
    "autoAdvertising": false,
    "pacingMode": "SPEND_EVENLY",
    "intradayFrontloadPct": 0.0,
    "hasFlights": true,
    "flights": [
      {
        "id": 1,
        "status": "ACTIVE",
        "budgetType": "AUTO_BUDGET",
        "dailyBudget": null,
        "dailyFrontload": 0.0,
        "maxBudget": 90.0,
        "remainingBudget": null,
        "dailyImpCap": null,
        "lifetimeImpCap": null,
        "startDate": 1631836800000,
        "endDate": 1633046340000
      }
    ]
  }
}
Body Params
string
int32
required
string
required
string
required
number
int32
required
string
number
int32
int32
required
int32
string
enum
Allowed:
int64
required
int64
required
iabCategory
array of strings
required
iabCategory*
int32
int32
int32
int32
string
string
string
number
number
boolean
flights
array of objects
flights
string
enum
Allowed:
string
Responses

401

Unauthorized

403

Forbidden

404

Not Found

Language
Credentials
Basic
base64
:
URL
LoadingLoading…
Response
Click Try It! to start a request and see the response here! Or choose an example:
application/json