modify

Edit campaign (flight) parameters.

Request format

https://adfox.yandex.com/api/v1
  ? object=campaign
  & action=modify
  & objectID=integer
  & [name=<string>]
  & [advertiserID=<integer>]
  & [assistantID=<integer>]
  & [kind_id=<integer>]
  & [level=<integer>]
  & [priority=<integer>]
  & [status=<integer>]
  & [sectorID=<integer>]
  & [rotationMethodID=<integer>]
  & [trafficPercents=<integer>]
  & [targetingProfileID=<integer>]
  & [isSession=<integer>]
  & [minCtr=<float>]
  & [optimizationMode=<string>]
  & [impressionsSmoothTypeID=<integer>]
  & [isTrafficSmooth=<integer>]
  & [maxImpressions=<integer>]
  & [maxImpressionsPerDay=<integer>]
  & [maxClicks=<integer>]
  & [maxClicksPerDay=<integer>]
  & [maxClicksPerHour=<integer>]
  & [dateStart=<YYYY-MM-DD HH:mm>]
  & [dateEnd=<YYYY-MM-DD HH:mm>]
  & [logicType=<integer>]
  & [cpm=<integer>]
  & [cpc=<integer>]
  & [sendToErir=<integer>]
  & [contractID=<integer>]
  & [publisherContractID=<integer>]
  & [costType=<integer>]
  & [markingAdvertiserInfo=<string>]

name

Name of the new campaign (flight).

An entry can contain Russian and Latin letters, numbers, and any special characters.

advertiserID

Advertiser ID.

If a campaign is added to a supercampaign, the advertiser is not specified and is inherited from the supercampaign.

Read also:

assistantID

ID of the assistant who will be allowed access to the object according to their permissions.

If a campaign is added to a supercampaign, the assistant is not specified and is inherited from the supercampaign.

Read also:

kind_id

Defines the campaign type.

Acceptable values:

  • 1: Guarantee type. It's used for campaigns with guaranteed sales where there are ad running obligations. Includes the dependence of two parameters:

    • The level parameter can only take values from 1 to 10. If the level parameter isn't passed, the default value 1 is used.
    • The cpm parameter isn't required. If it's passed, its value is ignored.
  • 2: The Dynamic monetization type allows the publisher to receive the highest revenue from impressions, enabling the Yandex Advertising Network to compete for impressions of non-guaranteed ad campaigns. Campaigns are prioritized by CPM. Includes the dependence of two parameters:

    • The level parameter must be equal to 11. If the level parameter isn't passed, the default value 11 is used.
    • The cpm parameter is required and must be > 0.

    If the ad campaign was created with an external monetizer, you can't change Campaign type. Its value must be 2.

  • 3: Promo type. It's used for custom promotion campaigns and placeholders. Includes the dependence of two parameters:

    • The level parameter can only take values from 12 to 20. If the level parameter isn't passed, the default value 12 is used.
    • The cpm parameter isn't required. If it's passed, its value is ignored.

Default value: 1.

level

Campaign level.

How many campaign levels are available depends on whether you have enabled the Campaign types module in your account.

If the Campaign types module is disabled, you can use the following values: from 1 to 10 (inclusive).

Default value: 1.

When the Campaign types module is enabled, you can use the following values:

  • From 1 to 10 (inclusive): For Guarantee campaigns (kind_id=1).
  • 11: For Dynamic monetization campaigns (kind_id=2).
  • From 12 to 20: For Promo campaigns (kind_id=3).

Pay attention to the dependence of the kind_id and cpm parameter values.

priority

Priority.

Acceptable values: 1≤N≤1000, where N is a number from 1 to 1000 inclusive.

Default value: 100.

status

Object status. Only objects with the active status can be displayed.

Acceptable values:

  • 0: Active. The object is ready for delivery.
  • 1: Paused. The object is assumed to be temporarily disabled. By default, filters in the Adfox web interface show paused objects in the list.
  • 2: Completed. The object is assumed to be delivered in full. By default, filters in the Adfox web interface hide completed objects.

Default value: 0.

sectorID

Industry.

For more information on how to get the list of industries, see utility-sector.

rotationMethodID

Campaign rotation method.

