add

Restrictions

The ad type must match the ad group type. See the table in Ad type.

You can't add ads to an archived campaign.

Maximum of 1000 ads per method call.

To get the limit on the number of ads per group for an advertiser, use the method Clients.get or AgencyClients.get (see the ADS_TOTAL_PER_ADGROUP element in the Restrictions array).

Request

Request structure in JSON format:

{
  "method": "add",
  "params": { /* params */
    "Ads": [{  /* AdAddItem */
      "AdGroupId": (long), /* required */ 
      "TextAd": {  /* TextAdAdd */
        "Title": (string), /* required */
        "Title2": (string),
        "Text": (string), /* required */
        "Href": (string),
        "Mobile": ( "YES" | "NO" ), /* required */
        "DisplayUrlPath": (string),
        "VCardId": (long),
        "AdImageHash": (string),
        "SitelinkSetId": (long),
        "AdExtensionIds": [(long), ... ],
        "VideoExtension": {  /* VideoExtensionAddItem */
          "CreativeId": (long)
        },
        "PriceExtension": {  /* PriceExtensionAddItem */
          "Price": (long), /* required */
          "OldPrice": (long),
          "PriceQualifier": ( "FROM" | "UP_TO" | "NONE" ), /* required */
          "PriceCurrency": ( "RUB" | "BYN" | "CHF" | "EUR" | "KZT" | "TRY" | "UAH" | "USD" ) /* required */
        },
        "TurboPageId": (long)
      },
      "DynamicTextAd": {  /* DynamicTextAdAdd */
        "VCardId": (long),
        "AdImageHash": (string),
        "SitelinkSetId": (long),
        "AdExtensionIds": [(long), ... ],
        "Text": (string) /* required */
      },
      "MobileAppAd": {  /* MobileAppAdAdd */
        "AdImageHash": (string),
        "Text": (string), /* required */
        "Title": (string), /* required */
        "TrackingUrl": (string),
        "Action": ( "DOWNLOAD" | "GET" | "INSTALL" | "MORE" | "OPEN" | "UPDATE" | "PLAY" | "BUY_AUTODETECT" ), /* required */
        "Features": [{  /* MobileAppAdFeatureItem */
          "Feature": ( "PRICE" | "ICON" | "CUSTOMER_RATING" | "RATINGS" ), /* required */
          "Enabled": ( "YES" | "NO" ) /* required */
        }, ... ],
        "AgeLabel": ( "AGE_0" | ... | "AGE_18" )
      },
      "TextImageAd": {  /* TextImageAdAdd */
        "AdImageHash": (string), /* required */
        "Href": (string), 
        "TurboPageId": (long)
      },
      "MobileAppImageAd": {  /* MobileAppImageAdAdd */
        "AdImageHash": (string), /* required */
        "TrackingUrl": (string)
      },
      "TextAdBuilderAd": {  /* TextAdBuilderAdAdd */
        "Creative": { /* AdBuilderAdAddItem */
          "CreativeId": (long) /* required */
        }, /* required */
        "Href": (string), 
        "TurboPageId": (long)
      },
      "MobileAppAdBuilderAd": {  /* MobileAppAdBuilderAdAdd */
        "Creative": { /* AdBuilderAdAddItem */
          "CreativeId": (long) /* required */
        }, /* required */
        "TrackingUrl": (string)
      },
      "CpmBannerAdBuilderAd": {  /* CpmBannerAdBuilderAdAdd */
        "Creative": { /* AdBuilderAdAddItem */
          "CreativeId": (long) /* required */
        }, /* required */      
        "Href": (string), 
        "TrackingPixels": { /* ArrayOfString */
          "Items": [(string), ... ] /* required */
        },
        "TurboPageId": (long)
      },
      "CpcVideoAdBuilderAd": {  /* CpcVideoAdBuilderAdAdd */
        "Creative": { /* AdBuilderAdAddItem */
          "CreativeId": (long) /* required */
        }, /* required */
        "Href": (string), 
        "TurboPageId": (long)
      },
      "CpmVideoAdBuilderAd": {  /* CpmVideoAdBuilderAdAdd */
        "Creative": { /* AdBuilderAdAddItem */
          "CreativeId": (long) /* required */
        }, /* required */
        "Href": (string), 
        "TrackingPixels": { /* ArrayOfString */
          "Items": [(string), ... ] /* required */
        },
        "TurboPageId": (long)
      }
    }, ... ] /* required */
  } 
}
Parameter Type Description Required
Params structure (for JSON) / AddRequest structure (for SOAP)
Ads array of AdAddItem

