---
title: "Update a repository webhook"
method: PATCH
path: "/repos/{owner}/{repo}/hooks/{hook_id}"
tags: ["repos"]
---

# Update a repository webhook

`PATCH /repos/{owner}/{repo}/hooks/{hook_id}`

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](/rest/webhooks/repo-config#update-a-webhook-configuration-for-a-repository)."

## Path parameters

- `owner` string, required
- `repo` string, required
- `hook_id` integer, required

## Request body

- object
  - `config` object — Key/value pairs to provide settings for this webhook.
    - `url` string, uri, required — The URL to which the payloads will be delivered.
    - `content_type` string — The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`.
    - `secret` string — If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/enterprise-server@3.7/webhooks/event-payloads/#delivery-headers).
    - `insecure_ssl` union
      - 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.**
      - number
    - `address` string
    - `room` string
  - `events` string[] — Determines what [events](https://docs.github.com/enterprise-server@3.7/webhooks/event-payloads) the hook is triggered for. This replaces the entire array of events.
  - `add_events` string[] — Determines a list of events to be added to the list of events that the Hook triggers for.
  - `remove_events` string[] — Determines a list of events to be removed from the list of events that the Hook triggers for.
  - `active` boolean — Determines if notifications are sent when the webhook is triggered. Set to `true` to send notifications.

## Response `200`

Response

- Hook — Webhooks for repositories.
  - `type` string, required
  - `id` integer, required — Unique identifier of the webhook.
  - `name` string, required — The name of a valid service, use 'web' for a webhook.
  - `active` boolean, required — Determines whether the hook is actually triggered on pushes.
  - `events` string[], required — Determines what events the hook is triggered for. Default: ['push'].
  - `config` object, required
    - `email` string
    - `password` string
    - `room` string
    - `subdomain` string
    - `url` string, uri — The URL to which the payloads will be delivered.
    - `insecure_ssl` union
      - 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.**
      - number
    - `content_type` string — The media type used to serialize the payloads. Supported values include `json` and `form`. The default is `form`.
    - `digest` string
    - `secret` string — If provided, the `secret` will be used as the `key` to generate the HMAC hex digest value for [delivery signature headers](https://docs.github.com/enterprise-server@3.7/webhooks/event-payloads/#delivery-headers).
    - `token` string
  - `updated_at` string, date-time, required
  - `created_at` string, date-time, required
  - `url` string, uri, required
  - `test_url` string, uri, required
  - `ping_url` string, uri, required
  - `deliveries_url` string, uri
  - `last_response` HookResponse, required
    - `code` integer, nullable, required
    - `status` string, nullable, required
    - `message` string, nullable, required

## Other responses

- `404` — Resource not found
- `422` — Validation failed, or the endpoint has been spammed.

---

[API](https://skmtc.net/github/apis/github-v3-rest-api-6.md) · [All operations](https://skmtc.net/github/apis/github-v3-rest-api-6/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/github/github-v3-rest-api-6/versions/15db3fa0759b/schema)
