PATCH/repos/{owner}/{repo}/hooks/{hook_id}/config

Update a repository webhook configuration

Updates the delivery settings for a webhook configured in a repository. Supply the configuration fields you want to change; use the repository webhook update endpoint to change its active state or subscribed events. OAuth app tokens and personal access tokens (classic) need the write:repo_hook or repo scope.

  • IdempotentThe SDK sends Idempotency-Key, so a retried request is only applied once.

3 parameters · 4 body fields
ownerstringrequired
The account owner of the repository; the name is not case-sensitive.
repostringrequired
The repository name without the `.git` extension; the name is not case-sensitive.
hook_idintegerrequired
The unique identifier of the webhook. You can find it in the `X-GitHub-Hook-ID` header of a webhook delivery.

Webhook delivery configuration fields to update. You can supply any of the listed fields.

urlstringoptional
The URL to which the payloads will be delivered.
content_typestringoptional
The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`.
secretstringoptional
If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers).
insecure_sslstringoptional
Controls SSL certificate verification for the `url` host: `0` enables verification and `1` disables it. Defaults to `0`.

1 status code
200Returns the updated webhook configuration, including its delivery URL, content type, secret, and SSL verification setting.
urlstringoptional
The URL to which the payloads will be delivered.
content_typestringoptional
The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`.
secretstringoptional
If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/webhooks/event-payloads/#delivery-headers).
insecure_sslstringoptional
Determines whether the SSL certificate of the host for `url` will be verified when delivering payloads. Supported values include `0` (verification is performed) and `1` (verification is not performed). The default is `0`. **We strongly recommend not setting this to `1` as you are subject to man-in-the-middle and other attacks.**

Error handling

When supplied, url must be a valid URI, and content_type must be json or form—it defaults to form when omitted. The insecure_ssl value must be 0 or 1 and defaults to 0; the owner path parameter and repo path parameter must identify the repository, and the hook_id path parameter must identify its webhook. OAuth app tokens and personal access tokens (classic) need the write:repo_hook or repo scope.