Error on updating delivery profile with graphql api

Hello I am getting error when I try to associate a variant to a delivery profile, I am using python, this is the code:

query = """
            mutation deliveryProfileUpdate($id: ID!, $profile: DeliveryProfileInput!) 
                {  
                    deliveryProfileUpdate(id: $id, profile: $profile) 
                    {    
                        profile {      
                            id    
                        }    
                        userErrors {      
                            field      
                            message    
                        }
                    }
                }  
            """
        variables = {
            "id":"gid://shopify/DeliveryProfile/DID",
            "profile":{
                "variantsToAssociate":"gid://shopify/ProductVariant/VID"
            }
        }
        result = shopify.GraphQL().execute(query, variables=variables)

This is the error message:

[{'field': None, 'message': 'Profile could not be updated.'}]

Hey @Antonio84

I’m able to add and remove variants to my test stores’ delivery profiles using the deliveryProfileUpdate mutation and the Shopify Python API library.

Have you tried making the same request in an HTTP client like Postman or Insomnia? Can you update other delivery profiles on your store?

We can’t provide authenticated support in the forums, but if there’s something specific about one of the deliveryProfiles on your store that cannot be updated I’d recommend reaching out to our support directly with an example.

Cheers

I have this issue; it happens when you update the delivery profile too often.

I guess they throttle API calls for this mutation to allow only 1 call per 30 seconds roughly.