Create webhook via API

Is there a way to generate and access a service wehbook via portainer API? I have a stack with multiple micro-services which match multiple repos in bitbucket. When I create the stack I would like to run a script that generates the webhooks for each service and then install them in corresponding bitbucket repo.

Thanks in advance!