---
title: "Update a system hook"
method: PUT
path: "/api/v4/hooks/{hook_id}"
tags: ["hooks"]
---

# Update a system hook

`PUT /api/v4/hooks/{hook_id}`

## Request

- Base URL: `https://gitlab.com`
- URL: `https://gitlab.com/api/v4/hooks/{hook_id}`
- Auth: none declared

Updates a specified system hook.

## Path parameters

- `hook_id` integer, required

## Request body

- PutApiV4HooksHookId: Update a system hook
  - `url` string: The URL to send the request to
  - `name` string: Name of the hook
  - `description` string: Description of the hook
  - `token` string: Secret token to validate received payloads; this isn't returned in the response
  - `signing_token` string: HMAC signing token used to compute the webhook-signature header. Must be in whsec_<base64> format encoding a 32-byte key. Not returned in the response
  - `push_events` boolean: When true, the hook fires on push events
  - `tag_push_events` boolean: When true, the hook fires on new tags being pushed
  - `merge_requests_events` boolean: Trigger hook on merge requests events
  - `repository_update_events` boolean: Trigger hook on repository update events
  - `enable_ssl_verification` boolean: Do SSL verification when triggering the hook
  - `push_events_branch_filter` string: Trigger hook on specified branch only
  - `branch_filter_strategy` 'wildcard' | 'regex' | 'all_branches': Filter push events by branch. Possible values are `wildcard` (default), `regex`, and `all_branches`
  - `custom_webhook_template` string: Custom template for the request payload
  - `url_variables` object[]: URL variables for interpolation
    - `key` string, required: Name of the variable
    - `value` string, required: Value of the variable
  - `custom_headers` object[]: Custom headers
    - `key` string, required: Name of the header
    - `value` string, required: Value of the header

## Response `200`

Update a system hook

- APIEntitiesHook: API_Entities_Hook model
  - `id` integer, required
  - `url` string, required
  - `name` string, required
  - `description` string, required
  - `created_at` string, date-time, required
  - `push_events` boolean, required
  - `tag_push_events` boolean, required
  - `merge_requests_events` boolean, required
  - `repository_update_events` boolean, required
  - `enable_ssl_verification` boolean, required
  - `organization_id` integer
  - `alert_status` string, required
  - `disabled_until` string, date-time, required
  - `url_variables` object[]
  - `push_events_branch_filter` string, required
  - `branch_filter_strategy` string, required
  - `custom_webhook_template` string, required
  - `custom_headers` object[]
  - `token_present` boolean, required: Whether a secret token is configured
  - `signing_token_present` boolean, required: Whether an HMAC signing token is configured

## Other responses

- `400`: Validation error
- `404`: Not found
- `422`: Unprocessable entity

---

[API](https://skmtc.dev/gitlab/apis/gitlab-api.md) - [All operations](https://skmtc.dev/gitlab/apis/gitlab-api/llms.txt) - [OpenAPI document](https://skmtc.dev/gitlab/apis/gitlab-api/revisions/b234947ef3f2?raw)