Acceptable values:

  • 0: By priority. Use the values of the level and priority parameters to determine the probability of your ad campaign being served.

  • 1: By percentage of traffic. Use the value of the trafficPercents parameter to determine the likelihood of your ad campaign being served. The trafficPercents parameter is required.

Default value: 0.

trafficPercents

Traffic percentage.

Required if the traffic percentage rotation method is used (rotationMethodID=1).

Acceptable values: from 1 to 100.

targetingProfileID

Targeting profile ID.

You can use a targeting profile to combine the settings of several targeting types. When creating a campaign or banner, you can specify a targeting profile. This way, you don't waste time setting up every targeting type separately.

To learn how to list profile IDs, see the list-targetingProfile section.

isSession

Session impressions.

Acceptable values:

  • 0: Disable.
  • 1: Enable.

Default value: 0.

minCtr

Minimum allowed CTR value as a percentage. Acceptable values: from 0 to 100.

Default value: 0.

optimizationMode

Banner impression optimization that automatically redistributes impressions among banners within a single campaign based on their actual effectiveness.

Acceptable values:

  • none: Don't use optimization.
  • ctr: Optimize impressions based on CTR. Read also: Add a campaign.

Default value: none.

impressionsSmoothTypeID

Deliver impressions.

Acceptable values:

  • 0: As fast as possible. Campaign banners are served at the maximum possible speed until the impression limits are reached (if specified). The maximum delivery speed doesn't require you to set limits or specify campaign start and end dates.

  • 1: Spread evenly throughout the day. Impressions are uniformly distributed throughout the day. Make sure to specify the maximum number of impressions per day (maxImpressionsPerDay).

  • 2: Spread evenly throughout the entire period. The campaign impressions are distributed evenly over the entire period based on account statistics. Make sure to specify the maximum number of impressions (maxImpressions) and the ad campaign end date (dateEnd).

  • 3: Spread evenly throughout the entire period (automatic prolongation). The campaign impressions are distributed evenly over the entire period based on account statistics. If the campaign doesn't reach the impression limit in the allocated time, it's automatically extended for one day and runs at the maximum speed on that day. Make sure to specify the maximum number of impressions (maxImpressions) and the ad campaign end date (dateEnd).

  • 4: Maximum at the beginning of campaign delivery. Impressions are distributed unevenly: the system schedules more impressions in the first days of placement and gradually decreases them toward the end of the campaign. This reduces the risk of campaign underdelivery if the available inventory gets unexpectedly limited at the end of the campaign period. Make sure to specify the maximum number of impressions (maxImpressions) and the ad campaign end date (dateEnd).

Default value: 0.

isTrafficSmooth

Spread evenly throughout the day.

Acceptable values:

  • 0: Disable.
  • 1: Enable.

maxImpressions

Maximum number of banner impressions.

Acceptable values: an integer from 1 to 2147483647.

maxImpressionsPerDay

Maximum number of impressions per day.

Acceptable values: an integer from 1 to 2147483647.

maxClicks

Maximum total number of click-throughs.

Acceptable values: an integer from 1 to 2147483647.

maxClicksPerDay

Maximum number of clicks per day.

Acceptable values: an integer from 1 to 2147483647.

maxClicksPerHour

Maximum number of clicks per hour.

Acceptable values: an integer from 1 to 2147483647.

dateStart

Ad running start date.

Date and time transmission format: YYYY-MM-DD HH:mm.

Default value: today from 00:00.

dateEnd

Ad running end date.

Date and time transmission format: YYYY-MM-DD HH:mm.

logicType

Campaign logic type. Not required for a campaign inside a supercampaign.

Acceptable values:

Default value: 0.

cpm

CPM threshold value for an ad campaign of the Dynamic monetization type.

For kind_id=2, the parameter is required.

For kind_id=1|3, this parameter is optional. If it's passed, its value is ignored.

Acceptable values: integers from 1 to 99999.

If CPM is passed, don't pass CPC.

cpc

CPC threshold value for an ad campaign of the Dynamic monetization type.

For kind_id=2, the parameter is required.

For kind_id=1|3, this parameter is optional. If it's passed, its value is ignored.

Acceptable values: integers greater than 0.

If CPC is passed, don't pass CPM.

sendToErir

