PATCH/orgs/{org}/hooks/{hook_id}

Update an organization webhook

Updates an organization webhook, including its delivery URL, subscribed events, active state, and configuration. If you previously set a secret, provide the same secret or a new one; otherwise, the secret is removed. You must be an organization owner, and OAuth app tokens and personal access tokens (classic) need the admin:org_hook scope.

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

2 parameters · 4 body fields
orgstringrequired
The organization name; matching is not case-sensitive. You must be an organization owner, and OAuth app tokens and personal access tokens (classic) need the `admin:org_hook` scope.
hook_idintegerrequired
The unique identifier of the webhook, available in the `X-GitHub-Hook-ID` header of a webhook delivery.

Optional webhook settings to update. If you previously set a secret, provide the same secret or a new one; omitting it removes the secret.

configobjectoptional
Key/value pairs to provide settings for this webhook.
eventsarray<string>optional
Determines what [events](https://docs.github.com/webhooks/event-payloads) the hook is triggered for.
Default:["push"]
activebooleanoptional
Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications.
Default:true
namestringoptional
The webhook name.

3 status codes
200Returns the updated organization webhook, including its identifier, URL, subscribed events, active state, configuration, and timestamps.
idintegerrequired
urlstringrequired
ping_urlstringrequired
deliveries_urlstringoptional
namestringrequired
eventsarray<string>required
activebooleanrequired
configobjectrequired
updated_atstringrequired
created_atstringrequired
typestringrequired
404Returned when the organization or webhook cannot be found.
messagestringoptional
documentation_urlstringoptional
urlstringoptional
statusstringoptional
422Returned when validation fails or the endpoint has been spammed.
messagestringrequired
documentation_urlstringrequired
errorsarray<object>optional

Error handling

A 404 is returned when the organization or webhook cannot be found. A 422 is returned when validation fails or the endpoint has been spammed. The org path parameter identifies the organization, and the hook_id path parameter identifies the webhook; you must be an organization owner, and OAuth app tokens and personal access tokens (classic) need the admin:org_hook scope. Within config, url is required; if you previously set a secret, provide the same secret or a new one to avoid removing it.