GitLab
Sync your docs with a GitLab repo
GitLab integration is available on the Enterprise plan.
We use a combination of Access tokens and Webhooks to authenticate and sync changes between GitLab and Mintlify.
- We use Access tokens to pull information from GitLab Mintlify.
- We use Webhooks so GitLab can notify Mintlify when changes are made.
- This allows Mintlify to create preview deployments when a MR is created.
Begin Setup
Within your Mintlify dashboard, click on the Settings
tab and select Git Settings
.
Switch to GitLab
Click on Switch to GitLab
which will open a panel to enter your GitLab information.
Find your project ID
In another tab, navigate to your GitLab’s project Settings
> General
and find the Project ID
.
Generate an Access token
a. Navigate to your GitLab’s project Settings
> Access Tokens
.
b. Select Add new token
.
- Name the token “Mintlify”.
- If you have a private repo, you must set the role as
Maintainer
. - Choose
api
andread_api
for the scopes.
c. Finally click Create project access token
and copy the token.
Create the webhook
a. Navigate to your GitLab’s project Settings
> Webhooks
.
b. In the “URL” field, enter the endpoint https://leaves.mintlify.com/gitlab-webhook
c. Name the webhook “Mintlify”.
d. Paste the Webhook token generated after completing the previous steps.
e. Select the events you want to trigger the webhook:
- Push events (All branches)
- Merge requests events
f. Click Add webhook
.
Test the Webhook
After creating the Webhook:
a. Click the “Test” dropdown and select “Push events” to send a sample payload to ensure it’s configured correctly.
b. Check your Mintlify dashboard to view the status of your GitLab integration and confirm that the test event was received successfully.
This will help you verify that everything is working correctly and that your documentation will sync properly with your GitLab repository.
Reach out to the Mintlify team if you need help. Contact us here.
Was this page helpful?