SCALIX help

← All tools

gads_remove_label

Google Ads write low risk

Part of the Account Structure Agent.

What it does

Remove a label association from campaigns/ad groups/ads (remove operations on the *LabelService using the association resource path adGroupAdLabel/campaignLabel/adGroupLabel), OR delete the label entirely (LabelService remove) when delete_label=true. Removing an association unlinks the label; deleting the label removes it and all its associations, irreversibly: that preview carries an IRREVERSIBLE warning and its commit needs the preview_id AND confirm_irreversible=true (an unlink needs no flag). WRITE with preview->approve->commit: preview = mutate validate_only=true + diff (what is being unlinked/deleted) + preview_id; commit = the same call plus that preview_id after the user approves in a later message (+ partial_failure for bulk unlink) + audit. Returns {label_id, entities_unlabeled or deleted}. 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.

When to use it

Use to unlink a label from specific entities, or to delete a label entirely. Preview to show exactly what is unlinked/deleted, confirm (especially for full delete), then commit.

Inputs

NameTypeRequiredDescription
customer_idstringyes10-digit CID; strip dashes.
label_idstringyesLabel ID to unlink or delete.
delete_labelbooleannoIf true, delete the label entirely (removes all associations). If false/omitted, only unlink from the given entities.
entity_typestringnoCAMPAIGN, AD_GROUP, or AD_GROUP_AD (alias: AD; case-insensitive) — selects the label link resource.
campaign_idsarraynoCampaign IDs to unlink (entity_type=CAMPAIGN).
ad_group_idsarraynoAd group IDs to unlink (entity_type=AD_GROUP).
ad_group_ad_idsarraynoTo unlink for entity_type=AD_GROUP_AD. Each item may be {ad_group_id, ad_id}, 'adGroupId~adId', or a full ad_group_ad resource_name - all three are accepted.
manager_idstringnoOptional MCC login-customer-id.
confirm_irreversiblebooleannoRequired at APPLY when delete_label=true: must be true together with preview_id or the delete is refused. That preview carries the IRREVERSIBLE warning (a deleted label cannot be restored). Not needed to unlink.
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

Deleting a label is irreversible and strips it from every entity; confirm the user intends a full delete vs a targeted unlink. Organizational only.

Reminder

Deleting a label removes it everywhere; confirm delete vs unlink before committing.

Errors

Error classMeansWhat to doRetry
PARTIAL_FAILURESome unlink rows referenced a non-existent association while others succeeded.Report failed indices; the rest were unlinked.no
VALIDATION_ERRORNeither delete_label nor an entity list provided.Set delete_label=true or provide entities to unlink.no
NOT_FOUNDLabel or association does not exist.Confirm the label_id and associations via gads_list_labels.no
TOKEN_REVOKEDOAuth token expired/revoked.Refresh and retry once; else prompt reconnect (needs_reauth).yes
PERMISSION_DENIEDNo access or out-of-bearer-scope write.Confirm access and write scope; else refuse.no
RESOURCE_EXHAUSTEDRate/quota exceeded (HTTP 429).Backoff 5/10/20s cap 60s, then retry.yes
INTERNAL_ERRORTransient Google server error (5xx).Retry after backoff.yes

Edge cases

  • delete_label=true is irreversible and removes the label from all entities -> require explicit confirmation.
  • Unlinking an association that doesn't exist -> per-row not-found (partial failure).
  • Bulk unlink must respect the 10,000-op mutate cap; chunk if needed.
  • Without delete_label or entities -> VALIDATION_ERROR.
  • Preview changes nothing; preview_id TTL expiry -> re-preview; expired token -> refresh once and retry.