Overview
This guide explains how to generate a Personal Access Token (PAT) in GitLab for securely integrating your repositories with DeepTraQ or other external tools. Personal access tokens allow applications to authenticate with GitLab APIs and repositories without exposing your account password.
Using personal access tokens helps improve security and automation by enabling:
- Controlled API access
- Secure authentication for integrations
- Repository access without sharing credentials
- Automated workflows and CI/CD integrations
Follow the steps below to create a personal access token in GitLab.
Supported Platforms
- GitLab repositories
Prerequisites
- A GitLab account with access to the required repositories
- Permission to access User Settings in GitLab
- Repository access to the projects you intend to integrate
Steps
-
Sign in to your GitLab account.
-
Open your user menu from the top-right corner of the interface.
-
Navigate to Preferences or Profile Settings.
-
Locate the Access Tokens section within the settings.
-
Click Create new personal access token.
-
Provide a name for the token so it can be easily identified later.
-
Configure the required scopes and permissions for your integration.
-
Select the appropriate access scopes such as:
- read_user to allow applications to retrieve your basic profile information.
- read_repository to allow tools to access private project repositories.
- read_api to provide read access to projects, registries, and packages through the API.
- write_repository to enable integrations to push changes to repositories.
- api for full API access and automation capabilities across your GitLab environment.
-
Click Create personal access token.
-
Copy the generated token immediately and store it securely.
GitLab displays the token only once for security reasons.
Field Reference
| Field | Description | Example |
|---|---|---|
| Token Name | Identifies the purpose of the token | DeepTraQ Integration Token |
| Scopes | Defines the permissions granted to the token | read_user, read_repository |
| read_user | Allows applications to access basic user profile information | Enabled |
| read_repository | Allows read access to private repositories | Enabled |
| read_api | Provides read access across projects and packages via API | Enabled |
| write_repository | Allows integrations to push changes to repositories | Enabled |
| api | Grants full API access across GitLab services | Enabled |