This version of GitHub Enterprise was discontinued on 2022-10-12. No patch releases will be made, even for critical security issues. For better performance, improved security, and new features, upgrade to the latest version of GitHub Enterprise. For help with the upgrade, contact GitHub Enterprise support.
We've recently moved some of the REST API documentation. If you can't find what you're looking for, you might try the new Branches, Collaborators, Commits, Deploy Keys, Deployments, GitHub Pages, Releases, Metrics, Webhooks REST API pages.
Repository Webhook Configuration
Get a webhook configuration for a repository
Returns the webhook configuration for a repository. To get more information about the webhook, including the active state and events, use "Get a repository webhook."
Access tokens must have the read:repo_hook or repo scope, and GitHub Apps must have the repository_hooks:read permission.
Parameters
| Headers |
|---|
| Name, Type, Description |
acceptstringSetting to |
| Path parameters |
| Name, Type, Description |
ownerstringRequiredThe account owner of the repository. The name is not case sensitive. |
repostringRequiredThe name of the repository. The name is not case sensitive. |
hook_idintegerRequiredThe unique identifier of the hook. |
HTTP response status codes
| Status code | Description |
|---|---|
200 | OK |
Code samples
curl \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/hooks/HOOK_ID/configResponse
Status: 200{ "content_type": "json", "insecure_ssl": "0", "secret": "********", "url": "https://example.com/webhook" }Update a webhook configuration for a repository
Updates the webhook configuration for a repository. To update more information about the webhook, including the active state and events, use "Update a repository webhook."
Access tokens must have the write:repo_hook or repo scope, and GitHub Apps must have the repository_hooks:write permission.
Parameters
| Headers |
|---|
| Name, Type, Description |
acceptstringSetting to |
| Path parameters |
| Name, Type, Description |
ownerstringRequiredThe account owner of the repository. The name is not case sensitive. |
repostringRequiredThe name of the repository. The name is not case sensitive. |
hook_idintegerRequiredThe unique identifier of the hook. |
| Body parameters |
| Name, Type, Description |
urlstringThe URL to which the payloads will be delivered. |
content_typestringThe media type used to serialize the payloads. Supported values include |
secretstringIf provided, the |
insecure_sslstring or numberDetermines whether the SSL certificate of the host for |
HTTP response status codes
| Status code | Description |
|---|---|
200 | OK |
Code samples
curl \ -X PATCH \ -H "Accept: application/vnd.github+json" \ -H "Authorization: Bearer <YOUR-TOKEN>" \ http(s)://HOSTNAME/api/v3/repos/OWNER/REPO/hooks/HOOK_ID/configResponse
Status: 200{ "content_type": "json", "insecure_ssl": "0", "secret": "********", "url": "https://example.com/webhook" }