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

# setBids

Sets bids and priorities for audience targets.

You can set a bid or specify priority for a particular audience target, for all audience targets in an ad group, or for all audience targets in a campaign.

<!-- source: en/_includes/audiencetargets/add/id-add/bid-strategy-p.md -->
The bid or priority is used depending on which display strategy is selected in the campaign:
- If a manual strategy is set up in the campaign, the `ContextBid` parameter is used.
    
- If the campaign has an automatic strategy set up, the `StrategyPriority` parameter is used: ads for audience targets with higher priority are allocated more traffic when possible, and they are the last ones to be stopped when budget funds are low.
<!-- endsource: en/_includes/audiencetargets/add/id-add/bid-strategy-p.md -->


If no parameter appropriate to the strategy is specified, an error is returned.

If both the bid and priority are specified, the values will be saved:

- If the strategy is manual but the priority is specified, this priority value will be applied later when the strategy is switched to an automatic one.

- If the strategy is automatic but a bid is specified, this bid value **will not be applied**: if the strategy switches from automatic to manual, the bid will be set according to an automatic algorithm.

{% 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

- [How methods that change data work](https://yandex.com/dev/direct/doc/best-practice/modify.html)
- [How to handle errors](https://yandex.com/dev/direct/doc/en/concepts/errors)


## Restrictions {#restrictions}

In a single request, you can only set bids for a single kind of objects — either only for audience targets, only for ad groups, or only for campaigns.

Maximum number of objects per method call:

- Audience targets — 10,000.
- Groups — 1000.
- Campaigns — 100.


## Request {#input}

Request structure in JSON format:

```javascript translate=no
{
  "method": "setBids",
  "params": { /* params */
    "Bids": [{  /* AudienceTargetSetBidsItem */
      "Id": (long),
      "AdGroupId": (long),
      "CampaignId": (long),
      "ContextBid": (long),
      "StrategyPriority": ( "LOW" | "NORMAL" | "HIGH" )
    }, ... ] /* required */
  }
}
```


#|
||
**Parameter**
|
**Type**
|
**Description**
|
**Required**
||
||
**params structure (for JSON) / AddRequest structure (for SOAP)**
|
>
|
>
|
>
||
||
`Bids`
|
array of AudienceTargetSetBidsItem
|
The audience targets to set the bid or priority for.
|
Yes
||
||
**AudienceTargetSetBidsItem structure**
|
>
|
>
|
>
||
||
`Id`
|
long
|
ID of the audience target. Specified when setting the bid or priority for an individual audience target.
|
Use either `Id` or `AdGroupId` or `CampaignId`
||
||
`AdGroupId`
|
long
|
ID of the ad group. Specified when setting the same bid or priority for all the audience targets in a group.
|
^
||
||
`CampaignID`
|
long
|
The campaign ID. Specified when setting the same bid or priority for all the audience targets in a campaign.
|
^
||
||
`ContextBid`
|
long
|
The bid in ad networks, multiplied by 1,000,000. Integer. Only used for a manual strategy.

<!-- 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 -->


<!-- source: en/_includes/bids/set/id-input/inage-ad-bid.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 %}
<!-- endsource: en/_includes/bids/set/id-input/inage-ad-bid.md -->
|
For a manual strategy
||
||
`StrategyPriority`
|
PriorityEnum
|
The priority of the audience target: LOW, NORMAL or HIGH. Only used for an automatic strategy.

The default value is NORMAL.
|
For an automatic strategy
||
|# 


{% note alert %}

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

{% endnote %}



## Response {#output}

Response structure in JSON format:

```javascript translate=no
{
  "result": { /* result */
    "SetBidsResults": [{  /* SetBidsActionResult */
      "Id": (long),
      "AdGroupId": (long),
      "CampaignId": (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) / SetBidsResponse structure (for SOAP)**
|
>
|
>
||
||
`SetBidsResults`
|
array of SetBidsActionResult
|
Results of setting bids and/or priorities.
||
||
**SetBidsActionResult structure**
|
>
|
>
||
||
`Id`
|
long
|
ID of the audience target. Returned if there aren't any errors (if it was specified in the request). See the section [Operations on object arrays](https://yandex.com/dev/direct/doc/best-practice/modify.html).
||
||
`AdGroupId`
|
long
|
ID of the ad group. Returned if there aren't any errors (if it was specified in the request). See the section [Operations on object arrays](https://yandex.com/dev/direct/doc/best-practice/modify.html).
||
||
`CampaignID`
|
long
|
The campaign ID. Returned if there aren't any errors (if it was specified in the request). 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.
||
|# 
