gads_create_budget
Google Ads write high risk
Part of the Budget Agent.
What it does
Create a CampaignBudget (daily amount in micros) that can be assigned to one or more campaigns. PREVIEW->APPROVE->COMMIT: previews via validate_only=true showing name, daily amount (account currency -> micros) and delivery method, plus a monthly pacing projection (daily x ~30.4), waits for approval, commits with validate_only=false + partial_failure=true, returns the budget resource_name + ID + timestamp. amount supplied in account currency is converted to micros (x1e6). A shared budget (explicitly_shared=true) spreads its daily amount across multiple campaigns — flagged in preview. Returns {success, data:{budget_resource_name, budget_id}, count, warnings}. PREVIEW SEMANTICS: the first call (no preview_id) is sent to the Google Ads API in validation mode — field, enum, policy and permission errors surface AT PREVIEW, nothing is changed, and the response returns a preview_id. To apply, show the preview to the user, get their approval, and re-call with that preview_id and IDENTICAL arguments within 30 minutes; changed arguments or an expired token fail closed to a fresh preview. validate_only=true forces another preview; validate_only=false alone never commits.
When to use it
Use to provision a budget before creating/assigning a campaign, or to add a shared budget. Always show the daily amount and projected monthly spend, and flag if shared. Get explicit approval before committing.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
customer_id | string | yes | 10-digit CID, dashes stripped. |
name | string | yes | Budget name unique within the account; trimmed. |
amount | number | yes | Daily budget in account currency -> micros (x1e6). Google interprets this as the daily amount; monthly spend cap = daily x 30.4. Must be > 0 and >= the account-currency minimum. |
delivery_method | string | no | STANDARD (default) or ACCELERATED (enum-normalized). ACCELERATED is deprecated/unavailable for most campaign types -> warn if selected. |
explicitly_shared | boolean | no | If true, the budget can be shared across multiple campaigns; default false (single-campaign). |
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. |
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
Budgets are money, not content; require explicit approval of the exact amount and log the actor. Never create a budget the user did not approve in the preview.
Reminder
Include a monthly pacing projection so spend is understood; 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 |
INVALID_ARGUMENT | Invalid amount (negative/zero/below the account-currency minimum) or duplicate name. | Surface Google's message including any stated minimum; correct the amount/name. | no |
MANAGER_ACCOUNT_NOT_SUPPORTED | Cannot create 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 |
Edge cases
- amount below the account-currency minimum -> Google rejects; surface the minimum.
- explicitly_shared=true -> preview warns it will affect every campaign later assigned.
- Duplicate budget name -> error; suggest a unique name.
- validate_only clean still needs approval before commit.
- Idempotency: re-running create after success makes a second budget — guard against duplicates (check name first).
- ACCELERATED delivery is deprecated for most campaign types -> warn if selected.
- Expired token -> refresh once and retry.