Updates the status, dates, budget and base bid of several ad groups of one advertiser in one call. The ad groups come from ad_group_ids or, with all_selected, from the ad group IDs of a report. Requires the advertiser_ad_group_management write permission.
Batch size: the code enforces no maximum number of ad group ids and no request body size limit. With all_selected the report is read without paging (start 0, count 2147483647).
Whole-request checks: the request is rejected as a whole (400, nothing saved) when all_selected is true and the report is invalid, when any of the ad groups belongs to a campaign of another advertiser, when status is not a valid status name, or when any ad group belongs to a reservation-only experience. Ad group ids that do not exist are skipped silently and appear in neither list.
Partial failure: each remaining ad group is processed on its own. For each one the end date and always_on are applied first, then the status, then the budget, then the base bid. A change in base_bid_percentage or base_bid_increase fails the ad group when its campaign uses auto bid. An ad group that fails is added to failed with its id and the error message and its in-memory changes are reverted, so it is not saved with the change. The ad groups that succeeded are saved together with their campaigns in one database transaction; if that fails, the whole request fails with an error and no result lists are returned. Ad groups are processed in no guaranteed order and successful and failed are not in the order of the request. Repeated ids are processed once.
Response: 200 when every ad group succeeded and 207 when at least one failed (also when all failed). Both return the same body, result.failed (list of id and error) and result.successful (list of ids).
After the save, asset binding snapshots are published for the updated ad groups, integrated campaigns trigger an offsite sync when approved (or when no review is needed), and budget and base bid changes are recorded as audit events. Status 207: Multi-Status. The request was processed and at least one item failed. Items listed in successful were saved; items listed in failed were not.
| Time | Status | User Agent | |
|---|---|---|---|
Retrieving recent requests… | |||
Updates status, dates, budget and base bid of several ad groups of one advertiser. The ad groups are listed in ad_group_ids or, when all_selected is true, taken from a report. Requires the advertiser_ad_group_management write permission. The code enforces no maximum number of ad group ids.
The request is rejected as a whole, with nothing saved, for an invalid report, ad groups of another advertiser, an invalid status, or a reservation-only experience. Unknown ad group ids are skipped. Otherwise ad groups are processed one by one: a failed ad group is reported in failed and not saved with the change, and the others are saved together in one transaction. The order of the result lists is not the request order.
The status is 200 when all ad groups succeeded and 207 when at least one failed. The body has the same shape in both cases.
Inputs
| Field | Type | Description | Required |
| memberGroupId | integer | The member group id (provided by Koddi) | Yes |
| advertiserId | integer | The advertiser ID | Yes |
| ad_group_ids | array | Ad groups to update. Replaced by the ad groups of the report when all_selected is true. No maximum number of ids is enforced by the code. | No |
| status | string | New status name for every ad group, matched case-insensitively. Empty or omitted leaves the status unchanged. | No |
| end_date | string | Date and time formatted YYYY-MM-DD HH:MM:SS, interpreted in the advertiser's timezone. Applied when it differs from the ad group's current end date. The ad group's start date is kept. | No |
| always_on | boolean | When true the ad groups are set to always on. | No |
| budget_percentage | number | Percentage change of each ad group's budget: budget + budget * budget_percentage / 100. Used instead of budget_increase when non-zero. | No |
| budget_increase | number | Amount added to each ad group's budget. Used only when budget_percentage is 0. | No |
| base_bid_percentage | number | Percentage change of each ad group's base bid. Used instead of base_bid_increase when non-zero. A failure for ad groups whose campaign uses auto bid. | No |
| base_bid_increase | number | Amount added to each ad group's base bid. Used only when base_bid_percentage is 0. | No |
| all_selected | boolean | If true, ad_group_ids is ignored and the ad groups come from running the report. | No |
| report | object | Report definition, used only when all_selected is true. It must have exactly one entry in advertiser_ids equal to the advertiserId of the path, member_group_id equal to the memberGroupId of the path, context ad_group, report_type normal, and ad_group_id among dimensions. The ad group IDs in the report rows are used, with pagination forced to start 0 and a count of 2147483647. | No |
| report.advertiser_ids | array | No | |
| report.member_group_id | integer | No | |
| report.report_type | string | No | |
| report.context | string | No | |
| report.start_date | string | No | |
| report.end_date | string | No | |
| report.currency_code | string | No | |
| report.filters | array | No | |
| report.filters[].field | string | No | |
| report.filters[].operation | string | No | |
| report.filters[].value | object | No | |
| report.filters[].or_group | string | No | |
| report.dimensions | array | No | |
| report.metrics | array | No | |
| report.pagination | object | No | |
| report.pagination.start | integer | No | |
| report.pagination.count | integer | No | |
| report.sort | array | No | |
| report.sort[].field | string | No | |
| report.sort[].order | string | No |
Response
Both 200 and 207 return the following body inside result.
| Field | Type | Description |
| failed | array of objects | Ad groups that were not updated |
| failed[].id | integer | The ad group id |
| failed[].error | string | The error message |
| successful | array of integers | IDs of the ad groups that were updated |

