# Connect GitLab to iftrue using a Personal Access Token

### Before You Start

Make sure the GitLab user you are using:

* Has access to the repositories you want to integrate
* Has sufficient permissions (at least read access to projects)

### Step 1 - Go to Personal Access Tokens

1. Navigate to&#x20;

   ```
   https://[your-gitlab-domain]/-/user_settings/personal_access_tokens
   ```
2. Enter a name (e.g., iftrue integration)
3. Set an expiration date (recommended: 1 year)
4. Select the following scopes:

   ✅ api

   ✅ read\_user

   ✅ read\_repository
5. Click Create personal access token

### Step 2 - Connect to iftrue

1. Open the GitLab integration page:&#x20;

   ```
   https://app.iftrue.co/onboarding/git?provider=gitlab&settings=true
   ```
2. Paste your token and base url for the gitlab into the required field
3. Complete the setup

<figure><img src="/files/KOWANKc5EUC9u2ISDbet" alt=""><figcaption></figcaption></figure>


---

# 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.iftrue.co/getting-started/integrations/gitlab-self-managed/connect-gitlab-to-iftrue-using-a-personal-access-token.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.
