- List projects, branches, commits, and repository files
- Create and update issues and merge requests
- Read pipelines and their status
- Build dashboards and automations on top of GitLab data
Common use cases and example apps
Use these examples to decide whether your app needs one shared GitLab connection or per-user access.Prerequisites
Before creating an app + chat connection, make sure you have:- Access to GitLab.com, GitLab Self-Managed, or GitLab Dedicated
- A GitLab personal, project, or group access token with the scopes and resource access your app needs
- Permission to create connections in your Lovable workspace, as described in Who can create connections and clients
- For a restricted Self-Managed or Dedicated instance, network rules that allow traffic from Lovable’s connector gateway IP ranges
How GitLab API connections work
An app + chat connection uses one GitLab access token. Everyone who uses the connection acts with that token’s identity, permissions, and resource access. You can create multiple connections with different tokens to separate teams, projects, or environments. Lovable sends requests through the connector gateway. The gateway stores the token securely, adds it to GitLab requests, and keeps it out of your project code and published app. For GitLab Self-Managed and GitLab Dedicated, the connection also stores your instance URL. Lovable sends API requests to that instance instead of GitLab.com.Connect GitLab API with an access token
Step 1: Create a GitLab access token
The connector accepts three GitLab access token types:Open the token settings in GitLab
Choose the minimum required scope
read_api if your app only reads GitLab data. Select api if the app creates or changes projects, issues, merge requests, pipelines, or repository files.Your token also inherits the permissions and resource access of the user or bot account that owns it. A scope cannot grant access that account does not already have.Set an expiration date
Generate and copy the token
Step 2: Connect GitLab API to Lovable
Add and verify the shared connection in Lovable.Open GitLab API in Connectors
Add an app + chat connection
Configure the connection
- Display name (optional): name the connection, for example
GitLab Production. Leave it blank and Lovable generates a name. - Access token: paste the personal, project, or group access token you created.
- Instance URL (optional): leave this empty for GitLab.com. For GitLab Self-Managed or GitLab Dedicated, expand Advanced settings and enter the instance’s HTTPS root URL, for example
https://gitlab.example.com. Do not add/api/v4or a resource path.
Choose who can use the connection
Connect
Link the connection to a project
Limitations
The GitLab app + chat connector documented on this page cannot:- Use GitLab OAuth for separate end-user accounts. For per-user OAuth, use the GitLab app user connector.
- Replace GitLab Git sync for exporting or two-way syncing your Lovable project’s codebase.
- Access resources outside the token owner’s membership, role, token type, or selected scopes.
- Refresh or rotate personal, project, or group access tokens automatically. Update the connection when a token expires, is revoked, or is rotated.
- Reach a Self-Managed or Dedicated instance that blocks Lovable’s connector gateway traffic.
- Bypass GitLab or Lovable gateway rate limits.
Troubleshooting
Use these checks if the connection or a GitLab API request fails.The connection says my access token is invalid
The connection says my access token is invalid
A request returns 429 Too Many Requests
A request returns 429 Too Many Requests
Retry-After response header, reduce polling frequency, and avoid retrying in a fast loop.A project or resource returns 404 even though it exists
A project or resource returns 404 even though it exists
404 for private resources the token cannot access. Confirm the token owner’s membership, role, token type, and scope. When using a project path in an API call, make sure the namespace and project path are URL-encoded exactly once.Lovable cannot reach my GitLab instance
Lovable cannot reach my GitLab instance
Manage your connection
Connections are managed from Connectors: select , then open the connection.- Unlink projects to remove access from specific projects while keeping the connection available for others. See Unlink projects from a connection for the steps.
- Delete the connection to remove it from the workspace entirely. Deleting is permanent. It removes the credentials from all linked projects, and app features that use stop working until a new connection is added. See Delete a connection for the steps and who can delete.