Submit data to the state register (ERIR).

Acceptable values:

  • 0: Do not submit data to the state register.
  • 1: Submit data to state register (labeling enabled).

Default value: 0.

contractID

ID of a direct or primary contract.

This parameter is required if sendToErir=1. Learn more about getting a list of contracts.

Note

If you change this parameter, any banners in this campaign with labeling enabled are resubmitted to the state register for a review.

publisherContractID

ID of the contract with the end advertiser.

Required if contractID points to a primary contract.

costType

Campaign type.

Acceptable values:

  • 0: Other.
  • 1: CPM.
  • 2: CPC.
  • 3: CPA.

Default value: 0.

Note

If you change this parameter, any banners in this campaign with labeling enabled are resubmitted to the state register for a review.

markingAdvertiserInfo

Advertiser information as shown in the banner menu. Displayed when the Show banner menu option is enabled for the banner. The default value is an empty string.

Response format

<response>
  <status>
    <code>{integer}</code>
  </status>
</response>

Response parameters

code

Request processing status. If the value is 0, the request was completed successfully. For the key, see Error handling.

Sample request and response

Request:

https://adfox.yandex.com/api/v1?object=campaign&action=modify&objectID=39377&advertiserID=4567

Response:

<response>
  <status>
    <code>0</code>
  </status>
</response>

Other actions with the object

Read also about other actions with the campaign object:

Name of the new campaign (flight).

An entry can contain Russian and Latin letters, numbers, and any special characters.

Advertiser ID.

If a campaign is added to a supercampaign, the advertiser is not specified and is inherited from the supercampaign.

Read also:

ID of the assistant who will be allowed access to the object according to their permissions.

If a campaign is added to a supercampaign, the assistant is not specified and is inherited from the supercampaign.

Read also:

Defines the campaign type.

Acceptable values:

  • 1: Guarantee type. It's used for campaigns with guaranteed sales where there are ad running obligations. Includes the dependence of two parameters:

    • The level parameter can only take values from 1 to 10. If the level parameter isn't passed, the default value 1 is used.
    • The cpm parameter isn't required. If it's passed, its value is ignored.
  • 2: The Dynamic monetization type allows the publisher to receive the highest revenue from impressions, enabling the Yandex Advertising Network to compete for impressions of non-guaranteed ad campaigns. Campaigns are prioritized by CPM. Includes the dependence of two parameters:

    • The level parameter must be equal to 11. If the level parameter isn't passed, the default value 11 is used.
    • The cpm parameter is required and must be > 0.

    If the ad campaign was created with an external monetizer, you can't change Campaign type. Its value must be 2.

  • 3: Promo type. It's used for custom promotion campaigns and placeholders. Includes the dependence of two parameters:

    • The level parameter can only take values from 12 to 20. If the level parameter isn't passed, the default value 12 is used.
    • The cpm parameter isn't required. If it's passed, its value is ignored.

Default value: 1.

Campaign level.

How many campaign levels are available depends on whether you have enabled the Campaign types module in your account.

If the Campaign types module is disabled, you can use the following values: from 1 to 10 (inclusive).

Default value: 1.

When the Campaign types module is enabled, you can use the following values:

  • From 1 to 10 (inclusive): For Guarantee campaigns (kind_id=1).
  • 11: For Dynamic monetization campaigns (kind_id=2).
  • From 12 to 20: For Promo campaigns (kind_id=3).

Pay attention to the dependence of the kind_id and cpm parameter values.

Priority.

Acceptable values: 1≤N≤1000, where N is a number from 1 to 1000 inclusive.

Default value: 100.

Object status. Only objects with the active status can be displayed.

Acceptable values:

  • 0: Active. The object is ready for delivery.
  • 1: Paused. The object is assumed to be temporarily disabled. By default, filters in the Adfox web interface show paused objects in the list.
  • 2: Completed. The object is assumed to be delivered in full. By default, filters in the Adfox web interface hide completed objects.

Default value: 0.

Industry.

For more information on how to get the list of industries, see utility-sector.

Campaign rotation method.

Acceptable values:

  • 0: By priority. Use the values of the level and priority parameters to determine the probability of your ad campaign being served.

  • 1: By percentage of traffic. Use the value of the trafficPercents parameter to determine the likelihood of your ad campaign being served. The trafficPercents parameter is required.

