SCALIX help

← All tools

gads_remove_data_exclusion

Google Ads write medium risk

Part of the Seasonality Agent.

What it does

Permanently remove a data exclusion (BiddingDataExclusionService.MutateBiddingDataExclusions remove operation by id; irreversible: a removed data exclusion cannot be restored, only created again). Google advises against removing an exclusion once it has applied: Smart Bidding would learn from the excluded days' broken data again, so the preview warns. The preview reads the data exclusion and shows its name, scope and window; a failed read only warns. An id that does not exist is not_found (look it up with gads_list_data_exclusions); one already removed returns changed=false with nothing to approve. PREVIEW->APPROVE->COMMIT: validate_only=true dry run -> plain-English IRREVERSIBLE warning -> explicit approval -> commit requires BOTH the preview_id AND confirm_irreversible=true -> confirm + audit log. 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 when the user wants a data exclusion gone (a mistaken one, or one no longer wanted). Find its id with gads_list_data_exclusions first.

Inputs

NameTypeRequiredDescription
customer_idstringyes10-digit CID, dashes stripped. Not a manager (MCC) account: Google refuses these there.
data_exclusion_idstringyesNumeric id, or the full resource name ending in it. From gads_list_data_exclusions.
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 (a removed data exclusion cannot be restored).
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

Remove only when the user asks for this data exclusion to go; never remove one to hide what was configured.

Reminder

Removal is irreversible; confirm explicitly which data exclusion goes (the preview names it).

Errors

Error classMeansWhat to doRetry
not_foundNo data exclusion with that id in the account.Look the id up with gads_list_data_exclusions.no
invalid_argumentThe id is not numeric, or confirm_irreversible was not true at apply.Fix what the message names and call again.no
OPERATION_NOT_PERMITTED_FOR_CONTEXTGoogle refuses these on a manager (MCC) account.Run it on the client account the campaigns belong to.no
needs_reauthAuthorization expired or revoked.Reconnect Google Ads in the Scalix dashboard.no
rate_limitedGoogle Ads rate limit hit.Wait a minute, then call again.yes

Edge cases

  • An already removed data exclusion returns changed=false and no preview_id.
  • The commit needs confirm_irreversible=true with the preview_id.