Webhook Permission Denied On Create

I’m new to this api and I’m trying to create a webhook for one of the campaigns I’ve pledged to. When I try to create the webhook, I keep getting the following response

{"errors":[{"code":null,"code_name":"CreateForbidden","detail":"You do not have permission to create this webhook.","status":"403","title":"You do not have permission to create this webhook."}]}

Is there some sort of other authentication that I’m missing that I need to do to create the webhook?

This is what my payload looks like:

payload = {
        "data": {
            "type": "webhook",
            "attributes": {
                "triggers": ["posts:publish"],
                "uri": my_uri,
            },
            "relationships": {
                "campaign": {
                    "data": {"type": "campaign", "id": campaign_id},
                },
            },
        }
    }

You can try the call which Patreon WordPress uses. Also you should pay attention to headers which the class sends:

I seem to be doing exactly the same thing as the patreon wordpress class is doing, although a little bit different because I’m working with python flask. I’m sending in the bearer line in the header but I don’t have the User-Agent line. I did a search and couldn’t find anything useful on it. Could I get an explanation as to what it does?

Missing user agent header may cause your app to be mistaken for a bot. So, it should be there. It is a (rather arbitrary) name that you yourself give to your app’s api caller to identify it.