v56

latestOpenAPI 3.0.3MITraw.githubusercontent.com2026-08-011,21696712.2 MB
orgs

Update an organization webhook

Updates a webhook configured in an organization. When you update a webhook, the secret will be overwritten. 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 an organization".

You must be an organization owner to use this endpoint.

OAuth app tokens and personal access tokens (classic) need admin:org_hook scope. OAuth apps cannot list, view, or edit webhooks that they did not create and users cannot list, view, or edit webhooks that were created by OAuth apps.

patch/orgs/{org}/hooks/{hook_id}

Path parameters

orgstring required

The organization name. 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.

activeboolean

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

namestring

Example request

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

Response

Response

idinteger required
urlstring uri required
ping_urlstring uri required
deliveries_urlstring uri
namestring required
eventsstring[] required
activeboolean required
updated_atstring date-time required
created_atstring date-time required
typestring required

Example response

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