> ## 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 CodeAnt AI webhooks to GitLab manually — group-level (Premium / Ultimate) or per-project.

<Note>
  Most users don't need this page. When you save a GitLab access token in [Settings → Configure Token](/pull_request/gitlab/configuration#step-2-paste-the-token-into-codeant-ai), CodeAnt AI installs per-project webhooks for you automatically.

  Use this page only if:

  * You're on **GitLab Premium / Ultimate** and want a single **group-level** webhook instead of per-project ones, **or**
  * Your network policy blocks CodeAnt AI from creating webhooks via the GitLab API on your behalf (e.g. an outbound restriction on the CodeAnt side that needs the webhooks pre-created).
</Note>

<Warning>
  Manual webhooks only replace the **webhook-creation** step. CodeAnt AI still needs to call your GitLab API to post review comments, fetch diffs, and update merge request status — so the GitLab API itself must remain reachable from CodeAnt AI for reviews to work. If your instance is fully API-blocked from CodeAnt's network, reviews cannot be posted regardless of how the webhooks are set up.
</Warning>

## Webhooks to add

CodeAnt AI listens for two kinds of events: merge request changes and comments on merge requests. Add both webhooks for full coverage.

<Tabs>
  <Tab title="Merge request events">
    | 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                                                              |
  </Tab>

  <Tab title="Comments">
    | Field                       | Value                                                                   |
    | --------------------------- | ----------------------------------------------------------------------- |
    | **Name**                    | `CodeAnt AI - Comments`                                                 |
    | **URL**                     | `https://vcs.codeant.ai/pr/gitlab/handle_comment/handleGitLabMRComment` |
    | **Trigger**                 | Comments                                                                |
    | **Enable SSL verification** | ✓ Enabled                                                               |
  </Tab>
</Tabs>

## Group-level webhooks (Premium / Ultimate)

Best when you want one set of webhooks to cover every project in a group.

1. In GitLab, open the group and go to **Settings** → **Webhooks** → **Add new webhook**.
2. Add the **Merge request events** webhook from the table above.
3. Click **Add webhook**.
4. Click **Add new webhook** again and add the **Comments** webhook.

<Tip>
  After saving, click **Test** → **Merge request events** (and again for **Comments**) on the webhook in GitLab. A 2xx response from CodeAnt AI confirms the webhook is wired up correctly.
</Tip>

## Project-level webhooks

Use this if your plan doesn't allow group-level webhooks, or you only want CodeAnt AI on specific projects.

1. In GitLab, open the project and go to **Settings** → **Webhooks** → **Add new webhook**.
2. Add both the **Merge request events** and **Comments** webhooks from the table above.
3. Repeat for every project you want reviewed.

<Info>
  This is exactly what CodeAnt AI's auto-install does for you when you save the access token in **Settings → Configure Token**. If you'd rather not do this by hand for each project, see [PR Review – GitLab](/pull_request/gitlab/configuration#step-2-paste-the-token-into-codeant-ai).
</Info>

## After adding webhooks

You still need a GitLab access token saved in CodeAnt AI so the app can post review comments and call the GitLab API. See the [access token guide](/setup/gitlab/access-token).

When you save the token, the **Configure Repository Webhooks** screen will list any projects still missing webhooks. If you've already added them manually (or via a group-level webhook), you can deselect those projects — CodeAnt AI won't create duplicates.

## Troubleshooting

<AccordionGroup>
  <Accordion title="Webhook test returns a non-2xx response">
    Check that **SSL verification** is enabled and that your GitLab instance can reach `vcs.codeant.ai` over HTTPS (port 443). Self-hosted GitLab instances behind a firewall may need an outbound allowlist — see [Network requirements](/setup/gitlab/self-hosted/control_center#network-requirements).
  </Accordion>

  <Accordion title="Merge requests still aren't being reviewed">
    * Confirm both webhooks (**Merge request events** *and* **Comments**) exist on the group or project.
    * Confirm an access token is saved in **Settings → Configure Token** in CodeAnt AI.
    * Confirm the token user has at least **Maintainer** access on the project.
  </Accordion>

  <Accordion title="I'm getting duplicate review comments">
    You probably have both a group-level webhook *and* a project-level webhook firing for the same merge request. Remove one of them.
  </Accordion>
</AccordionGroup>
