Hi,

Thank you for reaching out to the Google Ads API support team.

As per the CustomerNegativeCriterionOperation 
<https://developers.google.com/google-ads/api/rest/reference/rest/v18/CustomerNegativeCriterionOperation>
 you 
can only either create or remove. To create the negative keywords on 
account level, kindly follow the below steps: 
   
   - You need to verify whether the shared set are created in your account 
   by using the below query. "query":"SELECT shared_set.id, 
   shared_set.member_count, shared_set.name, shared_set.reference_count, 
   shared_set.resource_name, shared_set.status, shared_set.type FROM 
   shared_set WHERE shared_set.type= 'ACCOUNT_LEVEL_NEGATIVE_KEYWORDS' AND 
   shared_set.status='ENABLED'If it's already created you can use the 
   shared set resource name.
   - If not, you need to create a shared set using the Method: 
   customers.sharedSets.mutate 
   
<https://developers.google.com/google-ads/api/rest/reference/rest/v18/customers.sharedSets/mutate>
    request.



*Sample Request Body:====================*POST 
https://googleads.googleapis.com/v19/customers/{customerId}/sharedSets:mutate?key=[YOUR_API_KEY]
 
HTTP/1.1

developer-token: **********************
Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json
Content-Type: application/json

{
  "operations": [
    {
      "create": {
        "type": "ACCOUNT_LEVEL_NEGATIVE_KEYWORDS",
        "name": "Negative Keywords Testing1"
      }
    }
  ]
}

   - Then you need to create a shared set criteria 
   
<https://developers.google.com/google-ads/api/rest/reference/rest/v18/SharedCriterion>
 by 
   adding keyword and the earlier created shared set using the Method: 
   customers.sharedCriteria.mutate 
   
<https://developers.google.com/google-ads/api/rest/reference/rest/v18/customers.sharedCriteria/mutate>
    request.



*Sample Request body:=====================*POST 
https://googleads.googleapis.com/v19/customers/{customerId}/sharedCriteria:mutate?key=[YOUR_API_KEY]
 
HTTP/1.1

developer-token: **********************
Authorization: Bearer [YOUR_ACCESS_TOKEN]
Accept: application/json
Content-Type: application/json

{
  "operations": [
    {
      "create": {
        "keyword": {
          "matchType": "EXACT",
          "text": "Testing keyword1"
        },
        "sharedSet": "customers/3636059788/sharedSets/{sharedSetId}"
      }
    }
  ]
}

   - After the above steps, you can use the CustomerNegativeCriterionService 
   
<https://developers.google.com/google-ads/api/reference/rpc/v18/CustomerNegativeCriterionService>
 to 
   create the negative Keyword at the account and you need to provide the 
   created shared set resource name as negative_keyword_list 
   
<https://developers.google.com/google-ads/api/reference/rpc/v18/CustomerNegativeCriterion#:~:text=Immutable.%20YouTube%20Channel.-,negative_keyword_list,-NegativeKeywordListInfo>
 value 
   in the CustomerNegativeCriterion 
   
<https://developers.google.com/google-ads/api/reference/rpc/v18/CustomerNegativeCriterion>
 object 
   under the MutateCustomerNegativeCriteriaRequest 
   
<https://developers.google.com/google-ads/api/reference/rpc/v18/MutateCustomerNegativeCriteriaRequest>
   .



*Sample Request Body:===================*POST 
https://googleads.googleapis.com/v19/customers/3636059788/customerNegativeCriteria:mutate?key=[YOUR_API_KEY]
 
HTTP/1.1 

 developer-token: ********************** 
Authorization: Bearer [YOUR_ACCESS_TOKEN] 
Accept: application/json 
Content-Type: application/json 

 {
 "operations": [ 
   { 
    "create": { 
      "negativeKeywordList": { 
      "sharedSet": "customers/3636059788/sharedSets/{sharedSetId}"
     }
   } 
  } 
 ]
}    

I hope this helps. Let me know how this goes on your end.

Thanks and Regards, 
Google Ads API team.

On Tuesday, March 18, 2025 at 2:05:28 PM UTC+5:30 Manas Bagul wrote:

> Hi, 
>
> Is there a provision in the APIs, specifically v18, to add Account Level 
> Negative Keywords? I know they can be added manually in the account 
> settings (see attached screenshot for reference). But, I want to automate 
> it for multiple accounts. 
>
> [image: Screenshot 2025-03-18 131908.png]
>
> Also, can we add Negative Keywords (not lists) to Pmax Campaigns via the 
> API?
>
> Any help in this matter would be appreciated.
>
> Thanks and Regards,
> Manas Bagul
>
> ***
> This communication is confidential, may be privileged, and is meant only 
> for the intended recipient and purpose. No part of this email or any files 
> transmitted with it can be shared, copied, forwarded, published online or 
> offline, or used in any unauthorised manner. If you are not the intended 
> recipient, please preserve the confidentiality of the contents, delete the 
> e-mail and attachments (if any) from your system, and inform the sender 
> immediately.
> ***
>

-- 
-- 
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~
Also find us on our blog:
https://googleadsdeveloper.blogspot.com/
=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~

You received this message because you are subscribed to the Google
Groups "AdWords API and Google Ads API Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/adwords-api?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Google Ads API and AdWords API Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/adwords-api/ab13532a-0221-4933-9f47-53bb5505f95en%40googlegroups.com.

Reply via email to