Hi, Thank you for reaching out to the Google Ads API support team.
Based on the information provided, I understand that you are trying to programmatically add a shared exclusion list (shared set) at the account level using the Google Ads API, but haven't found a direct method to do so and are seeking guidance on how to achieve this through code. Can you confirm the SharedSetType that you are trying to create? I would recommend you to kindly refer to the Create And Attach Shared Keyword Set guide as it explains clearly on how to create a shared set and attach it to the campaign using the Google Ads API. We have tried this approach in creating the shared set types as 'NEGATIVE_KEYWORDS' and were able to succeed in attaching the shared set to the campaign. You can use the customers.sharedSets method for creating the shared set and customers.campaignSharedSets method for attaching the shared set to the campaign. However, I am attaching the sample request and response logs for your reference. Shared set Creation: ===================== Request Body: ============ POST https://googleads.googleapis.com/v17/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": { "name": "shared set in client account", "type": "NEGATIVE_KEYWORDS" } } ] } Response: ========== HTTP/1.1 200 cache-control: private content-encoding: gzip content-length: 109 content-type: application/json; charset=UTF-8 date: Tue, 15 Oct 2024 08:22:32 GMT server: ESF vary: Origin, X-Origin, Referer { "results": [ { "resourceName": "customers/{customerId}/sharedSets/{shared_set_id}" } ] } Attaching the shared set to the campaign: =================================== Request Body: ============= POST https://googleads.googleapis.com/v17/customers/{customerId}/campaignSharedSets:mutate?key=[YOUR_API_KEY] HTTP/1.1 developer-token: ********************** Authorization: Bearer [YOUR_ACCESS_TOKEN] Accept: application/json Content-Type: application/json { "operations": [ { "create": { "campaign": "customers/{customerId}/campaigns/{campaignId}", "sharedSet": "customers/{customerId}/sharedSets/{shared_set_id}" } } ] } Response: ========= HTTP/1.1 200 cache-control: private content-encoding: gzip content-length: 129 content-type: application/json; charset=UTF-8 date: Tue, 15 Oct 2024 08:38:45 GMT server: ESF vary: Origin, X-Origin, Referer { "results": [ { "resourceName": "customers/{customerId}/campaignSharedSets/{campaignId}~{shared_set_id}" } ] } Similarly, we created a shared set at the MCC level using the Google Ads API and attempted to link it to a campaign, but encountered a RESOURCE_NOT_FOUND error. We later understood that since campaigns cannot be created at the MCC account level, the shared set cannot be attached to client-level campaigns. However, we were able to apply the MCC level shared sets 'NEGATIVE_KEYWORDS' to the client level campaigns without any issues from the Google Ads UI. In order to investigate your issue further, kindly provide us with the complete API logs (request and response logs with request-id and request header) generated at your end and uncropped UI screenshot of the Google Ads account where you are facing the issue. If you are using a client library and haven't enabled the logging yet, I would request you to enable logging for the specific client library that you are using. You can refer to the guides Java, .Net, PHP, Python, Ruby or Perl to enable logging at your end. For REST interface requests, you can enable logging via the curl command by using the -i flag. You can send the details via Reply privately to the author option, or direct private reply to this email. This message is in relation to case "ref:!00D1U01174p.!5004Q02vGePS:ref" (ADR-00271703) Thanks, Google Ads API Team -- -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ 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 adwords-api@googlegroups.com To unsubscribe from this group, send email to adwords-api+unsubscr...@googlegroups.com 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 adwords-api+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/adwords-api/LhdJh000000000000000000000000000000000000000000000SLEBF8005gUk-2THRIyZqirML9NaNg%40sfdc.net.