---
title: "Edit a hook"
method: PATCH
path: "/repos/{owner}/{repo}/hooks/{id}"
tags: ["Webhooks"]
---

# Edit a hook

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

## Path parameters

- `owner` string, required
- `repo` string, required
- `id` string, required

## Request body

- object
  - `config` object, required
    - `url` string
    - `content_type` string
    - `secret` string
  - `events` string[]
  - `active` boolean

## Response `200`

Success

- Hook
  - `id` integer
  - `type` 'gogs' | 'slack' | 'discord' | 'dingtalk'
  - `events` string[]
  - `active` boolean
  - `config` object
  - `created_at` string, date-time
  - `updated_at` string, date-time

## Other responses

- `404` — Resource not found.
- `422` — Validation error.

---

[API](https://skmtc.net/gogs/apis/gogs-api.md) · [All operations](https://skmtc.net/gogs/apis/gogs-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/gogs/gogs-api/revisions/87e2da32266c/schema)
