PATCH
/repos/{owner}/{repo}/hooks/{hook_id}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."
- RetriesRetries up to 2×, 500ms backoff, 30s timeout.
ownerstringrequired
The account owner of the repository. The name is not case sensitive.
repostringrequired
The name of the repository without the `.git` extension. The name is not case sensitive.
hook_idintegerrequired
The unique identifier of the hook. You can find this value in the `X-GitHub-Hook-ID` header of a webhook delivery.
configobjectoptional
Configuration object of the webhook
eventsarray<string>optional
Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for. This replaces the entire array of events.
add_eventsarray<string>optional
Determines a list of events to be added to the list of events that the Hook triggers for.
remove_eventsarray<string>optional
Determines a list of events to be removed from the list of events that the Hook triggers for.
activebooleanoptional
Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications.
200Response
typestringrequired
idintegerrequired
Unique identifier of the webhook.
namestringrequired
The name of a valid service, use 'web' for a webhook.
activebooleanrequired
Determines whether the hook is actually triggered on pushes.
eventsarray<string>required
Determines what events the hook is triggered for. Default: ['push'].
configobjectrequired
Configuration object of the webhook
updated_atstringrequired
created_atstringrequired
urlstringrequired
test_urlstringrequired
ping_urlstringrequired
deliveries_urlstringoptional
last_responseobjectrequired
404Resource not found
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
422Validation failed, or the endpoint has been spammed.
messagestringrequired
documentation_urlstringrequired
errorsarray<object>optional
Error handling
A 404 is returned: Resource not found. A 422 is returned: Validation failed, or the endpoint has been spammed.