---
metadata:
  - name: generator
    content: Diplodoc Platform v5.52.0
alternate:
  - https://yandex.com/dev/direct/doc/en/bids/set.md
  - https://yandex.com/dev/direct/doc/ru/bids/set.md
  - href: en/bids/set.md
    type: text/markdown
    title: Markdown version
  - href: ../llms.txt
    type: text/markdown
    title: llms.txt
sourcePath: en/ref-v5/bids/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.

{% note alert %}

- Bids and prices are passed via the Yandex Direct API as **integer numbers**. The passed value represents the bid or price **multiplied by 1,000,000**.

- All bids and costs appear in the user's currency.

{% endnote %}


## 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 — 10.
- Groups — 1000.
- Keywords and autotargetings — 10,000.


## Request {#input}

Request structure in JSON format:

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


#|
||
**Parameter**
|
**Type**
|
**Description**
|
**Required**
||
||
**params structure (for JSON) / SetRequest structure (for SOAP)**
|
>
|
>
|
>
||
||
`Bids`
|
array of BidSetItem
|
Bids.
|
Yes
||
||
**BidSetItem 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.
|
^
||
||
`Bid`
|
long
|
The bid for displays in search results, 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: `Bid`, `ContextBid`, `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 (`Bid`) 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 you've set a manual bid (`Bid`), the automatic bid value (`AutotargetingSearchBidIsAuto`) is set to NO unless you specify a different automatic bid.

If you haven't set a manual bid (`Bid`), the automatic bid value (`AutotargetingSearchBidIsAuto`) is set to YES unless you specify a different automatic bid.
|
^
||
||
`ContextBid`
|
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/bids/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/bids/setAuto/id-input/homogen.md -->



## Response {#output}

Response structure in JSON format:

```javascript translate=no
{
  "result": {  /* result */
    "SetResults": [{  /* BidActionResult */
      "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 BidActionResult
|
The results of the bidding.
||
||
**BidActionResult 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
|
Warnings that occurred during the operation.
||
||
`Errors`
|
array of ExceptionNotification
|
Errors that occurred during the operation.
||
|# 


## Examples {#samples}

**Request example**

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

**Response example**

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