> For the complete documentation index, see [llms.txt](https://docs.hivel.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.hivel.ai/integrations/version-control/gitlab/gitlab-cloud-classic-token-recommended.md).

# GitLab Cloud - Classic Token (recommended)

To connect GitLab Cloud to Hivel using a Personal Access Token (PAT), follow these steps:

**Data Access by Hivel**

* Hivel accesses the past **30-90 days** of commits and pull requests from active repositories during the initial sync.

**Authorization Mechanism**

* Hivel integrates with GitLab Cloud using a **Personal Access Token**.
* You retain full control - access can be revoked at any time by revoking the token in GitLab under **Preferences → Access Tokens**.

**Requirements**

* Ensure the token is created from an account possessing write permissions to relevant GitLab repositories.

**Best Practice**

* Opt for a service account rather than an individual-linked account.
* Service accounts are typically overseen by the company's admin.

**Quick start:** skip the navigation - [open the token creation page](https://gitlab.com/-/user_settings/personal_access_tokens), then continue from Step 3. If the link doesn't take you there, follow from Step 1 below.

### **Steps to be followed:**

#### **Step 1: Prepare a Service Account**

1. **Log into the GitLab service account:**
   * Use a dedicated service account that has access to the required repositories for Hivel integration.
   * Avoid using personal GitLab accounts to ensure only the intended repositories are accessed.

#### **Step 2: Open Access Tokens**

1. In your GitLab account, click your **avatar** in the top-right corner.
2. Select **Preferences**.

   <img src="/files/yYLuiiUZSCpaPbeVDG1E" alt="" height="391" width="277">
3. On the left sidebar, select **Access > Personal access tokens**.<br>

   ![](/files/RqLGq9oY1MHBKQU90zGr)

#### **Step 3:**

Click on the **Generate token** dropdown and select **Legacy token**.

![](/files/1Txh8cy2284wtOZWezFC)

#### **Step 4: Configure the Personal Access Token**

1. Enter a name (e.g. *Hivel*), and set the **longest expiry date your organization's policy allows**. (GitLab requires an expiry date on personal access tokens. You can revoke the token manually when the engagement ends.)
2. Select the desired scopes:

   1. *read\_api*
   2. *read\_user*
   3. *read\_repository*

   ![](/files/0YOJDEomypD3gnaDXbYw)
3. Select **Create personal access token**, and **copy it** immediately, as you won't be able to view it again.

#### **Step 5: Connect in Hivel**

1. Copy the generated token immediately, as you won't be able to view it again.
2. Submit the token to Hivel

Hivel validates the token instantly - if the token is wrong, expired, or missing any of the required scopes, Hivel shows a clear message telling you exactly what the problem is. Generate a new token with the correct scopes and reconnect.

That's it, all done!

<br>
