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

# GitLab

> Connect GitLab to correlate incidents with recent code changes.

Connecting GitLab lets Traversal correlate incidents with recent code changes by pulling commits and merge requests, helping it explain "what changed" alongside telemetry evidence. Supports both **gitlab.com** and **self-hosted GitLab instances**.

## What Traversal reads

* **Merge requests** — recent MRs, diffs, and discussions
* **Commits** — commit history and changed files
* **Code** — file contents and code search results

## Setup

<Tabs>
  <Tab title="Personal access token (recommended)">
    <Steps>
      <Step title="Create a token">
        1. Go to **User Settings > Access Tokens** ([gitlab.com/-/user\_settings/personal\_access\_tokens](https://gitlab.com/-/user_settings/personal_access_tokens))
        2. Click **Add new token**
        3. Set scopes: `read_api`, `read_repository`, or `api`
        4. Click **Create personal access token** and copy the token immediately
      </Step>

      <Step title="Configure in Traversal">
        Go to **Company Knowledge > Integrations**, select GitLab, and paste the token.

        You can optionally scope access further:

        * Use **Project IDs** for a comma-separated list of project IDs or project paths such as `mygroup/service-api`
        * Use **Group ID** for group-wide access

        For self-hosted GitLab, expand **Self-Hosted Configuration** and enter the host base URL, such as `https://gitlab.yourcompany.com`. Do not include `/api/v4`. Traversal appends that path automatically.
      </Step>
    </Steps>
  </Tab>

  <Tab title="Project access token">
    <Steps>
      <Step title="Create a token">
        Go to your GitLab project's **Settings > Access Tokens** and create a token with `read_api` or `api` scope.
      </Step>

      <Step title="Configure in Traversal">
        Select **Project Access Token**, enter the numeric **Project ID** from project settings, and paste the token.

        For self-hosted GitLab, enter the host base URL only. Do not include `/api/v4`.
      </Step>
    </Steps>
  </Tab>

  <Tab title="Group access token">
    <Steps>
      <Step title="Create a token">
        Go to your GitLab group's **Settings > Access Tokens** and create a token with `read_api` or `api` scope.
      </Step>

      <Step title="Configure in Traversal">
        Select **Group Access Token**, enter the numeric **Group ID** from group settings, and paste the token.

        For self-hosted GitLab, enter the host base URL only. Do not include `/api/v4`.
      </Step>
    </Steps>
  </Tab>
</Tabs>

### Self-hosted GitLab

For self-hosted instances, expand **Self-Hosted Configuration** and enter your GitLab host base URL (for example, `https://gitlab.yourcompany.com`). Do not include `/api/v4`. Ensure the instance is accessible from Traversal.

### Required token scopes

* **Read-only:** `read_api` + `read_repository`
* **Broader access:** `api`

## More information

* [GitLab personal access tokens](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html)
* [GitLab API documentation](https://docs.gitlab.com/ee/api/rest/)
