Update a hook
PATCH
/user/hooks/{id}
const url = 'https://gitea.com/api/v1/user/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.com/api/v1/user/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”id
required
integer format: int64
Id of the hook to update
Request Body
Section titled “Request Body”Media typeapplication/json
EditHookOption options when modify one hook
object
active
Whether the webhook is active and will be triggered
boolean
authorization_header
Authorization header to include in webhook requests
string
branch_filter
Branch filter pattern to determine which branches trigger the webhook
string
config
Configuration settings for the webhook
object
key
additional properties
string
events
List of events that trigger this webhook
Array<string>
Examplegenerated
{ "active": true, "authorization_header": "example", "branch_filter": "example", "config": { "additionalProperty": "example" }, "events": [ "example" ]}Responses
Section titled “Responses”Hook
Media typeapplication/json
Hook a hook is a web hook when one repository changed
object
active
Whether the webhook is active and will be triggered
boolean
authorization_header
Authorization header to include in webhook requests
string
branch_filter
Branch filter pattern to determine which branches trigger the webhook
string
config
Configuration settings for the webhook
object
key
additional properties
string
created_at
string format: date-time
events
List of events that trigger this webhook
Array<string>
id
The unique identifier of the webhook
integer format: int64
type
The type of the webhook (e.g., gitea, slack, discord)
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"}