gads_update_budget
Google Ads write high risk
Part of the Budget Agent.
What it does
Change a CampaignBudget's daily amount and/or delivery method. Reads the current amount first and returns a plain diff. SCALIX SOP: a change of more than 20% in either direction emits a pacing warning recommending the increase be staged across 2-3 days; if the budget is explicitly shared, every campaign drawing on it is listed so the full blast radius is visible. PREVIEW (first call; returns preview_id) -> user APPROVES in a later message -> COMMIT (the same call plus that preview_id) + audit; `approved` is DEPRECATED and ignored — it no longer commits. Money is micros (display /1e6). Returns {success, data:{budget_id, preview|applied:{from, to, percent_change, shared_budget, campaigns_using_budget (every campaign drawing on the budget — for a non-shared budget, its single owner)}}, warnings}.
When to use it
Show the from/to/percent_change diff and any shared-budget campaign list to the buyer before approving. For a >20% increase, offer a staged plan.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
customer_id | string | yes | 10-digit CID, dashes stripped. |
budget_id | string | yes | CampaignBudget ID/resource_name to update. |
amount | number | no | New daily amount in account currency -> micros (x1e6); must be > 0. Provide amount and/or delivery_method. |
delivery_method | string | no | STANDARD/ACCELERATED enum-normalized; optional. ACCELERATED deprecated for most types. |
validate_only | boolean | no | Optional. true forces another preview even with a preview_id; false is DEPRECATED and no longer commits — only a valid preview_id applies the write. |
preview_id | string | no | Omit it to preview: nothing is applied, and the call returns a preview_id bound to this exact request. Pass it only after the user approves that preview in a later message, with the same arguments (leave out validate_only, and add any confirmation flag the preview names). Single-use, expires in 30 minutes; changed arguments need a fresh preview. |
approved | boolean | no | DEPRECATED and ignored — approved=true no longer commits; pass the preview's returned preview_id instead (stale clients get a preview + warning). |
Safeguards
A change in two steps. The first call previews and changes nothing; Claude shows you the preview and applies it only after you approve, within 30 minutes and with the same arguments. Every applied change goes to the audit log. How changes are approved.
Policy
Budget changes are money-sensitive; require explicit approval of the new amount and log the actor. Never change a budget without a previewed current->proposed diff.
Reminder
Include the new monthly pacing projection and flag shared-budget blast radius; log actor/amount; never expose tokens.
Errors
| Error class | Means | What to do | Retry |
|---|---|---|---|
CUSTOMER_NOT_FOUND | Account not found/linked. | Verify CID/authorization. | no |
TOKEN_REVOKED | Authorization expired/revoked. | needs_reauth. | no |
BUDGET_NOT_FOUND | Referenced budget does not exist or is removed. | Verify budget_id via gads_list_budgets. | no |
INVALID_ARGUMENT | Invalid amount (negative/zero/below the account-currency minimum). | Surface Google's message including any minimum; correct the amount. | no |
MANAGER_ACCOUNT_NOT_SUPPORTED | Cannot mutate budgets on a manager (MCC) account. | Target a child serving account. | no |
PERMISSION_DENIED | No write access / out of bearer scope. | Confirm role/scope. | no |
RESOURCE_EXHAUSTED | Rate/quota limit (HTTP 429). | Backoff 5/10/20s cap 60s; honor retryDelay. | yes |
INTERNAL_ERROR | Transient 5xx. | Retry once after backoff. | yes |
account_inactive | The Google Ads account is suspended or not enabled, so Google rejects every mutate - including validate_only=true previews. Reads keep working. | Resolve the account status in the Google Ads UI (billing/policy). Do NOT tell the user to reconnect Google Ads; reconnecting cannot fix an account-state rejection. | no |
Edge cases
- Shared budget -> preview enumerates all affected campaigns/count before commit.
- New amount equals current -> no-op; report 0 changed.
- amount below the minimum -> rejected; surface the minimum.
- validate_only clean still needs approval before commit.
- Re-preview required if the user edits the proposed amount.
- Idempotency: amount is absolute, so re-running the same approved commit won't compound.
- Expired token -> refresh once and retry.