SCALIX help

← All tools

gads_remove_campaign

Google Ads write high risk

Part of the Google Ads Manager Agent.

What it does

Permanently removes (soft-deletes) a campaign by setting campaign.status=REMOVED via CampaignService.MutateCampaigns update with update_mask='status'. REMOVED is terminal and IRREVERSIBLE — the campaign can no longer be enabled or edited (it remains visible in historical reporting only). Bulk-capable (partial_failure=true). Because this is destructive, prefer gads_pause_campaign unless the user explicitly wants permanent removal. PREVIEW->APPROVE->COMMIT: step 1 validate_only=true; step 2 plain-English diff with an explicit IRREVERSIBLE warning (campaign name(s) -> REMOVED, spend stops, cannot be undone); step 3 explicit, unambiguous approval; step 4 execute partial_failure=true; step 5 confirm + timestamp + audit log. Returns standard success/error envelope. 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 only when the user explicitly wants to permanently delete a campaign. Spell out that REMOVED is irreversible (it cannot be re-enabled), require confirm_irreversible=true and an unambiguous approval, and suggest gads_pause_campaign as the reversible alternative. Never use removal to recreate disapproved content elsewhere.

Inputs

NameTypeRequiredDescription
customer_idstringyes10-digit CID, dashes stripped; operating account.
campaign_idsarrayyesOne or more numeric campaign IDs (or resource_names) to permanently remove. Bulk supported.
reasonstringnoOptional human reason recorded in the audit log.
confirm_irreversiblebooleannoRequired at APPLY: must be true together with preview_id or the commit is refused. Previews run without it and carry the IRREVERSIBLE warning.
validate_onlybooleannoOptional. 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_idstringnoOmit 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

Removal is permanent. Do not use removal as part of a circumvention workflow (e.g. delete-and-recreate disapproved content under a new campaign/account to dodge enforcement) — that is 'Circumventing Systems' (egregious). Removal itself is content-neutral but requires explicit, informed approval.

Reminder

Preview with validate_only, require explicit confirm_irreversible approval, and log it; REMOVED is permanent — prefer pausing unless deletion is truly intended.

Errors

Error classMeansWhat to doRetry
CUSTOMER_NOT_FOUNDCustomer ID not found / not accessible.Verify CID and access; prompt re-auth if needed.no
TOKEN_REVOKEDOAuth token invalid/revoked (401).Refresh; if still failing set needs_reauth.no
CAMPAIGN_NOT_FOUNDOne or more campaign IDs not found in this account.Verify the IDs; in bulk the missing ones surface via partial_failure.no
OPERATION_ON_MANAGER_ACCOUNTCannot mutate campaigns on an MCC.Use the child operating account.no
INVALID_ARGUMENTInvalid transition (e.g. campaign already REMOVED) or confirm_irreversible not set.Surface the platform message; require confirm_irreversible=true before commit; already-REMOVED is a no-op note.no
PARTIAL_FAILUREBulk remove: some campaigns removed, others failed.Report per-campaign results with platform messages; retry only the failed IDs.no
PERMISSION_DENIEDMissing write scope / out-of-bearer-scope (403).Confirm scope + role; re-consent.no
RESOURCE_EXHAUSTEDRate/quota exceeded (429).Backoff 5->10->20s cap 60s, honor retryDelay, retry once.yes
PLATFORM_UNAVAILABLEGoogle Ads API 5xx/INTERNAL.Retry once with backoff; verify status before re-applying.yes

Edge cases

  • REMOVED is terminal — a removed campaign cannot be paused, resumed, or edited; it persists only in historical reporting.
  • Already REMOVED -> no-op; report success with a note rather than erroring.
  • confirm_irreversible must be true at apply (with preview_id) — previews run without it and carry the IRREVERSIBLE warning.
  • Bulk: partial_failure isolates bad IDs; report per-campaign outcomes; split if over 10,000 ops.
  • Removal stops spend but does not delete the underlying campaign_budget resource.
  • validate_only preview never executes; commit separate + idempotent (re-removing is safe).
  • Expired token mid-call -> refresh once and retry.