Edit a hook in a repository
PATCH
/repos/{owner}/{repo}/hooks/{id}
const url = 'https://gitea.example.com/api/v1/repos/example/example/hooks/1';const options = { method: 'PATCH', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"active":true,"authorization_header":"example","branch_filter":"example","config":{"additionalProperty":"example"},"events":["example"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://gitea.example.com/api/v1/repos/example/example/hooks/1 \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "active": true, "authorization_header": "example", "branch_filter": "example", "config": { "additionalProperty": "example" }, "events": [ "example" ] }'Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”owner
required
string
Owner of the repo
repo
required
string
Name of the repo
id
required
integer format: int64
Index of the hook
Request Body
Section titled “Request Body”EditHookOption options when modify one hook
object
active
boolean
authorization_header
string
branch_filter
string
config
object
key
additional properties
string
events
Array<string>
Examplegenerated
{ "active": true, "authorization_header": "example", "branch_filter": "example", "config": { "additionalProperty": "example" }, "events": [ "example" ]}EditHookOption options when modify one hook
object
active
boolean
authorization_header
string
branch_filter
string
config
object
key
additional properties
string
events
Array<string>
Responses
Section titled “Responses”Hook
Media typeapplication/json
Hook a hook is a web hook when one repository changed
object
active
boolean
authorization_header
string
branch_filter
string
config
object
key
additional properties
string
created_at
string format: date-time
events
Array<string>
id
integer format: int64
type
string
updated_at
string format: date-time
Examplegenerated
{ "active": true, "authorization_header": "example", "branch_filter": "example", "config": { "additionalProperty": "example" }, "created_at": "2026-04-15T12:00:00Z", "events": [ "example" ], "id": 1, "type": "example", "updated_at": "2026-04-15T12:00:00Z"}APINotFound is a not found empty response
Media typeapplication/json