gads_enable_keyword
Google Ads write medium risk
Part of the Google Ads Manager Agent.
What it does
Re-enable one or more keywords by setting ad_group_criterion.status=ENABLED via update + update_mask=status. PREVIEW->APPROVE->COMMIT: previews via validate_only=true listing current->ENABLED, waits for approval, commits with validate_only=false (atomic: every keyword or none), returns the enabled resource_names, logs the change/actor. Enabling resumes serving immediately and may resume spend — preview flags this. Cannot un-remove a REMOVED keyword (must be re-added as a new criterion). Returns {success, data, count, warnings}. The preview shows each keyword's text, match type and current status next to ENABLED, and warns that serving and spend start at once. An id already in the target status is flagged; when all of them are, the call returns changed: false and no preview_id, since there is nothing to approve. 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 resume previously paused keywords once the user confirms. Warn that serving and spend restart immediately. Never use to circumvent a disapproval.
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
customer_id | string | yes | 10-digit CID, dashes stripped. |
keywords | array | yes | List of criterion_resource_name OR {ad_group_id, criterion_id}. Up to 10,000 ops. |
reason | string | no | Optional reason for the audit log. |
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
Re-enabling carries no content-policy risk but resumes real spend; require explicit approval and log the actor. Do not re-enable keywords tied to content under active disapproval (does not cure the violation).
Reminder
Enabling resumes spend immediately — log the actor/reason; 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 |
CRITERION_NOT_FOUND | Keyword criterion not found. | Re-list; a REMOVED keyword must be re-added (gads_add_keywords), not enabled. | no |
INVALID_ARGUMENT | Invalid status transition (e.g. from REMOVED) or malformed resource name. | Surface Google's message; re-add if removed. | no |
MANAGER_ACCOUNT_NOT_SUPPORTED | Cannot mutate criteria on a manager (MCC) account. | Target a child serving account. | no |
PARTIAL_FAILURE | Some keywords failed to enable while others succeeded. | Return per-op errors with index; succeeded committed. | 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
- Empty list -> invalid_argument ('No ids provided.'); nothing is sent.
- Keyword already ENABLED -> flagged; when every keyword is, success with changed: false and no preview_id (nothing to approve).
- Keyword REMOVED -> cannot enable; instruct re-add via gads_add_keywords.
- Parent ad group/campaign paused -> keyword enabled but still won't serve; warn.
- validate_only clean still needs approval before commit.
- Idempotent on already-enabled keywords.
- Expired token -> refresh once and retry.