> ## 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.

# PR Review - GitLab

> Configure CodeAnt AI pull request review for GitLab

<Note>
  This guide assumes you are an Owner of the GitLab group (or a Maintainer of the projects) you want CodeAnt AI to review merge requests for. Works the same for **GitLab Cloud** and **self-hosted GitLab**.
</Note>

## Overview

CodeAnt AI reviews merge requests on GitLab by calling the GitLab API on your behalf and listening for repository events through webhooks. The fastest path is two steps:

1. Create a GitLab access token CodeAnt AI can use.
2. Paste the token into CodeAnt AI — webhooks install **automatically** on the projects you select.

Manual webhook setup is also supported for group-level webhooks (GitLab Premium / Ultimate) or networks where CodeAnt AI can't reach the GitLab API — see [Manual Webhook Setup](/setup/gitlab/manual-webhooks).

## Step 1: Create the access token

The same token guide applies for GitLab Cloud and self-hosted GitLab.

<Card title="Create your GitLab access token" icon="key" href="/setup/gitlab/access-token">
  Choose a token type, generate it in GitLab, and copy the value before closing the page.
</Card>

## Step 2: Paste the token into CodeAnt AI

This is where webhooks get installed for you — CodeAnt AI uses the token to detect which of your projects are missing webhooks and creates them via the GitLab API.

1. Sign in to [app.codeant.ai](https://app.codeant.ai) with GitLab.
2. Open **Settings** → **Configure Token**.
3. Paste the access token and click **Save & Configure Webhooks**.
4. On the **Configure Repository Webhooks** screen, CodeAnt AI lists every project missing a webhook. Use the search field and **Select All** to pick the projects you want reviewed, then click **Create Webhooks (N)**.

CodeAnt AI shows a checkmark next to each project as the webhook is installed. Once that completes, merge requests will start being reviewed.

<Tip>
  Need to add more repos later? Re-open **Settings → Configure Token** and the dialog will show any newly-discovered projects that don't yet have webhooks.
</Tip>

## Troubleshooting

<AccordionGroup>
  <Accordion title="The sidebar shows a 'GitLab token expired' banner">
    The token saved in CodeAnt AI is no longer accepted by GitLab — usually because it expired or was revoked. Generate a new token and click **Reconfigure** on the Configure Token page. Webhooks already installed in GitLab keep working; you only need to re-run the repo-selection step if new repos were added.
  </Accordion>

  <Accordion title="Merge requests aren't getting reviewed">
    * Open **Settings → Configure Token** in CodeAnt AI and confirm the project appears in the list with a webhook installed. If it's still in the "missing webhooks" list, select it and click **Create Webhooks**.
    * If the auto-install failed for a specific project, the token user (or service account) likely doesn't have **Maintainer** access on that project. Fix the permission and reconfigure the token to retry.
    * In GitLab, open **Settings → Webhooks** on the project and use **Test → Merge request events** to confirm CodeAnt AI is reachable. A 2xx response means the webhook is wired up correctly.
  </Accordion>

  <Accordion title="Reviews are attributed to the wrong user">
    Reviews are posted as the user who owns the access token. Switch to a **service-account personal access token** or a **group access token** if you'd rather not use your own account — see the [access token guide](/setup/gitlab/access-token).
  </Accordion>

  <Accordion title="I'm on Ultimate and want a single group-level webhook instead of per-project ones">
    Group-level webhooks aren't created automatically. Follow [Manual Webhook Setup](/setup/gitlab/manual-webhooks) to add them yourself.
  </Accordion>
</AccordionGroup>
