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

# set

Sets fixed bids for keywords and autotargetings.

You can set a bid for:

- A separate keyword or autotargeting.

- All keywords and autotargetings in an ad group.

- All keywords and autotargetings in a campaign.

You can set a bid based on your campaign's [display strategy](https://yandex.com/dev/direct/doc/objects/campaign-strategies.html):

- If you've chosen the HIGHEST_POSITION display strategy for Yandex Search, you can specify the `SearchBid` parameter.
- If you've chosen the MAXIMUM_COVERAGE or MANUAL_CPM display strategy for ad networks, you can specify the `NetworkBid` parameter.

If an item in the input array contains parameters that are not appropriate for the strategy, the values of these parameters are not changed.

- If an item in the input array contains parameters that both match and don't match the strategy, the operation only changes the values of the parameters that match the strategy, and a warning is returned.

- If an item in the input array only contains parameters that don't match the strategy, the operation doesn't run and an error is returned.

## Learn more

- [Operations on object arrays](https://yandex.com/dev/direct/doc/best-practice/modify.html)
- [Autotargeting](https://yandex.com/dev/direct/doc/best-practice/auto-targeting.html)

## Restrictions {#restrictions}

A single request can only set bids for the same type of objects — either for campaigns only, or for groups only, or for keywords and autotargetings only.

Maximum number of objects per method call:
- Campaigns: A maximum of 10
- Groups: A maximum of 1000
- Keywords and autotargetings: no more than 10,000.

## Request {#input}

Request structure in JSON format:

```javascript translate=no
{
  "method": "set",
  "params": { /* params */
    "KeywordBids": [{  /* KeywordBidSetItem */
      "CampaignId": (long),
      "AdGroupId": (long),
      "KeywordId": (long),
      "SearchBid": (long),
      "AutotargetingSearchBidIsAuto" : ("YES"|"NO"),
      "NetworkBid": (long),
      "StrategyPriority": ( "LOW" | "NORMAL" | "HIGH" )
    }, ... ] /* required */
  }
}
```

#|
||
**Parameter**
|
**Type**
|
**Description**
|
**Required**
||

||
**params structure (for JSON) / SetRequest structure (for SOAP)**
||
||
`KeywordBids`
|
array of KeywordBidSetItem
|
Bids.
|
Yes
||

||
**KeywordBidSetItem structure**
||
||
`CampaignId`
|
long
|
The campaign ID. Specify it when you want to set the same bid for all keywords and autotargetings in your campaign.
|
Use either `CampaignId` or `AdGroupId` or `KeywordId`
||
||
`AdGroupId`
|
long
|
ID of the ad group. Specify it when you want to set the same bid for all keywords and autotargetings in an ad group.
||
||
`KeywordId`
|
long
|
The keyword ID. Specified when setting a bid or priority for an individual keyword or autotargeting.
||
||
`SearchBid`
|
long
|
The bid on search, multiplied by 1,000,000. Integer. Only for manual strategies.

<!-- source: en/_includes/keywords/add/id-input/bid-limits-network.md -->
Specified in the user's currency. Restrictions are listed in the currency reference. To get it, use the [Dictionaries](https://yandex.com/dev/direct/doc/en/dictionaries/dictionaries).[get](https://yandex.com/dev/direct/doc/en/dictionaries/get) method and specify the `Currencies` dictionary name in the request.
<!-- endsource: en/_includes/keywords/add/id-input/bid-limits-network.md -->
|
At least one of the parameters: `SearchBid`, `NetworkBid`, `StrategyPriority`, or `AutotargetingSearchBidIsAuto`
||
||
`AutotargetingSearchBidIsAuto`
|
YesNoEnum
|
A flag indicating whether [automatic bid](https://yandex.com/support/direct/en/impression-criteria/autotargeting.html#autotargeting__auto-bids) is enabled.

You can specify a manual bid (`SearchBid`) and enable automatic bids (`AutotargetingSearchBidIsAuto`) at the same time. In that case, automatic bid will be used, and manual bid will be applied if automatic bid is disabled.

If only a manual bid (`SearchBid`) is specified:

- For an operation specifying `CampaignId` or `AdGroupId`, the automatic bid value won't be reset after this method is used.
- For an operation specifying `KeywordId`, the automatic bid value will be set to NO. If you want to keep this setting, you need to specify it for the operation with `KeywordId`.
||
||
`NetworkBid`
|
long
|
The bid in ad networks, multiplied by 1,000,000. Integer. Only for manual strategies with independent bid management in ad networks.

<!-- source: en/_includes/keywords/add/id-input/bid-limits-network.md -->
Specified in the user's currency. Restrictions are listed in the currency reference. To get it, use the [Dictionaries](https://yandex.com/dev/direct/doc/en/dictionaries/dictionaries).[get](https://yandex.com/dev/direct/doc/en/dictionaries/get) method and specify the `Currencies` dictionary name in the request.
<!-- endsource: en/_includes/keywords/add/id-input/bid-limits-network.md -->

{% note alert %}

An image ad can be displayed only if the bid is at least as high as the minimum bid for an ad with an image.

{% endnote %}
||
||
`StrategyPriority`
|
PriorityEnum
|
Priority of the keyword: LOW, NORMAL or HIGH. Only for automatic strategies.

<!-- source: en/_includes/strategy-priority-note.md -->
{% note alert %}

This parameter is not used, and the passed value is ignored.

{% endnote %}
<!-- endsource: en/_includes/strategy-priority-note.md -->
||
|# 

<!-- source: en/_includes/keywordbids/setAuto/id-input/homogen.md -->
{% note alert %}

The `CampaignId`, `AdGroupId` and `KeywordId` parameters are mutually exclusive.  A single request may only contain one of these parameters.

{% endnote %}
<!-- endsource: en/_includes/keywordbids/setAuto/id-input/homogen.md -->

## Response {#output}

Response structure in JSON format:

```javascript translate=no
{
  "result": {  /* result */
    "SetResults": [{  /* KeywordBidActionResult */
      "Warnings": [{  /* ExceptionNotification */
        "Code": (int), /* required */
        "Message": (string), /* required */
        "Details": (string)
      }, ... ],
      "Errors": [{  /* ExceptionNotification */
        "Code": (int), /* required */
        "Message": (string), /* required */
        "Details": (string)
      }, ... ],
      "CampaignId": (long),
      "AdGroupId": (long),
      "KeywordId": (long)
    }, ... ]
  }
}
```


#|
||
**Parameter**
|
**Type**
|
**Description**
||

||
**result structure (for JSON) / SetResponse structure (for SOAP)**
||
||
`SetResults`
|
array of KeywordBidActionResult
|
The results of the bidding.
||

||
**KeywordBidActionResult structure**
||
||
`CampaignId`
|
long
|
The campaign 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) (if it was specified in the request).
||
||
`AdGroupId`
|
long
|
ID of the ad group. Returned if there aren't any errors. See the section [Operations on object arrays](https://yandex.com/dev/direct/doc/best-practice/modify.html) (if it was specified in the request).
||
||
`KeywordId`
|
long
|
ID of the keyword or autotargeting. Returned if there aren't any errors. See the section [Operations on object arrays](https://yandex.com/dev/direct/doc/best-practice/modify.html) (if it was specified in the request).
||
||
`Warnings`
|
array of [ExceptionNotification](https://yandex.com/dev/direct/doc/best-practice/modify.html)
|
Warnings that occurred during the operation.
||
||
`Errors`
|
array of [ExceptionNotification](https://yandex.com/dev/direct/doc/best-practice/modify.html)
|
Errors that occurred during the operation.
||
|# 


## Example {#samples}

**Request**

```javascript translate=no
    {
      "method" : "set",
      "params" : {
        "KeywordBids" : [
          {
            "StrategyPriority" : "HIGH",
            "CampaignId" : 4193065
          },
          {
            "SearchBid" : 14000,
            "CampaignId" : 7273721
          }
        ]
      }
    }
```

**Response**

```javascript translate=no
    {
      "result" : {
        "SetResults" : [
          {
            "CampaignId" : 4193065
          },
          {
            "CampaignId" : 7273721
          }
        ]
      }
    }
```
