Updates the status, budget and bid automation flag of several campaigns of one advertiser in one call. Requires the advertiser_campaign_management write permission.
Batch size: the code enforces no maximum number of campaign_ids and no request body size limit.
Whole-request checks: the request is rejected as a whole (400, nothing saved) when any campaign id does not exist or does not belong to the advertiser in the path, when both budget_percentage and budget_increase are non-zero, or when status is not a valid status name.
Partial failure: after those checks each campaign is processed on its own, in the order of campaign_ids. A campaign that fails (for example a budget or status rule, or a missing review for a campaign that requires reviews) is added to failed with its id and the error message and none of its changes are saved. The campaigns that succeeded are saved together in one database transaction; if that save fails, the whole request fails with an error and no result lists are returned. A campaign sent without status, budget or is_auto_bid changes counts as successful.
Response: 200 when every campaign 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). successful follows the order of campaign_ids.
After the save, ad groups whose effective status changed publish their asset bindings, integrated campaigns that are approved (or need no review) trigger an offsite sync, and budget and is_auto_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, budget and the bid automation flag of several campaigns of one advertiser. Requires the advertiser_campaign_management write permission. The code enforces no maximum number of campaign ids.
The request is rejected as a whole, with nothing saved, if a campaign id is unknown or belongs to another advertiser, if both budget_percentage and budget_increase are non-zero, or if status is invalid. Otherwise campaigns are processed one by one: a campaign that fails is reported in failed and not saved, and the others are saved together in one transaction.
The status is 200 when all campaigns 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 |
| campaign_ids | array | Campaigns to update. Every id must exist and belong to the advertiser, otherwise the whole request is rejected. No maximum number of ids is enforced by the code. | No |
| status | string | New status name for every campaign, matched case-insensitively. Empty or omitted leaves the status unchanged. | No |
| budget_percentage | number | Percentage change applied to each campaign's budget: the new budget is budget * (1 + budget_percentage / 100). Cannot be combined with budget_increase. | No |
| budget_increase | number | Amount added to each campaign's budget. Cannot be combined with budget_percentage. | No |
| is_auto_bid | boolean | Sets the bid automation flag. Omit to leave it unchanged. | No |
| adjust_ad_groups | boolean | When true and a budget change is requested, the budgets of the campaign's eligible ad groups are scaled too. With budget_increase, the percentage used is budget_increase divided by the campaign budget times 100. | No |
Response
Both 200 and 207 return the following body inside result.
| Field | Type | Description |
| failed | array of objects | Campaigns that were not updated |
| failed[].id | integer | The campaign id |
| failed[].error | string | The error message |
| successful | array of integers | IDs of the campaigns that were updated |

