Overview
Webhooks
Section titled “ Webhooks ”Webhooks provide a way to configure Bitbucket Cloud to make requests to your server (or another external service) whenever certain events occur in Bitbucket Cloud.
A webhook consists of:
- A subject – The resource that generates the events. Currently, this resource is the repository, user account, or team where you create the webhook.
- One or more event – The default event is a repository push, but you can select multiple events that can trigger the webhook.
- A URL – The endpoint where you want Bitbucket to send the event payloads when a matching event happens.
There are two parts to getting a webhook to work: creating the webhook and triggering the webhook. After you create a webhook for an event, every time that event occurs, Bitbucket sends a payload request that describes the event to the specified URL. Thus, you can think of webhooks as a kind of notification system.
Use webhooks to integrate applications with Bitbucket Cloud. The following use cases provides examples of when you would want to use webhooks:
- Every time a user pushes commits in a repository, you may want to notify your CI server to start a build.
- Every time a user pushes commits or creates a pull request, you may want to display a notification in your application.