Ads to add.

Yes
AdAddItem structure
AdGroupId long ID of the group that the ad is being created in. Yes
TextAd TextAdAdd Parameters of a text and image ad. See Ad type. Either TextAd, or MobileAppAd, or DynamicTextAd, or TextImageAd, or MobileAppImageAd, or TextAdBuilderAd, or MobileAppAdBuilderAd, or CpcVideoAdBuilderAd, or CpmBannerAdBuilderAd, or CpmVideoAdBuilderAd
DynamicTextAd DynamicTextAdAdd Parameters of a dynamic ad.
MobileAppAd MobileAppAdAdd Parameters of a mobile app ad.
TextImageAd TextImageAdAdd Parameters of an image ad to create from an image (when adding it to a group of text and image ads).
MobileAppImageAd MobileAppImageAdAdd Parameters of an image ad to create from an image (when adding it to a group of mobile app ads).
TextAdBuilderAd TextAdBuilderAdAdd Parameters of an image ad to create from a creative (when adding it to a group of text and image ads).
MobileAppAdBuilderAd MobileAppAdBuilderAdAdd Parameters of an image ad to create from a creative (when adding it to a group of mobile app ads).
CpmBannerAdBuilderAd CpmBannerAdBuilderAdAdd Display ad parameters.
CpcVideoAdBuilderAd CpcVideoAdBuilderAdAdd Parameters of a video ad in a “Text & Image Ads” campaign.
CpmVideoAdBuilderAd CpmVideoAdBuilderAdAdd Parameters of a video display ad in a “Display campaign”.
TextAdAdd structure
Title string

Title 1.

Maximum of 35 characters not counting "narrow" characters, plus up to 15 "narrow" characters. Maximum of 22 characters per word. If using a template, the # character isn't counted in the length.

Yes
Title2 string

Title 2.

Maximum of 30 characters not counting "narrow" characters, plus up to 15 "narrow" characters. Maximum of 22 characters per word. If using a template, the # character isn't counted in the length.

No
Text string

Ad text.

Maximum of 81 characters not counting "narrow" characters, plus up to 15 "narrow" characters. Maximum of 23 characters per word. If using a template, the # character isn't counted in the length.

Yes
Mobile YesNoEnum Indicates whether this is a mobile ad: YES or NO. See Mobile ads in the Help for Yandex.Direct. Yes
Href string

Link to the advertiser's website. Maximum of 1024 characters. If using a template, the # character isn't counted in the length.

It must include the protocol and domain name. May contain substitution variables.

At least one of the parameters Href, TurboPageId or VCardId (or all may be present)
TurboPageId long ID of the Turbo page.
VCardId long ID of the vCard. The vCard must belong to the same campaign as the ad.
AdImageHash string

Hash of the image.

For text and image ads, only images with the REGULAR or WIDE type are acceptable. See Image type.
No
SitelinkSetId long ID of a set of sitelinks. Allowed only with the Href or TurboPageId parameter. No
DisplayUrlPath string

Display link. Allowed only with the Href parameter. Maximum of 20 characters. If using a template, the # character isn't counted in the length.

It may contain letters, numbers, and the symbols -, №, /, %, #. Spaces, underscores (_), and the double characters -- and // are not allowed.

See Display link in the Help for Yandex.Direct.

No
AdExtensionIds array of long IDs of extensions. Maximum of 50 items in the array. No
VideoExtension VideoExtensionAddItem

