add_ad_schedules
Add day and time windows to control ad serving in a campaign. Each window specifies a day, start/end hours and minutes (15-min granularity). Overlapping windows on the same day are rejected.
Instructions
Add ad-schedule (dayparting) windows to a campaign.
Each window restricts serving to one day and time range and is additive (a campaign with no schedule serves all hours). Hours are 0-24; minutes are 15-minute granularity, so only 0/15/30/45 are valid (e.g. 09:15-16:45 -> from_hour 9, from_minute 15, to_hour 16, to_minute 45). Times run in the campaign time zone (see get_campaigns / get_ad_schedules) unless you pass use_searcher_time_zone=true. Read existing windows with get_ad_schedules first to avoid duplicates.
A new window for a day may NOT overlap an existing window on that same day -- the API rejects the add (returned as ok=false with a partial error, not a crash). To change or extend a window, remove_ad_schedules the old criterion first and then add the new one, in that order (adding the overlapping window first fails); or use replace_ad_schedule, which does the remove-then-add for a single window in one call.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| schedules | Yes | Windows to add, each {day, from_hour, from_minute, to_hour, to_minute, bid_adjustment}. day is "Monday".."Sunday"; bid_adjustment is a percent modifier (0 = no change). | |
| campaign_id | Yes | The campaign id. | |
| 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 |