Skip to content

Update a system hook

PUT
/api/v4/hooks/{hook_id}

Updates a specified system hook.

hook_id
required
integer

The ID of the system hook

Media type application/json
object
url

The URL to send the request to

string
nullable
name

Name of the hook

string
nullable
description

Description of the hook

string
nullable
token

Secret token to validate received payloads; this isn’t returned in the response

string
nullable
signing_token

HMAC signing token used to compute the webhook-signature header. Must be in whsec_ format encoding a 32-byte key. Not returned in the response

string
nullable
push_events

When true, the hook fires on push events

boolean
nullable
tag_push_events

When true, the hook fires on new tags being pushed

boolean
nullable
merge_requests_events

Trigger hook on merge requests events

boolean
nullable
repository_update_events

Trigger hook on repository update events

boolean
nullable
enable_ssl_verification

Do SSL verification when triggering the hook

boolean
nullable
push_events_branch_filter

Trigger hook on specified branch only

string
nullable
branch_filter_strategy

Filter push events by branch. Possible values are wildcard (default), regex, and all_branches

string
nullable
Allowed values: wildcard regex all_branches
custom_webhook_template

Custom template for the request payload

string
nullable
url_variables

URL variables for interpolation

Array<object>
nullable
object
key
required

Name of the variable

string
nullable
Example
token
value
required

Value of the variable

string
nullable
Example
123
custom_headers

Custom headers

Array<object>
nullable
object
key
required

Name of the header

string
nullable
Example
X-Custom-Header
value
required

Value of the header

string
nullable
Example
value

OK

Media type application/json
object
id
integer format: int64
url
string
name
string
description
string
created_at
string format: date-time
push_events
boolean
tag_push_events
boolean
merge_requests_events
boolean
repository_update_events
boolean
enable_ssl_verification
boolean
organization_id
integer
alert_status
string
disabled_until
string format: date-time
url_variables
Array<object>
object
push_events_branch_filter
string
branch_filter_strategy
string
custom_webhook_template
string
custom_headers
Array<object>
object
token_present

Whether a secret token is configured

boolean
signing_token_present

Whether an HMAC signing token is configured

boolean
Example
{
"id": 1,
"url": "https://webhook.site",
"name": "Hook name",
"description": "Hook description",
"created_at": "2012-05-28T04:42:42-07:00",
"organization_id": 1,
"alert_status": ":executable",
"disabled_until": "2012-05-28T04:42:42-07:00",
"url_variables": [
{
"token": "secr3t"
}
],
"push_events_branch_filter": "my-branch-*",
"branch_filter_strategy": "wildcard",
"custom_webhook_template": "{\"event\":\"{{object_kind}}\"}",
"custom_headers": [
{
"X-Custom-Header": "value"
}
],
"token_present": false,
"signing_token_present": false
}

Validation error

Not found

Unprocessable entity