Docfiy uses access tokens and webhooks to authenticate and sync changes between GitLab and Docfiy.
- Docfiy uses access tokens to pull information from GitLab.
- GitLab uses webhooks to notify Docfiy when you make changes, which enables preview deployments for merge requests.
Set up the connection
When you open Git Settings for the first time, a setup wizard guides you through connecting your GitLab repository.
Select GitLab as your provider
On the Git Settings page, click Connect to GitLab and then click Continue.
Download your content
If your documentation is hosted by Docfiy, download it as a zip file.
- Create a new repository in GitLab.
- Extract the zip contents.
- Push the contents to your repository.
Click Continue setup to proceed.
Find your project ID
In your GitLab project, navigate to Settings > General and locate your Project ID.

Generate an access token
Navigate to Settings > Access Tokens and click Add new token.
Configure the token with these settings:
- Name: Docfiy
- Role: Maintainer (required for private repos)
- Scopes:
apiandread_api
Click Create project access token and copy the token.
If Project Access Tokens are not available, you can use a Personal Access Token instead. Note that Personal Access Tokens expire and must be updated.

Connect your repository
Back in the setup wizard, fill in the following fields:
- GitLab instance URL: Leave blank for
gitlab.com, or enter your self-hosted instance URL (for example,https://gitlab.your-domain.com). Your instance must be publicly accessible for Docfiy to reach it. - Project ID: The project ID from your GitLab project settings.
- GitLab deployment token: The access token you generated.
- Branch: Select the branch to deploy your documentation from.
Click Connect.


Update an existing connection
To modify your GitLab connection settings after the initial setup, go to Git Settings and update your project ID, access token, branch, or instance URL directly.
Revalidate Git settings
If your deployment shows unexpected behavior, such as missing branch options or stale configuration, you can force Docfiy to refresh your Git source.
Navigate to Git Settings
Go to Git Settings in your dashboard.
Revalidate your settings
Click the green Active badge in the corner of the GitLab settings box to revalidate your Git source.
Create the webhook
Webhooks notify Docfiy when you push changes so that deployments trigger automatically.
Add new webhook
- In GitLab, navigate to Settings > Webhooks.
- Click Add new webhook.

Set up URL and webhook
Name the webhook Docfiy.
In the URL field, enter the endpoint https://leaves.docfiy.com/gitlab-webhook.
Get webtoken
In your Docfiy dashboard, click Show Webtoken. Copy the webtoken.


Paste webtoken
In GitLab, paste the webtoken from your Docfiy dashboard in the Secret token field.
Select events
Select the following events to trigger the webhook:
- Push events (All branches)
- Merge requests events
Verify the webhook
You should see the following settings after configuring the webhook:
- Name: Docfiy
- URL:
https://leaves.docfiy.com/gitlab-webhook - Secret token: The webtoken from your Docfiy dashboard
- Events: Push events (All branches) and Merge requests events
Add the webhook.

Test the webhook
After you create the webhook, click the Test dropdown. Click Push events to send a sample payload. If the test returns Hook executed successfully: HTTP 200, you configured the webhook correctly.
