At the moment there is no way to configure a webhook globally over all projects. There is a Jira ticket for a default git hook configuration to provide this functionality. An update on Jan 2022 states that:
We understand that this capability is highly desirable especially in an enterprise environment. We will look into addressing it in the future, but at this moment we are unable to provide the exact timeline.
You can vote for it to give it more attention.
A workaround mentioned in another related ticket is:
Use /2.0/repositories/{username} to get a list of all repositories.
Use /2.0/repositories/{username}/{repo_slug}/hooks to add the webhook.
[Example:
$ curl -X POST -u credentials -H 'Content-Type: application/json'
https://api.bitbucket.org/2.0/workspaces/my-workspace/hooks
-d '
{
"description": "Webhook Description",
"url": "https://example.com/",
"active": true,
"events": [
"repo:push",
"issue:created",
"issue:updated"
]
}']
using the Bitbucket API Repositories Resource and Bitbucket API Webhook Resource.