Video extension.

See the section Video extensions in the Help for Yandex.Direct.

No
PriceExtension PriceExtensionAddItem Price in the ad. No
VideoExtensionAddItem structure
CreativeId long

ID of the creative.

To get the ID of a creative, use the Creatives.get method.

Yes
PriceExtensionAddItem structure
Price long

The price of a product or service multiplied by 1,000,000. An integer that is a multiple of 10,000 (the price with two digits after the decimal point). Maximum value: 10,000,000,000,000,000.

Yes
OldPrice long The previous price of a product or service multiplied by 1,000,000. An integer that is a multiple of 10,000. The old price must be higher than the current price. No
PriceQualifier PriceQualifierEnum

Text explanation of the price:

  • FROM — “From”.
  • UP_TO — “To”.
  • NONE — No explanation.
Yes
PriceCurrency PriceCurrencyEnum The currency that the price is shown in. Yes
DynamicTextAdAdd structure
VCardId long ID of the vCard. The vCard must belong to the same campaign as the ad. No
AdImageHash string

Hash of the image.

For dynamic ads, only images with the REGULAR or WIDE type are acceptable. See Image type.

No
SitelinkSetId long ID of a set of sitelinks. No
AdExtensionIds array of long IDs of extensions. Maximum of 50 items in the array. No
Text string

Ad text.

Maximum of 81 characters not counting "narrow" characters, plus up to 15 "narrow" characters. Maximum of 23 characters per word. If using a template, the # character isn't counted in the length.

Yes
MobileAppAdAdd structure
AdImageHash string

Hash of the image.

For mobile app ads, only images with the WIDE type are acceptable. See Image type.

No
Text string

Ad text.

Maximum of 75 characters, counting “narrow” characters. Maximum of 23 characters per word. If using a template, the # character isn't counted in the length.

Yes
Title string

Header.

Maximum of 33 characters, counting “narrow” characters. Maximum of 22 characters per word. If using a template, the # character isn't counted in the length.

Yes
TrackingUrl string Tracking link for tracking app installations. Maximum of 1024 characters. It must include the protocol and domain name. No
Action MobileAppAdActionEnum

The button label:

  • DOWNLOAD — “Download”

  • GET — “Get”

  • INSTALL — “Install”

  • MORE — “More”

  • OPEN — “Open”

  • UPDATE — “Update”

  • PLAY — “Play”

  • BUY_AUTODETECT — The label depends on the application price: “Buy” if the price is something other than zero, or “Free” if the price is set to zero.

Yes
Features array of MobileAppAdFeatureItem Add-ons that need to be automatically downloaded from the app store and displayed in the ad. No
AgeLabel MobAppAgeLabelEnum Age restriction. The default value is AGE_18. No
MobileAppAdFeatureItem structure
Feature MobileAppFeatureEnum

Type of extension:

  • PRICE — price
  • ICON — icon
  • CUSTOMER_RATING — rating
  • RATINGS — number of ratings (shown only if the rating is displayed)

If the add-on type is omitted from the Features array, the add-on is not shown.

Yes
Enabled YesNoEnum

Whether to display an add-on in the ad.

Note.
  • If the add-on couldn't be downloaded from the app store, the YES value is available, but this add-on is not shown when displaying the ad.
  • The number of ratings is only shown together with the average rating: if NO is set for the CUSTOMER_RATING type, but YES is set for RATINGS, the number of ratings is not displayed.
Yes
TextImageAdAdd structure
AdImageHash string

Hash of the image.

For image ads, only images with the FIXED_IMAGE type are acceptable. See Image type.

Yes
Href string

Link to the advertiser's website. Maximum of 1024 characters. If using a template, the # character isn't counted in the length.

It must include the protocol and domain name. May contain substitution variables.

One or both of the Href and TurboPageId parameters
TurboPageId long ID of the Turbo page.
MobileAppImageAdAdd structure
AdImageHash string

Hash of the image.

