Mutate operations must have 'create', 'update' or 'remove'

13 views
Skip to first unread message

pe...@svensktkosttillskott.se

unread,
Jul 5, 2024, 8:06:52 AM (yesterday) Jul 5
to Google Ads API and AdWords API Forum
Hi,

Im getting an error saying that mutateoperations must have update, but I am defining 'update' in the mutate operations. Please advise.

// console error:
{
  "errors": [
    {
      "error_code": {
        "request_error": "OPERATION_REQUIRED"
      },
      "message": "Mutate operations must have 'create', 'update', or 'remove' specified.",
      "location": {
        "field_path_elements": [
          {
            "field_name": "mutate_operations",
            "index": 0
          },
          {
            "field_name": "ad_group_customizer_operation"
          }
        ]
      }
    },
...

// node.js


    const operations: MutateOperation<any>[] = preparedCustomizerChanges
      .map((preparedCustomizer) => {
        if (!preparedCustomizer) return null;

        return {
          entity: "ad_group_customizer",
          operation: "update",
          resource: {
            resource_name: preparedCustomizer.assetResourceName,
            value: preparedCustomizer.newValue,
          },
          update_mask: ["value"],
        } as MutateOperation<any>;
      })
      .filter(Boolean) as MutateOperation<any>[];

    accounts[customerId] = { changed: 0, failed: 0 };

    if (operations.length > 0) {
      try {
        const result = await customer.mutateResources(operations);

Google Ads API Forum Advisor

unread,
Jul 5, 2024, 12:37:06 PM (22 hours ago) Jul 5
to pe...@svensktkosttillskott.se, adwor...@googlegroups.com
Hi,

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

Based on the provided logs, you are encountering the request error "OPERATION_REQUIRED". Make sure, the mutate request operation has the options to create, edit, or remove provided when submitting a request. Also, I could see that you have provided only response logs, which are not sufficient to investigate the issue further, provide us with the complete API logs (request and response with request-id and request header) generated at your end so that we can better assist you.

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.
 

This message is in relation to case "ref:!00D1U01174p.!5004Q02tJeBF:ref" (ADR-00245284)

Thanks,

 
Google Logo Google Ads API Team

Register for the upcoming workshop: Performance Max and the Google Ads API!
 


Reply all
Reply to author
Forward
0 new messages