> ## Documentation Index
> Fetch the complete documentation index at: https://nango.dev/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# GitLab (Personal Access Token)

> Access the GitLab API in 2 minutes 💨

> [tab] 🚀 Quickstart
>
> **1. Create an integration**
>
> In Nango ([free signup](https://app.nango.dev)), go to [Integrations](https://app.nango.dev/dev/integrations) -> *Configure New Integration* -> *GitLab (Personal Access Token)*.
>
> **2. Authorize GitLab (Personal Access Token)**
>
> Go to [Connections](https://app.nango.dev/dev/connections) -> *Add Test Connection* -> *Authorize*, then enter your GitLab (Personal Access Token) credentials. Later, you'll let your users do the same directly from your app.
>
> **3. Call the GitLab API**
>
> Let's make your first request to the GitLab API (fetch a list of users). Replace the placeholders below with your [Environment API key](https://nango.dev/docs/reference/backend/http-api/api-keys.md), [integration ID](https://app.nango.dev/dev/integrations), and [connection ID](https://app.nango.dev/dev/connections):
>
> > [tab] cURL
> >
> > ```bash theme={null}
> > curl "https://api.nango.dev/proxy/api/v4/users?per_page=10" \
> >   -H "Authorization: Bearer <NANGO-API-KEY>" \
> >   -H "Provider-Config-Key: <INTEGRATION-ID>" \
> >   -H "Connection-Id: <CONNECTION-ID>"
> > ```
>
> > [tab] Node
> >
> > Install Nango's backend SDK with `npm i @nangohq/node`. Then run:
> >
> > ```typescript theme={null}
> > import { Nango } from '@nangohq/node';
> >
> > const nango = new Nango({ apiKey: '<NANGO-API-KEY>' });
> >
> > const res = await nango.get({
> >   endpoint: '/api/v4/users',
> >   params: {
> >     per_page: 10
> >   },
> >   providerConfigKey: '<INTEGRATION-ID>',
> >   connectionId: '<CONNECTION-ID>'
> > });
> >
> > console.log(JSON.stringify(res.data, null, 2));
> > ```
>
> Or fetch credentials dynamically via the [Node SDK](https://nango.dev/docs/reference/backend/backend-sdk/node.md#get-a-connection-with-credentials) or [API](https://nango.dev/docs/reference/backend/http-api/connections/get.md).
>
> ✅ You're connected! Check the [Logs](https://app.nango.dev/dev/logs) tab in Nango to inspect requests.
>
> > [!TIP]
> >
> > Next step: [Embed the auth flow](https://nango.dev/docs/guides/primitives/auth.md) in your app to let your users connect their GitLab accounts.

> [tab] 🔗 Useful links
>
> | Topic | Links |
> | - | - |
> | Authorization | [Guide to connect to GitLab (Personal Access Token) using Connect UI](https://nango.dev/docs/integrations/all/gitlab-pat/connect) |
> | General | [GitLab Website](https://gitlab.com/) |
> | Developer | [How to create a Personal Access Token](https://docs.gitlab.com/user/profile/personal_access_tokens/#create-a-personal-access-token) |
> | | [Personal Access Token Scopes](https://docs.gitlab.com/user/profile/personal_access_tokens/#personal-access-token-scopes) |
> | | [GitLab Personal Access Token Documentation](https://docs.gitlab.com/user/profile/personal_access_tokens/) |
> | | [GitLab REST API Documentation](https://docs.gitlab.com/ee/api/rest/) |
> | | [GitLab API Reference](https://docs.gitlab.com/ee/api/api_resources.html) |
> | | [Rate limiting](https://docs.gitlab.com/administration/settings/user_and_ip_rate_limits/) |
>
> > [!NOTE]
> >
> > Contribute useful links by [editing this page](https://github.com/nangohq/nango/tree/master/docs/integrations/all/gitlab-pat.mdx)

> [tab] 🚨 API gotchas
>
> GitLab webhook payloads do not contain a Nango connection ID, and a single connection can span many GitLab projects. To route a project or group webhook to a specific connection, append `?nangoConnectionId=<connectionId>` to the Nango webhook URL when registering the hook in GitLab. Nango reads the [`X-Gitlab-Event`](https://docs.gitlab.com/user/project/integrations/webhook_events/) header as the event type. Configure a [signing token](https://docs.gitlab.com/user/project/integrations/webhooks/#signing-tokens) on the GitLab hook and store the same value as `webhookSecret` in the Nango connection's metadata. For GitLab versions before 19.0, configure a secret token and store it in the same metadata field; Nango falls back to validating `X-Gitlab-Token` when no signature is present.
>
> > [!NOTE]
> >
> > Contribute API gotchas by [editing this page](https://github.com/nangohq/nango/tree/master/docs/integrations/all/gitlab-pat.mdx)

> [!NOTE]
>
> Questions? Join us in the [Slack community](https://nango.dev/slack).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.