replace_ad_schedule
Replace an ad schedule window by removing the old criterion and adding a new one in a single call, avoiding overlap errors.
Instructions
Replace one ad-schedule (dayparting) window: remove the old criterion, add a new one.
The API rejects adding a window that overlaps an existing same-day window, so an in-place edit is impossible; this does the only safe sequence -- remove the old criterion, then add new_window -- in one call. Get the criterion_id from get_ad_schedules. If the remove fails, nothing changes; if the add fails after the remove, the result says so (the old window is gone, so that slot is briefly uncovered until you re-add it).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| new_window | Yes | The replacement window {day, from_hour, from_minute, to_hour, to_minute, bid_adjustment}. day is "Monday".."Sunday"; minutes are 0/15/30/45. | |
| campaign_id | Yes | The campaign id. | |
| criterion_id | Yes | The existing window's criterion id (from get_ad_schedules) to replace. | |
| use_searcher_time_zone | No | If set, also updates the campaign flag controlling whether the hours are interpreted in each searcher's time zone (true) or the campaign's (false). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | ||
| ids | No | ||
| message | Yes | ||
| partial_errors | No |