Create Campaign Budget - OPERATION_NOT_PERMITTED_FOR_CONTEXT

72 views
Skip to first unread message

Nate Suri

unread,
Oct 22, 2024, 8:24:14 PM10/22/24
to Google Ads API and AdWords API Forum
Hello,

I'm trying to automate campaign creation which will require the first step of creating a campaign budget with a temporary ID. Unfortunately I'm receiving a rather vague error OPERATION_NOT_PERMITTED_FOR_CONTEXT.

{"message":"Request made: ClientCustomerId: 3684427843, Host: googleads.googleapis.com, Method: /google.ads.googleads.v17.services.GoogleAdsService/Mutate, RequestId: uz9fUHqbTPPiLXZ3TJVNuA, IsFault: True, FaultMessage: The operation is not allowed for the given context.","timestamp":1729613500757,"level":4,"level_name":"WARNING","facility":"google.ads.googleads.client","file":"/Users/<>/Library/Caches/pypoetry/virtualenvs/api-XrLiZ0nM-py3.11/lib/python3.11/site-packages/google/ads/googleads/interceptors/logging_interceptor.py","line":271,"pid":98384,"process_name":"MainProcess","stack_info":null,"logger.name":"google.ads.googleads.client","logger.thread_name":"MainThread","logger.version":"3.2.2","logger.method_name":"log_failed_request"}
google.ads.googleads.errors.GoogleAdsException: (<_InactiveRpcError of RPC that terminated with:
status = StatusCode.INVALID_ARGUMENT
details = "Request contains an invalid argument."
debug_error_string = "UNKNOWN:Error received from peer ipv6:%5B2607:f8b0:4006:816::200a%5D:443 {grpc_message:"Request contains an invalid argument.", grpc_status:3, created_time:"2024-10-22T12:11:40.630539-04:00"}"
>, <_InactiveRpcError of RPC that terminated with:
status = StatusCode.INVALID_ARGUMENT
details = "Request contains an invalid argument."
debug_error_string = "UNKNOWN:Error received from peer ipv6:%5B2607:f8b0:4006:816::200a%5D:443 {grpc_message:"Request contains an invalid argument.", grpc_status:3, created_time:"2024-10-22T12:11:40.630539-04:00"}"
>, errors {
  error_code {
    context_error: OPERATION_NOT_PERMITTED_FOR_CONTEXT
  }
  message: "The operation is not allowed for the given context."
  location {
    field_path_elements {
      field_name: "mutate_operations"
      index: 0
    }
    field_path_elements {
      field_name: "campaign_budget_operation"
    }
  }
}
request_id: "uz9fUHqbTPPiLXZ3TJVNuA"
, 'uz9fUHqbTPPiLXZ3TJVNuA')

Please let me know what I need to change.
Message has been deleted

Google Ads API and AdWords API Forum

unread,
Nov 15, 2024, 4:22:46 AM11/15/24
to Google Ads API and AdWords API Forum
Hi,

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

From the provided logs, it appears you've encountered the "OPERATION_NOT_PERMITTED_FOR_CONTEXT" error while attempting to create the CampaignBudget. This error indicates that the operation is not allowed in the current context. It seems you are using an MCC account ID (3684427843) to create the CampaignBudget, which is causing the issue. To resolve this, I would recommend you to use the client account (sub-account) instead because it's not possible to create the campaign budget using the MCC ID. 

If you continue to experience issues after following this suggestion, you can reach out to us again for further assistance.

Thanks & Regards,
Google Ads API Team.

Reply all
Reply to author
Forward
0 new messages