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

# Jenkins connection

> Learn how to configure a Jenkins connection for Infisical.

A Jenkins connection authenticates Infisical to Jenkins with a user's [API token](https://www.jenkins.io/doc/book/system-administration/authenticating-scripted-clients/), so Infisical can list your folders and manage the credentials that your pipelines read.

> [!NOTE]
>
> This guide only authenticates Infisical with Jenkins. Once the app connection is ready, you can [use it to set up integrations](#step-3-configure-integrations).

## Prerequisites

* A Jenkins user with the following permissions:
  * Overall/Read
  * Credentials/View, Credentials/Create, Credentials/Update, and Credentials/Delete, either across Jenkins or on each folder you plan to sync to
  * Job/Read on each folder you plan to sync to and on every folder that contains it
* If your Jenkins instance isn't reachable from the internet, a [Gateway](https://infisical.com/docs/documentation/platform/gateways/overview.md) with network access to it

## Step 1: Generate a Jenkins API token

Infisical needs an API token for the Jenkins user that has the permissions in the [prerequisites](#prerequisites).

**Step 1**

Log in to Jenkins as the user from the [prerequisites](#prerequisites). Select your name in the top-right corner, then select **Security**. On older Jenkins versions, select **Configure** instead.

**Step 2**

Under **API Token**, select **Add new Token**, enter a name that identifies the token, such as `infisical`, then select **Generate**.

> [!NOTE]
>
> Use an API token, not the user's password. Infisical can't create a connection that uses a password.

**Step 3**

Copy the token and store it securely. Jenkins shows it only once.

## Step 2: Create the app connection

Next, create the app connection in Infisical.

> [!TIP]
>
> To create the connection using the API, use the Jenkins [Create](https://infisical.com/docs/api-reference/endpoints/app-connections/jenkins/create.md) endpoint. If the instance isn't reachable from the internet, include the ID of a Gateway that can reach it as `gatewayId`, or the ID of a [Gateway pool](https://infisical.com/docs/documentation/platform/gateways/gateway-pools.md) as `gatewayPoolId`.

**Organization-level**

**Step 1**

In the sidebar, select **Integrations**, then open the **App Connections** tab.

![App Connections Tab](https://mintlify.s3.us-west-1.amazonaws.com/infisical/images/app-connections/general/add-connection.png)

**Step 2**

Select **Add Connection** and choose **Jenkins**.

**Step 3**

Fill out the form's fields:

* **Name**: A descriptive name for the connection; it must be slug-friendly
* **Description** (optional): A note for future reference
* **Gateway**: The Gateway or Gateway pool to route requests through if your Jenkins instance isn't reachable from the internet; otherwise leave it as **Internet Gateway**
* **Method**: **API Token**, the only method the connection supports
* **Jenkins Instance URL**: The URL of your Jenkins instance, including the path Jenkins is served under if it has one, such as `https://ci.example.com/jenkins`
* **Jenkins Username**: The username of the Jenkins user that owns the API token
* **Jenkins API Token**: The token you copied when [generating a Jenkins API token](https://infisical.com/docs/integrations/app-connections/jenkins.md#step-1-generate-a-jenkins-api-token)

Then, select **Connect to Jenkins**.

**Project-level**

**Step 1**

In your Secrets Management project, select **Integrations** from the sidebar, then open the **App Connections** tab.

**Step 2**

Select **Add Connection** and choose **Jenkins**.

**Step 3**

Fill out the form's fields:

* **Name**: A descriptive name for the connection; it must be slug-friendly
* **Description** (optional): A note for future reference
* **Gateway**: The Gateway or Gateway pool to route requests through if your Jenkins instance isn't reachable from the internet; otherwise leave it as **Internet Gateway**
* **Method**: **API Token**, the only method the connection supports
* **Jenkins Instance URL**: The URL of your Jenkins instance, including the path Jenkins is served under if it has one, such as `https://ci.example.com/jenkins`
* **Jenkins Username**: The username of the Jenkins user that owns the API token
* **Jenkins API Token**: The token you copied when [generating a Jenkins API token](https://infisical.com/docs/integrations/app-connections/jenkins.md#step-1-generate-a-jenkins-api-token)

Then, select **Connect to Jenkins**.

When you submit the form, Infisical checks that Jenkins accepts the username and token and that the user has the Overall/Read permission.

> [!TIP]
>
> Your Jenkins app connection is ready to use.

## Step 3: Configure integrations

Now that your Jenkins app connection is configured, you can use it to set up the following integration:

> [card] [Jenkins sync](https://infisical.com/docs/integrations/secret-syncs/jenkins.md)
>
> Sync secrets from Infisical to Jenkins credentials.


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