Webhooks can be triggered whenever specific events occur on GitHub. For example, you can configure a webhook to trigger whenever:
- Code is pushed to a repository
- A pull request is opened
- A GitHub Pages site is built
- A new member is added to a team
You can add webhooks to GitHub Enterprise, an organization, a repository, or a GitHub App.
When you add a webhook, you choose which events you want to subscribe to. To limit the number of HTTP requests to your server, you should only subscribe to the specific events that you plan on handling. By default, webhooks installed on GitHub Enterprise, an organization or a repository are only subscribed to the push event. By default, webhooks on GitHub Apps are not subscribed to any events. You can change the events that a webhook is subscribed to at any time. For a complete list of webhook events, see "Webhook events and payloads."
You typically need a server to receive webhooks events. When you add a webhook, you specify a URL where you want to receive the webhook events. GitHub will send a HTTP POST payload to this URL when any events that the webhook is subscribed to occur.
When your server receives a webhook event, it can process and respond to the webhook. For example, code running on your server could update an external issue tracker, trigger CI builds, update a backup mirror, or deploy to a production server when it receives a webhook event.
You can create up to 250 webhooks for each event on each installation target (GitHub Enterprise Server instance, specific organization, or specific repository).
Note: GitHub webhooks do not currently support IPv6 but will in the future. The /meta
REST API endpoint returns IPv6 ranges to enable that transition.