v68

latestOpenAPI 3.0.3MITraw.githubusercontent.com2026-08-011,21696712.3 MB
repos

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

patch/repos/{owner}/{repo}/hooks/{hook_id}

Path parameters

ownerstring required

The account owner of the repository. The name is not case sensitive.

repostring required

The name of the repository without the .git extension. The name is not case sensitive.

hook_idinteger required

The unique identifier of the hook. You can find this value in the X-GitHub-Hook-ID header of a webhook delivery.

Request body

eventsstring[]

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

add_eventsstring[]

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

remove_eventsstring[]

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

activeboolean

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

Example request

{
  "config": {
    "url": "https://example.com/webhook",
    "content_type": "\"json\"",
    "secret": "\"********\"",
    "insecure_ssl": "\"0\""
  }
}

Response

Response

typestring required
idinteger required

Unique identifier of the webhook.

namestring required

The name of a valid service, use 'web' for a webhook.

activeboolean required

Determines whether the hook is actually triggered on pushes.

eventsstring[] required

Determines what events the hook is triggered for. Default: ['push'].

updated_atstring date-time required
created_atstring date-time required
urlstring uri required
test_urlstring uri required
ping_urlstring uri required
deliveries_urlstring uri

Example response

{
  "id": 42,
  "name": "web",
  "active": true,
  "events": [
    "push",
    "pull_request"
  ],
  "config": {
    "url": "https://example.com/webhook",
    "content_type": "\"json\"",
    "secret": "\"********\"",
    "insecure_ssl": "\"0\""
  },
  "updated_at": "2011-09-06T20:39:23Z",
  "created_at": "2011-09-06T17:26:27Z",
  "url": "https://api.github.com/repos/octocat/Hello-World/hooks/1",
  "test_url": "https://api.github.com/repos/octocat/Hello-World/hooks/1/test",
  "ping_url": "https://api.github.com/repos/octocat/Hello-World/hooks/1/pings",
  "deliveries_url": "https://api.github.com/repos/octocat/Hello-World/hooks/1/deliveries"
}