replace_campaign_ad_schedule

Google Ads Write

REPLACE a campaign's whole ad schedule with exactly the windows you give, in one step (all or nothing), in the account's time zone

Endpoint

POST https://api.adspirer.ai/api/v1/tools/replace_campaign_ad_schedule/execute

Headers

Description

REPLACE a campaign's whole ad schedule with exactly the windows you give, in one step (all or nothing), in the account's time zone. Every existing window not in your list is removed. Use this when the user wants the campaign to run only at certain hours. Send the COMPLETE schedule the campaign should have afterwards, for every day it should run, and tell the user which windows were removed (the result says how many and how the weekly hours changed). An empty list removes the schedule so ads run at all hours, and is only accepted with confirm_clear_schedule=true. Before calling, show the user the current schedule (get_campaign_targeting) and the new one. Returns before and after. dry_run=true checks without changing anything. **Each window:** day_of_week (MONDAY..SUNDAY), start_hour 0-23, end_hour 1-24 (24 = midnight; 24-hour clock, 5 pm = 17), start_minute / end_minute 0, 15, 30 or 45, optional bid_modifier 0.1-10.0 (1.2 = +20%). Up to 6 windows per day; windows of one day may not overlap (touching is fine, e.g. 9-12 and 12-15); a window may not cross midnight (split it into two days). **To ADD a window and keep the rest,** use set_campaign_ad_schedule. **To delete one or two windows,** use remove_campaign_ad_schedule. **Example (weekdays 9:00-17:00 only):** windows=[{day_of_week:'MONDAY',start_hour:9,end_hour:17}, ...through FRIDAY]. **Required:** campaign_id + windows (the complete new schedule).

Request body

All tool arguments are wrapped in an arguments object.

FieldTypeDescription
campaign_idstring requiredCampaign ID (from list_campaigns).
windowsarray requiredThe COMPLETE schedule the campaign should have afterwards, every day it should run (max 6 windows per day, no overlaps). Every existing window not listed is removed. An empty list removes the whole schedule (ads then run at all hours) and needs confirm_clear_schedule=true. e.g. [{'day_of_week':'MONDAY','start_hour':9,'end_hour':17}, ...].
confirm_clear_scheduleboolean optionalSet true ONLY with an empty windows list, after the user agreed that the campaign will run at all hours, every day.
dry_runboolean optionalOptional. true = test mode: Google checks the change (validate-only) and NOTHING is changed; the result shows the current schedule and the one that would result.
customer_idstring optionalGoogle Ads customer ID. Required for multi-account users.

Example request

{
  "arguments": {
    "campaign_id": "<campaign_id>",
    "windows": [
      {
        "day_of_week": "string",
        "start_hour": 1,
        "start_minute": 0,
        "end_hour": 1,
        "end_minute": 0,
        "bid_modifier": 1.0
      }
    ],
    "confirm_clear_schedule": false,
    "dry_run": false,
    "customer_id": "string"
  }
}

Example responses

200 — Success

{
  "success": true,
  "data": {
    "text": "(tool-specific textual output for replace_campaign_ad_schedule)",
    "quota": {
      "used": 42,
      "limit": 150,
      "tier": "plus",
      "period_end": "2026-05-01"
    }
  },
  "tool": "replace_campaign_ad_schedule"
}

400 — Tool-level error (bad arguments / multi-account selection)

{
  "success": false,
  "error": "You have 25 meta_ads accounts connected. Please specify which account to use by passing the ad_account_id parameter:\n  - Acme Holdings (ad_account_id=\"act_123456789\")\n  - Acme EU (ad_account_id=\"act_987654321\")",
  "is_error": true,
  "tool": "replace_campaign_ad_schedule"
}

402 — Quota exhausted

{
  "success": false,
  "error": "\ud83d\udea8 Monthly limit reached (150/150 tool calls on Plus tier).\nUpgrade to Pro at https://adspirer.ai to keep building.",
  "is_error": true,
  "tool": "replace_campaign_ad_schedule",
  "quota": {
    "used": 150,
    "limit": 150,
    "tier": "plus",
    "period_end": "2026-05-01",
    "upgrade_url": "https://adspirer.ai"
  }
}

Try it live


Adspirer REST API — get an API key at adspirer.ai/keys · adspirer.ai