2021-01-29 00:20:46 +05:30
---
2021-03-11 19:13:27 +05:30
stage: Enablement
group: Distribution
2021-02-22 17:27:13 +05:30
info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://about.gitlab.com/handbook/engineering/ux/technical-writing/#assignments
2021-01-29 00:20:46 +05:30
---
2021-03-11 19:13:27 +05:30
# Webhooks administration **(FREE SELF)**
2014-09-02 18:07:02 +05:30
2020-05-24 23:13:21 +05:30
GitLab provides Rake tasks for webhooks management.
Requests to the [local network by webhooks ](../security/webhooks.md ) can be allowed or blocked by an
administrator.
## Add a webhook to all projects
To add a webhook to all projects, run:
2014-09-02 18:07:02 +05:30
2020-03-13 15:44:24 +05:30
```shell
2019-09-30 21:07:59 +05:30
# omnibus-gitlab
sudo gitlab-rake gitlab:web_hook:add URL="http://example.com/hook"
2020-05-24 23:13:21 +05:30
2019-09-30 21:07:59 +05:30
# source installations
bundle exec rake gitlab:web_hook:add URL="http://example.com/hook" RAILS_ENV=production
```
2014-09-02 18:07:02 +05:30
2020-05-24 23:13:21 +05:30
## Add a webhook to projects in a namespace
To add a webhook to all projects in a specific namespace, run:
2014-09-02 18:07:02 +05:30
2020-03-13 15:44:24 +05:30
```shell
2019-09-30 21:07:59 +05:30
# omnibus-gitlab
2020-05-24 23:13:21 +05:30
sudo gitlab-rake gitlab:web_hook:add URL="http://example.com/hook" NAMESPACE=< namespace >
2019-09-30 21:07:59 +05:30
# source installations
2020-05-24 23:13:21 +05:30
bundle exec rake gitlab:web_hook:add URL="http://example.com/hook" NAMESPACE=< namespace > RAILS_ENV=production
2019-09-30 21:07:59 +05:30
```
2014-09-02 18:07:02 +05:30
2020-05-24 23:13:21 +05:30
## Remove a webhook from projects
To remove a webhook from all projects, run:
2014-09-02 18:07:02 +05:30
2020-03-13 15:44:24 +05:30
```shell
2019-09-30 21:07:59 +05:30
# omnibus-gitlab
sudo gitlab-rake gitlab:web_hook:rm URL="http://example.com/hook"
2020-05-24 23:13:21 +05:30
2019-09-30 21:07:59 +05:30
# source installations
bundle exec rake gitlab:web_hook:rm URL="http://example.com/hook" RAILS_ENV=production
```
2014-09-02 18:07:02 +05:30
2020-05-24 23:13:21 +05:30
## Remove a webhook from projects in a namespace
To remove a webhook from projects in a specific namespace, run:
2014-09-02 18:07:02 +05:30
2020-03-13 15:44:24 +05:30
```shell
2019-09-30 21:07:59 +05:30
# omnibus-gitlab
2020-05-24 23:13:21 +05:30
sudo gitlab-rake gitlab:web_hook:rm URL="http://example.com/hook" NAMESPACE=< namespace >
2019-09-30 21:07:59 +05:30
# source installations
2020-05-24 23:13:21 +05:30
bundle exec rake gitlab:web_hook:rm URL="http://example.com/hook" NAMESPACE=< namespace > RAILS_ENV=production
2019-09-30 21:07:59 +05:30
```
2014-09-02 18:07:02 +05:30
2020-05-24 23:13:21 +05:30
## List all webhooks
To list all webhooks, run:
2014-09-02 18:07:02 +05:30
2020-03-13 15:44:24 +05:30
```shell
2019-09-30 21:07:59 +05:30
# omnibus-gitlab
sudo gitlab-rake gitlab:web_hook:list
2020-05-24 23:13:21 +05:30
2019-09-30 21:07:59 +05:30
# source installations
bundle exec rake gitlab:web_hook:list RAILS_ENV=production
```
2014-09-02 18:07:02 +05:30
2020-05-24 23:13:21 +05:30
## List webhooks for projects in a namespace
To list all webhook for projects in a specified namespace, run:
2014-09-02 18:07:02 +05:30
2020-03-13 15:44:24 +05:30
```shell
2019-09-30 21:07:59 +05:30
# omnibus-gitlab
2020-05-24 23:13:21 +05:30
sudo gitlab-rake gitlab:web_hook:list NAMESPACE=< namespace >
2019-09-30 21:07:59 +05:30
# source installations
2020-05-24 23:13:21 +05:30
bundle exec rake gitlab:web_hook:list NAMESPACE=< namespace > RAILS_ENV=production
2019-09-30 21:07:59 +05:30
```