Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to configure Jenkins to access Bitbucket Cloud with API token?

Ali Zahraee
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 19, 2025

I'm using Jenkins and currently we use user/password to access our git repos on Bitbucket cloud.

But Bitbucket is replacing user/passwords with API tokens. How can I configure Jenkins to use them?

1 answer

1 vote
Alexander Nilsson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
December 19, 2025

Hi Ali,

welcome to the Atlassian Community!

To configure Jenkins for Bitbucket Cloud, you should replace your standard user password with either an App Password or an SSH Key. Bitbucket Cloud uses App Passwords instead of traditional "API Tokens" for HTTPS authentication.

Option 1: Configure an App Password (HTTPS)

If you prefer using HTTPS, you must generate a scoped App Password to serve as your credential. 

  • Create: Navigate to your Personal Settings > App passwords in Bitbucket and create one with Repository: Read permissions (and Write if your pipeline needs to push). 
  • Jenkins Setup: In your Jenkins Credentials Manager, add a new credential of type Username with password.
  • Mapping: Use your Bitbucket username as the username and the generated App Password string as the password. 

Official Documentation: Create an App password 

Option 2: Use SSH Keys (Recommended)

Using SSH keys is the most secure method for Jenkins automation as it avoids the use of password-like tokens. 

  • Setup: Add your Jenkins server's public SSH key to your Bitbucket Personal Settings > SSH keys. 
  • Jenkins: Use the SSH Username with private key credential type and ensure your repository URL uses the SSH format (e.g., git@bitbucket.org:workspace/repo.git). 

Official Documentation: Set up an SSH key 

Comparison for Jenkins Integration

Feature App Password (HTTPS) SSH Key (Recommended)
Credential Type Username & Password  SSH Private Key
Security Scoped permissions No password transmission 

I hope this helps you get your Jenkins pipeline updated! Let me know if you run into any issues.

Greetings,
Alex

Hristo Simeonov
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 23, 2025

This does not answer the question, which specifically asks for API Token usage. 

Like Alexander Nilsson likes this
Alexander Nilsson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
December 25, 2025

Hi Hristo,

you’re absolutely right. Thanks for pointing it out.

In my previous reply I was mainly aiming at the “best practice” angle (using an SSH key for non-interactive automation), but I did indeed neglect the actual API token part of Ali’s question.

For completeness: Bitbucket Cloud supports API tokens, and Jenkins can use them for Git-over-HTTPS by storing the token as the secret in a standard username/password credential (token as the “password”, and either your Bitbucket username or x-bitbucket-api-token-auth as the username).

Further documentation:

Greetings,
Alex

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events