About creating webhooks
You can create webhooks to subscribe to specific events on GitHub that occur in a repository, organization, GitHub Enterprise, or GitHub App.
For more information about the different types of webhooks, see "Types of webhooks."
For a complete list of webhook events, see "Webhook events and payloads."
Creating a repository webhook
You can create a webhook to subscribe to events that occur in a specific repository. You must be a repository owner or have admin access in the repository to create webhooks in that repository.
You can use the GitHub web interface or the REST API to create a repository webhook. For more information about using the REST API to create a repository webhook, see "Repository webhooks."
-
On your GitHub Enterprise Server instance, navigate to the main page of the repository.
-
Under your repository name, click Settings. If you cannot see the "Settings" tab, select the dropdown menu, then click Settings.

-
In the left sidebar, click Webhooks.
-
Click Add webhook.
-
Under "Payload URL", type the URL where you'd like to receive payloads.
-
Optionally, select the Content type drop-down menu, and click a data format to receive the webhook payload in.
- application/json will deliver the JSON payload directly as the body of the
POSTrequest. - application/x-www-form-urlencoded will send the JSON payload as a form parameter called
payload.
- application/json will deliver the JSON payload directly as the body of the
-
Optionally, under "Secret", type a string to use as a
secretkey. You should choose a random string of text with high entropy. You can use the webhook secret to limit incoming requests to only those originating from GitHub. For more information, see "Validating webhook deliveries." -
Under "Which events would you like to trigger this webhook?", select the webhook events that you want to receive. You should only subscribe to the webhook events that you need.
-
If you chose Let me select individual events, select the events that you want to trigger the webhook.
-
To make the webhook active immediately after adding the configuration, select Active.
-
Click Add webhook.
After you create a new webhook, GitHub will send you a simple ping event to let you know you've set up the webhook correctly. For more information, see "Webhook events and payloads."
Creating an organization webhook
You can create a webhook to subscribe to events that occur in a specific organization. You must be an organization owner to create webhooks in that organization.
You can use the GitHub web interface or the REST API to create an organization webhook. For more information about using the REST API to create an organization webhook, see "Organization webhooks."
- In the upper-right corner of any page on your GitHub Enterprise Server instance, click your profile photo.
- Click Your organizations.
- To the right of the organization, click Settings.
- In the left sidebar, click Webhooks.
- Click Add webhook.
- Under "Payload URL", type the URL where you'd like to receive payloads.
- Optionally, select the Content type drop-down menu, and click a data format to receive the webhook payload in.
- application/json will deliver the JSON payload directly as the body of the
POSTrequest. - application/x-www-form-urlencoded will send the JSON payload as a form parameter called
payload.
- application/json will deliver the JSON payload directly as the body of the
- Optionally, under "Secret", type a string to use as a
secretkey. You should choose a random string of text with high entropy. You can use the webhook secret to limit incoming requests to only those originating from GitHub. For more information, see "Validating webhook deliveries." - Under "Which events would you like to trigger this webhook?", select the types of webhooks you'd like to receive. You should only subscribe to the webhook events that you need.
- If you chose Let me select individual events, select the events that will trigger the webhook.
- To make the webhook active immediately after adding the configuration, select Active.
- Click Add webhook.
After you create a new webhook, GitHub will send you a simple ping event to let you know you've set up the webhook correctly. For more information, see "Webhook events and payloads."
Creating a global webhook for a GitHub Enterprise
Enterprise owners can create a global webhook to subscribe to events that occur within their enterprise.
You can use the GitHub web interface or the REST API to create a global webhook. For more information about using the REST API to create a global webhook, see "Global Webhooks."
-
In the top-right corner of GitHub Enterprise Server, click your profile photo, then click Enterprise settings.

-
In the enterprise account sidebar, click Settings.
-
Under " Settings", click Hooks.
-
Click Add webhook.
-
In the "Payload URL" field, type the URL where you'd like to receive payloads.
-
Optionally, select the Content type drop-down menu, and click a data format to receive the webhook payload in.
- application/json will deliver the JSON payload directly as the body of the
POSTrequest. - application/x-www-form-urlencoded will send the JSON payload as a form parameter called
payload.
- application/json will deliver the JSON payload directly as the body of the
-
Optionally, under "Secret", type a string to use as a
secretkey. You should choose a random string of text with high entropy. You can use the webhook secret to limit incoming requests to only those originating from GitHub. For more information, see "