# How to ensure Gitlab token has access to required groups/repositories

Follow these steps to grant a service account access to required repositories:

#### **Navigate to the GitLab Group**

1. Log in to GitLab.
2. In the left sidebar, click **"Groups"** → **"Your Groups"**.
3. Select the Group where you want to add the service account.<br>

   <figure><img src="/files/oQ4SdBwMRDZhwpTyyoPC" alt="" width="134"><figcaption></figcaption></figure>

#### **Open the Group’s Members Settings**

1. In the Group Dashboard, go to the left sidebar.
2. Click **"Settings"** → **"Members"**.<br>

   <figure><img src="/files/R5swWOFnONwJpXo2i6u9" alt="" width="188"><figcaption></figcaption></figure>

#### **Invite the Service Account**

1. Click **"Invite Member"** (top right corner).
2. In the **"Select members or email address"** field, enter the service account username or email.
3. Assign a "Reporter" or "Developer" role as required.
4. Click **"Invite"**.

Repeat the steps for all required groups.

Once added, the service account will inherit access to all repositories within the groups.


---

# 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.hivel.ai/integrations/scm/gitlab/how-to-ensure-gitlab-token-has-access-to-required-groups-repositories.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.
