# Configure GitLab Webhooks

## Configure Webhooks

GitLab allows webhooks to be configured on a GitLab Group level or per Project within a Group.

{% hint style="warning" %}
**PullRequest strongly recommends configuring webhooks on the Group level** so that new Projects your team creates will be immediately provisioned to use the PullRequest network if desired with no administrative intervention.
{% endhint %}

* [**Apply on the Group level**](https://docs.pullrequest.com/gitlab-self-managed/configure-gitlab-webhooks#applying-on-the-group-level) (recommended)
* [**Apply to each Project individually**](https://docs.pullrequest.com/gitlab-self-managed/configure-gitlab-webhooks#applying-on-the-project-level)

## Applying on the Group level

From your GitLab dashboard, select the desired GitLab **Group** -> **Settings** -> **Webhooks**:

![NOTE: GitLab's interface may change without notice](https://1378996070-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LelcHIfjrgdiAjf_MQX%2F-LexoKta47BkwLJc_cGt%2F-LexrmlLOqc8BRpwEjy9%2Fgroup-settings-webhooks.png?alt=media\&token=f69509c0-7635-4b82-b197-e19a1037625b)

![](https://1378996070-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LelcHIfjrgdiAjf_MQX%2F-LexoKta47BkwLJc_cGt%2F-LexuJpzlc3VoI48g3TJ%2Fgitlab-webhook-settings.png?alt=media\&token=1c94829e-cbfd-4880-a4b0-2a7e28843038)

### Webhook Settings

#### **URL**&#x20;

The base URL of your Proxy with the following:

```
/webhooks/gitlab
```

#### Triggers

* [x] **Comments**
* [x] **Merge request events**

#### SSL verification

* [x] **Enable SSL Verification**

***OPTIONAL** -* Add a webhook secret. The secret will be used to sign your webhook requests as they are posted to the proxy:

* You will need the same webhook secret for all of your repositories if you add one.
* Update your webhook secret in the PullRequest Proxy UI if you are adding one, otherwise the proxy will not be able to verify/process the webhooks.

### Test Connection

Click the **Add Webhook** button; the webhook should appear in the **Webhooks** section at the bottom of the page.

Click the **Test** button to test the connection. You should receive a "Hook executed successfully:" message at the top of the screen.

{% hint style="warning" %}
If you received an error message, double-check the proxy base is valid and `/webhooks/gitlab` is added as a path.
{% endhint %}

The PullRequest Proxy repositories table has a `LAST WEBHOOK RECEIVED` column which will update once you start getting webhooks from GitLab for the project.

{% hint style="info" %}
The **Test** connection hook, used to test the connection in GitLab earlier, isn't counted.
{% endhint %}

## Applying on the Project level

From the PullRequest Proxy home screen, click the **Repositories** tab in the left sidebar. You should see a list of all of the repositories (GitLab Projects) the PullRequest posting user has appropriate access to.

![](https://1378996070-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LelcHIfjrgdiAjf_MQX%2F-LexoKta47BkwLJc_cGt%2F-Lexpf6EIoLVrfWEDS_k%2Fon-premise-repo-configuration.png?alt=media\&token=e2528be9-da3b-4580-ab4b-519237b7087d)

Click on a repository's **Configure** button. This will open a GitLab configuration page to create a webhook for the selected project.

![](https://1378996070-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LelcHIfjrgdiAjf_MQX%2F-LexoKta47BkwLJc_cGt%2F-LexuJpzlc3VoI48g3TJ%2Fgitlab-webhook-settings.png?alt=media\&token=1c94829e-cbfd-4880-a4b0-2a7e28843038)

### Webhook Settings

#### **URL**&#x20;

The base URL of your Proxy with the following:

```
/webhooks/gitlab
```

#### Triggers

* [x] **Comments**
* [x] **Merge request events**

#### SSL verification

* [x] **Enable SSL Verification**

***OPTIONAL** -* Add a webhook secret. The secret will be used to sign your webhook requests as they are posted to the proxy:

* You will need the same webhook secret for all of your repositories if you add one.
* Update your webhook secret in the PullRequest Proxy UI if you are adding one, otherwise the proxy will not be able to verify/process the webhooks.

### Test Connection

Click the **Add Webhook** button; the webhook should appear in the **Webhooks** section at the bottom of the page.

Click the **Test** button to test the connection. This will expand a list of trigger types.

Select **Merge request events** from the list.

![](https://1378996070-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LelcHIfjrgdiAjf_MQX%2F-Lf0W7T0uXEoJzA8Tg39%2F-Lf0diKJxYoiyXheQLOL%2Fmerge-request-events.png?alt=media\&token=11ed93b3-c000-40d7-8b98-106132212794)

&#x20;You should receive a "Hook executed successfully:" message at the top of the screen.

{% hint style="warning" %}
If you received an error message, double-check the proxy base is valid and `/webhooks/gitlab` is added as a path.
{% endhint %}

Repeat these steps for any other GitLab Projects listed in PullRequest that have not been configured.

The PullRequest Proxy repositories table has a `LAST WEBHOOK RECEIVED` column which will update once you start getting webhooks from GitLab for the project.

{% hint style="info" %}
The **Test** connection hook, used to test the connection in GitLab earlier, isn't counted.
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pullrequest.com/gitlab-on-prem-self-managed/configure-gitlab-webhooks.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
