---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://yandex.ru/dev/direct/doc/en/adgroups/update.md
  - https://yandex.ru/dev/direct/doc/ru/adgroups/update.md
  - href: en/adgroups/update.md
    type: text/markdown
    title: Markdown version
  - href: ../llms.txt
    type: text/markdown
    title: llms.txt
sourcePath: en/ref-v5/adgroups/update.md
---
> **Documentation Index:** Fetch the complete configuration index at https://yandex.ru/dev/direct/doc/en/llms.txt

# update

Changes the parameters of ad groups.

## Learn more

- [How the "update" method works](https://yandex.com/dev/direct/doc/best-practice/modify.html)
- [How to handle errors](https://yandex.com/dev/direct/doc/en/concepts/errors)


## Restrictions {#limits}

<!-- source: en/_includes/adgroups/add/id-restrictions/unified-url.md -->
To manage a unified performance group, use the URL: `https://api.direct.yandex.com/v501/`.
<!-- endsource: en/_includes/adgroups/add/id-restrictions/unified-url.md -->


Maximum of 1000 groups per method call.

You can't change groups in archived campaigns.


## Request {#input}

Request structure in JSON format:

```javascript translate=no
{
  "method": "update",
  "params": { /* params */
    "AdGroups": [{  /* AdGroupUpdateItem */
      "Id": (long), /* required */
      "Name": (string),
      "RegionIds": [(long), ... ],
      "NegativeKeywords": {  /* ArrayOfString */
        "Items": [(string), ... ] /* required */
      }, /* nillable */
      "NegativeKeywordSharedSetIds": { /* ArrayOfLong */
        "Items": [(long), ... ] /* required */
      }, /* nillable */
      "TrackingParams": (string),
      "MobileAppAdGroup": {  /* MobileAppAdGroupUpdate */
        "TargetDeviceType": [( "DEVICE_TYPE_MOBILE" | "DEVICE_TYPE_TABLET" ), ... ],
        "TargetCarrier": ( "WI_FI_ONLY" | "WI_FI_AND_CELLULAR" ),
        "TargetOperatingSystemVersion": (string)
      },
      "DynamicTextAdGroup": [{  /* DynamicTextAdGroupUpdate */
        "DomainUrl": (string) /* required */,
        "AutotargetingCategories" : [{  /* AutotargetingCategoriesUpdate */
          "Category" : ( "EXACT" | "ALTERNATIVE" | "COMPETITOR" | "BROADER" | "ACCESSORY" ) /* required */,
          "Value" : ( "YES" | "NO" ) /* required */
        }, ...]
      }, ...],
      "DynamicTextFeedAdGroup": {  /* DynamicTextFeedAdGroupUpdate*/
        "AutotargetingCategories" : [{  /* AutotargetingCategoriesUpdate */
          "Category" : ( "EXACT" | "ALTERNATIVE" | "COMPETITOR" | "BROADER" | "ACCESSORY" ) /* required */,
          "Value" : ( "YES" | "NO" ) /* required */
        }, ...]
      },
      "SmartAdGroup": {  /* SmartAdGroupUpdate */
        "AdTitleSource": (string), /* nillable */
        "AdBodySource": (string) /* nillable */
      },
      "TextAdGroupFeedParams" : {  /* TextAdGroupFeedParamsUpdate */
        "FeedId" : (long) /* required nillable */,
        "FeedCategoryIds" : { /* nillable */
          "Items" : [ (long) ] /* required */
        }
      },
      "UnifiedAdGroup" : {
        "OfferRetargeting" : ("YES"|"NO")
      }
    }, ... ] /* required */
  }
}
```


#|
||
**Parameter**
|
**Type**
|
**Description**
|
**Required**
||
||
**params structure (for JSON) / UpdateRequest structure (for SOAP)**
|
>
|
>
|
>
||
||
`AdGroups`
|
array of AdGroupUpdateItem
|
The groups to change the parameters for.
|
Yes
||
||
**AdGroupUpdateItem structure**
|
>
|
>
|
>
||
||
`Id`
|
long
|
The ID of the group to update parameters for.
|
Yes
||
||
`Name`
|
string
|
The name of the ad group (from 1 to 255 characters).
|
No
||
||
`RegionIds`
|
array of long
|
Array of IDs of regions where ad impressions are enabled or disabled. The array must contain at least one item.

The ID "0" indicates to display ads in all regions.

A minus sign before a region ID disables impressions in this region. For example, [1,-219] indicates to display for Moscow and the entire Moscow area, except Chernogolovka. Minus regions can't be used if 0 is set. The array must not consist of only minus regions.
To get the list of regions, use the [Dictionaries](https://yandex.ru/dev/direct/doc/en/dictionaries/dictionaries.md).[get](https://yandex.ru/dev/direct/doc/en/dictionaries/get.md) method.
|
No
||
||
`NegativeKeywords`
|
ArrayOfString, nillable
|
Array of negative keywords that are shared by all the keywords of an ad group.


{% note alert %}

Negative keywords are not allowed in a group of display ads with targeting criteria based on a user profile.

{% endnote %}


A keyword should be specified without the minus sign before the first word.

Maximum of 7 words per keyword. The maximum length of each word is 35 characters. The maximum combined length of negative keywords in the array is 4096 characters. Spaces, dashes, and operators are not counted as part of the total length.


{% note info %}

Negative keywords that are shared for all a campaign's ad groups should preferably be set in the campaign parameter of the same name.

{% endnote %}
|
No
||
||
`NegativeKeywordSharedSetIds`
|
ArrayOfLong, nillable
|
IDs of sets of negative keywords. Maximum of 3 items in the array.

To get the IDs of sets, use the [NegativeKeywordSharedSets](https://yandex.ru/dev/direct/doc/en/negativekeywordsharedsets/negativekeywordsharedsets.md).[get](https://yandex.ru/dev/direct/doc/en/negativekeywordsharedsets/get.md) method.


{% note alert %}

Negative keywords are not allowed in a group of display ads with targeting criteria based on a user profile.

{% endnote %}
|
No
||
||
`TrackingParams`
|
string
|
GET parameters for tracking traffic sources that are added to the link of all ads in the group (maximum of 1024 characters). May contain [substitution variables](https://yandex.com/support/direct/en/statistics/url-tags.html).

For example: from=direct&ad=\{ad_id\}

Image ads, dynamic ads, and smart banners. However, currently it's only used for groups of dynamic ads and smart banners.
|
No
||
||
`MobileAppAdGroup`
|
MobileAppAdGroupUpdate
|
Parameters of an ad group for app promotion.
|
No
||
||
`DynamicTextAdGroup`
|
DynamicTextAdGroupUpdate
|
Parameters of a group of dynamic ads.
|
No
||
||
`DynamicTextFeedAdGroup`
|
DynamicTextFeedAdGroupUpdate
|
Parameters of a group of dynamic ads with the FEED subtype.
|
No
||
||
`SmartAdGroup`
|
SmartAdGroupUpdate
|
Parameters for ad group of smart banners.
|
No
||
||
`TextAdGroupFeedParams`
|
TextAdGroupFeedParamsUpdate
|
Parameters of a Text & Image ads group.
|
No
||
||
`UnifiedAdGroup`
|
UnifiedAdGroupUpdate
|
Parameters of a unified performance group: See [Group type](https://yandex.com/dev/direct/doc/objects/adgroup.html#types).
|
No
||
||
**MobileAppAdGroupUpdate structure**
|
>
|
>
|
>
||
||
`TargetDeviceType`
|
array of DeviceTypeEnum
|
Which devices to show ads on:
- DEVICE_TYPE_MOBILE — smartphones

- DEVICE_TYPE_TABLET — tablets
|
No
||
||
`TargetCarrier`
|
CarrierEnum
|
Which types of internet connections to show ads on:
- WI_FI_ONLY — only Wi-Fi
- WI_FI_AND_CELLULAR — cellular internet and Wi-Fi
|
No
||
||
`TargetOperatingSystemVersion`
|
string
|
The minimum OS version to display the ad on. For example, 2.3.

{% note info %}

If the minimum OS version in the app store is higher than the one set in this parameter, ads are displayed only for OS versions equal to or higher than the one in the app store.

{% endnote %}
|
No
||
||
**DynamicTextAdGroup structure**
|
>
|
>
|
>
||
||
`DomainUrl`
|
string
|
The domain name of the site to generate dynamic ads for (a maximum of 100 characters). The protocol can be omitted.
|
Yes
||
||
`AutotargetingCategories`
|
array of AutotargetingCategoriesUpdateItem
|
Targeting categories to be added.
|
No
||
||
**DynamicTextFeedAdGroupUpdate structure**
|
>
|
>
|
>
||
||
`AutotargetingCategories`
|
array of AutotargetingCategoriesUpdateItem
|
Targeting categories to be added.
|
No
||
||
**AutotargetingCategoriesUpdateItem structure**
|
>
|
>
|
>
||
||
`Category`
|
AutotargetingCategoriesEnum
|
Targeting category:

- EXACT: The targeted queries. The ad is highly relevant to the user's search.
- ALTERNATIVE: Alternative queries. The user is looking for a product that can be replaced by the product you're promoting. The ad might also match the query in this case.
- COMPETITOR: Queries that mention your competitors. The user is looking for the promoted product via competitor brands.
- BROADER: Broad queries. Queries that show interest in a product type your offer belongs to.
- ACCESSORY: Related queries. Queries for products that might interest the user in relation to the advertised product or service.
|
Yes
||
||
`Value`
|
YesNoEnum
|
The flag indicating that the specified targeting category is enabled. All targeting categories are enabled by default.
|
Yes
||
||
**SmartAdGroupUpdate structure**
|
>
|
>
|
>
||
||
`AdTitleSource`
|
string, nillable
|
The name of the feed element to use for the ad title. If omitted, the title is generated automatically.
|
No
||
||
`AdBodySource`
|
string, nillable
|
The name of the feed element to use for the ad text. If omitted, the text is generated automatically.
|
No
||
||
**TextAdGroupFeedParamsUpdate structure**
|
>
|
>
|
>
||
||
`FeedId`
|
long, nillable
|
ID of the feed on the basis of which Text & Image ads must be generated.
|
No
||
||
`FeedCategoryIds`
|
ArrayOfLong
|
Image ads must be generated.

If no category IDs are specified, all categories from the feed are used.
|
No
||
||
**UnifiedAdGroupUpdate structure**
|
>
|
>
|
>
||
||
`OfferRetargeting`
|
YesNoEnum
|
Indicates that offer retargeting is enabled.
|
No
||
|# 


## Response {#output}

Response structure in JSON format:

```javascript translate=no
{
  "result": {  /* result */
    "UpdateResults": [{  /* ActionResult */
      "Id": (long),
      "Warnings": [{  /* ExceptionNotification */
        "Code": (int), /* required */
        "Message": (string), /* required */
        "Details": (string)
       }, ...
      ],
      "Errors": [{  /* ExceptionNotification */
        "Code": (int), /* required */
        "Message": (string), /* required */
        "Details": (string)
       }, ...
      ]
    }, ... ] /* required */
  }
}
```


#|
||
**Parameter**
|
**Type**
|
**Description**
||
||
**result structure (for JSON) / UpdateResponse structure (for SOAP)**
|
>
|
>
||
||
`UpdateResults`
|
array of ActionResult
|
Results of updating group parameters.
||
||
**ActionResult structure**
|
>
|
>
||
||
`Id`
|
long
|
Group ID. Returned if there aren't any errors. See the section [Operations on object arrays](https://yandex.com/dev/direct/doc/best-practice/modify.html).
||
||
`Warnings`
|
array of ExceptionNotification
|
Warnings that occurred during the operation.
||
||
`Errors`
|
array of ExceptionNotification
|
Errors that occurred during the operation.
||
|# 