For image ads, only images with the FIXED_IMAGE type are acceptable. See Image type.

Yes
TrackingUrl string Tracking link for tracking app installations. Maximum of 1024 characters. It must include the protocol and domain name. No
TextAdBuilderAdAdd structure
Creative AdBuilderAdAddItem

A creative that was created in the Ad Builder.

See the section Creative Ad Builder for image ads in the Help for Yandex.Direct.

Yes
Href string

Link to the advertiser's website. Maximum of 1024 characters. If using a template, the # character isn't counted in the length.

It must include the protocol and domain name. May contain substitution variables.

One or both of the Href and TurboPageId parameters
TurboPageId long ID of the Turbo page.
MobileAppAdBuilderAdAdd structure
Creative AdBuilderAdAddItem

A creative that was created in the Ad Builder.

See the section Creative Ad Builder for image ads in the Help for Yandex.Direct.

Yes
TrackingUrl string Tracking link for tracking app installations. Maximum of 1024 characters. It must include the protocol and domain name. No
CpmBannerAdBuilderAdAdd structure
Creative AdBuilderAdAddItem

A creative that was uploaded in the web interface or created in the Ad Builder.

See Create a display campaign in the Help for Yandex.Direct.

Yes
Href string

Link to the advertiser's website. Maximum of 1024 characters. If using a template, the # character isn't counted in the length.

It must include the protocol and domain name. May contain substitution variables.

One or both of the Href and TurboPageId parameters
TurboPageId long ID of the Turbo page.
TrackingPixels ArrayOfString Can contain a maximum of two strings:
  • A Yandex.Audience pixel (see Pixel in the Help for Yandex.Audience).
  • An ADFOX tracking tag. The tag must have the %random% or %aw_random% macro.

The maximum length of each string is 1024 characters.

No
CpcVideoAdBuilderAdAdd structure
Creative AdBuilderAdAddItem

A creative that was created in the Ad Builder.

See the section Video ads / Creative Ad Builder in the Help for Yandex.Direct.

Yes
Href string

Link to the advertiser's website. Maximum of 1024 characters. If using a template, the # character isn't counted in the length.

It must include the protocol and domain name. May contain substitution variables.

One or both of the Href and TurboPageId parameters
TurboPageId long ID of the Turbo page.
CpmVideoAdBuilderAdAdd structure
Creative AdBuilderAdAddItem

A creative that was created in the Ad Builder.

See Video advertising / How to launch in the Help for Yandex.Direct.

Yes
Href string

Link to the advertiser's website. Maximum of 1024 characters. If using a template, the # character isn't counted in the length.

It must include the protocol and domain name. May contain substitution variables.

One or both of the Href and TurboPageId parameters
TurboPageId long ID of the Turbo page.
TrackingPixels ArrayOfString An ADFOX tracking tag. The tag must have the %random% or %aw_random% macro. Maximum of 1024 characters. No
AdBuilderAdAddItem structure
CreativeId long

ID of the creative.

To get the ID of a creative, use the Creatives.get method.

Yes
Note. “Narrow” characters are: !,.;:"

Response

Response structure in JSON format:

{
  "result": { /* result */
    "AddResults": [{  /* ActionResult */
      "Id": (long),
      "Warnings": [{  /* ExceptionNotification */
        "Code": (int), /* required */
        "Message": (string), /* required */
        "Details": (string)
      }, ... ],
      "Errors": [{  /* ExceptionNotification */
        "Code": (int), /* required */
        "Message": (string), /* required */
        "Details": (string)
      }, ... ] 
    }, ... ]
  }
}
Parameter Type Description
Result structure (for JSON) / AddResponse structure (for SOAP)
AddResults array of ActionResult Results of adding ads.
ActionResult structure
Id long ID of the ad that was created. Returned if there aren't any errors. See the section Operations on object arrays.
Warnings array of ExceptionNotification

Warnings that occurred during the operation.

Errors array of ExceptionNotification

Errors that occurred during the operation.