> ## Documentation Index
> Fetch the complete documentation index at: https://docs.codeant.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Manual Webhook Setup

> Add GitLab webhooks for merge request reviews and review commands, then verify delivery.

## Before you begin

Most users can [save an access token and let CodeAnt install project webhooks](https://docs.codeant.ai/setup/gitlab/access-token.md#connect-your-projects). Use this guide when you want group-level webhooks or need to create webhooks yourself.

You need:

* A valid [GitLab access token saved in CodeAnt AI](https://docs.codeant.ai/setup/gitlab/access-token.md).
* **Maintainer** or **Owner** access for project webhooks, or **Owner** access for group webhooks.
* GitLab Premium or Ultimate for group webhooks. Project webhooks are available on all tiers. See [GitLab's webhook requirements](https://docs.gitlab.com/user/project/integrations/webhooks/).

> [!WARNING]
>
> Manual setup replaces webhook creation only. CodeAnt must still reach the GitLab API to fetch changes and post comments. For self-hosted GitLab, check the [network requirements](https://docs.codeant.ai/setup/gitlab/self-hosted/control_center.md#network-requirements) before continuing.

## Add both webhooks

Use project webhooks to review selected projects. Use group webhooks to receive events from projects in a group and its subgroups. Avoid installing both levels for the same projects, which can deliver duplicate events.

**1. Open webhook settings**

In GitLab, open the project or group you want reviewed. Go to **Settings** → **Webhooks** and select **Add new webhook**.

**2. Add the merge request webhook**

Enter these values:

| Field | Value |
| - | - |
| Name | `CodeAnt AI - Merge Request Events` |
| URL | `https://vcs.codeant.ai/pr/gitlab/pr_review/processMergeRequestGitLab` |
| Trigger | **Merge request events** |
| Enable SSL verification | Enabled |

Select **Add webhook**. This webhook sends merge request events to CodeAnt for review.

**3. Add the comments webhook**

Select **Add new webhook** again and enter these values:

| Field | Value |
| - | - |
| Name | `CodeAnt AI - Comments` |
| URL | `https://vcs.codeant.ai/pr/gitlab/handle_comment/handleGitLabMRComment` |
| Trigger | **Comments** |
| Enable SSL verification | Enabled |

Select **Add webhook**. This webhook sends MR comments to CodeAnt, including review commands and questions.

For project-level setup, repeat these steps for every project you want reviewed. If you later open CodeAnt's **Configure Repository Webhooks** screen, deselect projects already covered by your manual webhooks before creating more.

## Verify delivery and get a review

1. Confirm that both webhooks appear in GitLab's **Settings** → **Webhooks**.
2. Use the merge request webhook's **Test** menu to send a **Merge request events** test. Test the comments webhook with a **Comments** event as well.
3. Check the response for each test. A 2xx response confirms that GitLab delivered the event to CodeAnt; it does not prove that token access or a review succeeded.
4. Open a new merge request in a covered project and check for CodeAnt's review feedback on the MR.

To request a review on an existing MR, post:

```text theme={"theme":"css-variables"}
@codeant-ai: review
```

## Troubleshooting

> [accordion] My webhook test fails
>
> Compare the URL and trigger with the tables above. Keep SSL verification enabled. For self-hosted GitLab, confirm that the instance can reach `vcs.codeant.ai` over HTTPS on port 443. Check the webhook's recent delivery details for the response, and [contact CodeAnt support](mailto:support@codeant.ai) if the endpoint still rejects the request.

> [accordion] Delivery succeeds, but no review appears
>
> Confirm that a valid access token is saved under **Settings** → **Configure Token** in CodeAnt and that its identity has Maintainer access to the project. Check that the MR belongs to a project covered by the webhooks, then post `@codeant-ai: review`. If it still fails, [contact CodeAnt support](mailto:support@codeant.ai) with the MR URL and webhook response. Do not include the access token.

> [accordion] Review commands do not receive a response
>
> Check that the comments webhook uses the comments endpoint and has **Comments** selected. The merge request events webhook alone does not deliver review commands.

> [accordion] I receive duplicate reviews
>
> Check whether both group and project webhooks send the same events to CodeAnt. Keep one set covering each project and remove the duplicate set.

## Next steps

> [card] [Customize your reviews](https://docs.codeant.ai/pull_request/customize/rules.md)
>
> Add review rules for your team's coding standards.

> [card] [Ask about a finding](https://docs.codeant.ai/pull_request/features/chat.md)
>
> Ask CodeAnt questions directly on your merge request.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.