Update a repository webhook

Updates a webhook configured in a repository. If you previously had a secret set, you must provide the same secret or set a new secret or the secret will be removed. If you are only updating individual webhook config properties, use "Update a webhook configuration for a repository."


string The token will be passed in the authorization header.




object Key/value pairs to provide settings for this webhook. These are defined below.

string The URL to which the payloads will be delivered.

string The media type used to serialize the payloads. Supported values include json and form. The default is form.

string If provided, the secret will be used as the key to generate the HMAC hex digest value for delivery signature headers.

string 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.



string[] Determines what events the hook is triggered for. This replaces the entire array of events.

string[] Determines a list of events to be added to the list of events that the Hook triggers for.

string[] Determines a list of events to be removed from the list of events that the Hook triggers for.

boolean Determines if notifications are sent when the webhook is triggered. Set to true to send notifications.


PATCH https://api.github.com/repos///hooks/
authorization: bearer undefined
accept: application/vnd.github.v3+json
user-agent: octokit.rest
content-length: 0

Example Response

Status: 200
  "type": "Repository",
  "id": 12345678,
  "name": "web",
  "active": true,
  "events": [
  "config": {
    "content_type": "json",
    "insecure_ssl": "0",
    "url": "https://example.com/webhook"
  "updated_at": "2019-06-03T00:57:16Z",
  "created_at": "2019-06-03T00:57:16Z",
  "url": "https://api.github.com/repos/octocat/Hello-World/hooks/12345678",
  "test_url": "https://api.github.com/repos/octocat/Hello-World/hooks/12345678/test",
  "ping_url": "https://api.github.com/repos/octocat/Hello-World/hooks/12345678/pings",
  "last_response": {
    "code": null,
    "status": "unused",
    "message": null

See documentation on GitHub developer guides