GitLab

GitLab Self-Managed integrations are only available on Postman Enterprise plans.

Back up your Postman Collections to GitLab, an open-source Git repository manager, with the Postman to GitLab integration.

Setting up a GitLab integration requires you to get a GitLab Personal Access Token and configure how you would like to back up your collections.

API sync with GitLab

Postman 9.0 introduced the ability to connect a git repository to an API. Instead of using an integration, you can directly connect a GitLab repo to an API in the API Builder. This provides two-way sync of schemas and associated collections, plus adds powerful new features for syncing branches and release tags between Postman and your repo. For more information on the new repo sync feature, see Versioning APIs.

Generating a GitLab Personal Access Token

  1. Log in to GitLab.

  2. If you don’t already have a Personal Access Token from GitLab, generate a new one.

    gitlab create token

  3. Save the generated token to use later.

    gitlab save token

Configuring a backup for Postman collections in GitLab

  1. From the Home page select Integrations.

  2. Search and select GitLab.

  3. You can select View or View All to see all integrations created by your team.

    gitlab add integration

The above screen provides you the following two options:

Back up your Postman Collections to GitLab

  1. Select Add Integration to enter your GitLab token to start the integration.

    enter gitlab token

  2. Enter your GitLab Personal Access Token and select Authenticate and Proceed.

  3. Choose an existing Postman collection and your GitLab Project, and enter a filename for your backup.

  4. In Advanced Options you can enter a custom directory name or leave Postman Collections as the default. You can specify a branch for commit or the default branch of the repository will be used.

    gitlab integration configuration

  5. Select Add Integration to save your integration configuration.

Your collection is pushed to your GitLab project under the filename that you specified and saved as a single JSON file.

Every change that is saved to your Postman collection automatically commits changes to your GitLab project in real time. Your collections and code can exist in the same repository.

Back up your Postman Collections to GitLab on a custom domain

  1. If your network is behind a firewall that requires allowlisting IP addresses, you will need to use a static IP address to enable collection backups to GitLab on custom domains.

    Contact your IT team to allowlist the following static IP in your firewall to enable collection backups to GitLab:

    • US East: 3.212.102.200

    Once you allowlist this IP address, calls for this integration will be able to connect to your network and allow the integration to work as expected.

  2. Select Add Integration to enter your GitLab token to start the integration.

  3. Enter your GitLab Personal Access Token, specify your GitLab custom/self-hosted domain, and select Proceed.

  4. In the Backup your Postman Collections page, choose an existing Postman Collection and your GitLab Project, then enter a filename for your backup.

  5. In Advanced Options you can enter a custom directory name or leave Postman Collections as the default. You can specify a branch for commit or the default branch of the repository will be used. Make sure you have write access to the branch where you are trying to push your changes.

    Note that the branch you want to back up your collection to must already exist.

  6. Select Add Integration.

Your collection is pushed to your GitLab project under the directory that you specified and saved as a single JSON file.

Every change that is saved to your Postman Collection automatically commits changes to your GitLab project in real time. Your collections and code can exist in the same repository.

You can go to your GitLab domain and view your backed-up collections, as illustrated in the screen below:

gitlab advanced options 2

Last modified: 2022/01/10