---
title: "GitLab Commits (Default branch)"
canonical_url: "https://docs.getdx.com/connectors/gitlab-commits-trunk/"
md_url: "https://docs.getdx.com/connectors/gitlab-commits-trunk.md"
last_updated: "2026-06-18"
---

# GitLab Commits (Default branch)
By integrating GitLab Commits connector with DX, you can import metadata on individual GitLab commits from the trunk branch of your repositories—this data is often useful for teams that do trunk-based development. Please refer to the API documentation below and our [schema explorer](https://docs.getdx.com/schema/) to see what data DX imports.

Before proceeding, please make sure that you have first enabled the GitLab connector by following the steps [here](https://docs.getdx.com/connectors/gitlab/).

## Prerequisites

To connect GitLab to DX, you need:

- a GitLab account that can create a [Group Access Token](https://docs.gitlab.com/user/group/settings/group_access_tokens/) or a [Service Account](https://docs.gitlab.com/user/profile/service_accounts/)
- allowlist [DX IP addresses](https://docs.getdx.com/allowlisting-dx/) if your GitLab instance is behind a firewall or has IP restrictions

## Setup instructions

Follow the steps below to connect GitLab to DX.

### Data connection

#### Step 1

Either create a Group Access Token with the **Developer** role and **read_api** scope, or create a group service account, add it to the group with the **Developer** role, and create an access token with the **read_api** scope.

#### Step 2

Grant the Group access to projects that you want to import.

#### Step 3

- Navigate to the connections page in DX and select "+ Connection" in the top right.
- Enter the credentials you have generated in the previous steps—refer to the information below for errors and troubleshooting.
  - For GitLab-hosted instances, the API base URL should be https://gitlab.com/.

## API reference

The table below lists the specific API endpoints that are used by DX.


| Endpoint | Documentation |
|---------------------------------------------------------------------|---------------|
| groups | [Link](https://docs.gitlab.com/ee/api/groups.html#list-groups) |
| projects/{projectSourceId}/repository/commits | [Link](https://docs.gitlab.com/ee/api/commits.html#list-repository-commits) |


## Errors

The table below lists potential error codes when adding a connection in DX.


| Error | Description |
|----------------------|------------------------------------------------------------------------------------------------------------------|
| `invalid_credentials` | Your API credentials entered are not valid. |
| `invalid_permissions` | Your API token does not have the permissions required by DX. |
| `no_resources` | Your API token does not have access to any projects or repositories. |


## Data Cloud API

Once the initial connection is created successfully, credentials can be managed via the Data Cloud API. This connector uses the same credential fields as [GitLab](https://docs.getdx.com/connectors/gitlab/#credential-fields) (`secrets.api_token`).

- [credentials.create](https://docs.getdx.com/datacloudapi/methods/credentials.create/)
- [credentials.update](https://docs.getdx.com/datacloudapi/methods/credentials.update/)
- [credentials.info](https://docs.getdx.com/datacloudapi/methods/credentials.info/)
- [credentials.list](https://docs.getdx.com/datacloudapi/methods/credentials.list/)
- [credentials.delete](https://docs.getdx.com/datacloudapi/methods/credentials.delete/)
---

## Sitemap

[Overview of all docs pages](/llms.txt)