Default value: 0.

Traffic percentage.

Required if the traffic percentage rotation method is used (rotationMethodID=1).

Acceptable values: from 1 to 100.

Targeting profile ID.

You can use a targeting profile to combine the settings of several targeting types. When creating a campaign or banner, you can specify a targeting profile. This way, you don't waste time setting up every targeting type separately.

To learn how to list profile IDs, see the list-targetingProfile section.

Session impressions.

Acceptable values:

  • 0: Disable.
  • 1: Enable.

Default value: 0.

Deliver impressions.

Acceptable values:

  • 0: As fast as possible. Campaign banners are served at the maximum possible speed until the impression limits are reached (if specified). The maximum delivery speed doesn't require you to set limits or specify campaign start and end dates.

  • 1: Spread evenly throughout the day. Impressions are uniformly distributed throughout the day. Make sure to specify the maximum number of impressions per day (maxImpressionsPerDay).

  • 2: Spread evenly throughout the entire period. The campaign impressions are distributed evenly over the entire period based on account statistics. Make sure to specify the maximum number of impressions (maxImpressions) and the ad campaign end date (dateEnd).

  • 3: Spread evenly throughout the entire period (automatic prolongation). The campaign impressions are distributed evenly over the entire period based on account statistics. If the campaign doesn't reach the impression limit in the allocated time, it's automatically extended for one day and runs at the maximum speed on that day. Make sure to specify the maximum number of impressions (maxImpressions) and the ad campaign end date (dateEnd).

Default value: 0.

Spread evenly throughout the day.

Acceptable values:

  • 0: Disable.
  • 1: Enable.

Maximum number of banner impressions.

Acceptable values: an integer from 1 to 2147483647.

Maximum number of impressions per day.

Acceptable values: an integer from 1 to 2147483647.

Maximum total number of click-throughs.

Acceptable values: an integer from 1 to 2147483647.

Maximum number of clicks per day.

Acceptable values: an integer from 1 to 2147483647.

Maximum number of clicks per hour.

Acceptable values: an integer from 1 to 2147483647.

Ad running start date.

Date and time transmission format: YYYY-MM-DD HH:mm.

Default value: today from 00:00.

Ad running end date.

Date and time transmission format: YYYY-MM-DD HH:mm.

Campaign logic type. Not required for a campaign inside a supercampaign.

Acceptable values:

Default value: 0.

CPM threshold value for an ad campaign of the Dynamic monetization type.

For kind_id=2, the parameter is required.

For kind_id=1|3, this parameter is optional. If it's passed, its value is ignored.

Acceptable values: integers from 1 to 99999.

If CPM is passed, don't pass CPC.

CPC threshold value for an ad campaign of the Dynamic monetization type.

For kind_id=2, the parameter is required.

For kind_id=1|3, this parameter is optional. If it's passed, its value is ignored.

Acceptable values: integers greater than 0.

If CPC is passed, don't pass CPM.

Submit data to the state register (ERIR).

Acceptable values:

  • 0: Do not submit data to the state register.
  • 1: Submit data to state register (labeling enabled).

Default value: 0.

ID of a direct or primary contract.

This parameter is required if sendToErir=1. Learn more about getting a list of contracts.

Note

If you change this parameter, any banners in this campaign with labeling enabled are resubmitted to the state register for a review.

ID of the contract with the end advertiser.

Required if contractID points to a primary contract.

Campaign type.

Acceptable values:

  • 0: Other.
  • 1: CPM.
  • 2: CPC.
  • 3: CPA.

Default value: 0.

Note

If you change this parameter, any banners in this campaign with labeling enabled are resubmitted to the state register for a review.

Minimum allowed CTR value as a percentage. Acceptable values: from 0 to 100.

Default value: 0.

Banner impression optimization that automatically redistributes impressions among banners within a single campaign based on their actual effectiveness.

Acceptable values:

  • none: Don't use optimization.
  • ctr: Optimize impressions based on CTR. Read also: Add a campaign.

Default value: none.

Advertiser information as shown in the banner menu. Displayed when the Show banner menu option is enabled for the banner. The default value is an empty string.

Previous
Next