Bitbucket Cloud Configuration#
Version Requirement: This feature requires Apidog On-Premises image version
2.8.36 or later for Bitbucket Cloud and it is currently on Beta state.
To integrate with Bitbucket Cloud, create a new OAuth 2.0 consumer in your Bitbucket account settings.
For Bitbucket Cloud, visit:https://bitbucket.org/account/settings/applications/
Configuration Steps#
1.
Create the OAuth consumer.
Click Add consumer and set a descriptive name (for example, Apidog Git Integration).
2.
Callback URL.
Set the Callback URL to your Apidog On-Premises API domain, followed by /api/v1/projects/git-connections/bitbucket-callback.https://your-apidog-domain.com/api/v1/projects/git-connections/bitbucket-callback
3.
Permissions.
The server requests the OAuth scope string account repository repository:write repository:admin webhook.
The scope is fixed by the server and cannot be changed with an environment variable.
Select the consumer permissions that cover these scopes:Repositories: Read, Write, Admin
These permissions let Apidog list workspaces, read repository files, push backups and branches, create repositories, and install repo:push webhooks automatically. 4.
Save the consumer.
After creation, note the consumer Key and Secret.
These values map to BITBUCKET_CLIENT_ID and BITBUCKET_CLIENT_SECRET.
Then configure the following environment variables.
Environment Variables#
| Environment Variable | Description | Default Value | Notes |
|---|
GIT_CONNECTION_BITBUCKET_ENABLE | Whether to enable Bitbucket Cloud connection | false | Set to true to enable Bitbucket Cloud integration |
BITBUCKET_CLIENT_ID | Bitbucket OAuth consumer key | - | Required — the consumer Key from Bitbucket |
BITBUCKET_CLIENT_SECRET | Bitbucket OAuth consumer secret | - | Required — the consumer Secret from Bitbucket |
BITBUCKET_AUTH_HOST | Bitbucket OAuth authorization host URL | https://bitbucket.org/site/oauth2 | Authorization and token endpoints resolve as <authHost>/authorize and <authHost>/access_token |
BITBUCKET_API_HOST | Bitbucket Cloud API host URL | https://api.bitbucket.org/2.0 | REST API base URL used for all repository, branch, file, and webhook calls |
BITBUCKET_REDIRECT_URI | Bitbucket OAuth redirect URI | - | Required — must match the Callback URL configured in the Bitbucket consumer |
GIT_CONNECTION_BITBUCKET_REJECT_UNAUTHORIZED | SSL certificate validation for Bitbucket | true | Set to false only when an intermediate proxy serves a self-signed certificate |
GIT_CONNECTION_BITBUCKET_BACKUP_CONCURRENCY_LIMIT | Concurrent git backups per Bitbucket repository | 2 | Throttle limit per repository for scheduled backup jobs |
BITBUCKET_CLIENT_ID, BITBUCKET_CLIENT_SECRET, BITBUCKET_AUTH_HOST, and BITBUCKET_REDIRECT_URI are all required.
If any of them is missing, the server does not expose the Bitbucket connection to clients, even when GIT_CONNECTION_BITBUCKET_ENABLE is true.
The OAuth scope is fixed by the server to account repository repository:write repository:admin webhook and is not configurable.
Configuration Example for Bitbucket Cloud#
- name: GIT_CONNECTION_BITBUCKET_ENABLE
value: 'true'
- name: BITBUCKET_CLIENT_ID
value: <your-bitbucket-consumer-key>
- name: BITBUCKET_CLIENT_SECRET
value: <your-bitbucket-consumer-secret>
- name: BITBUCKET_AUTH_HOST
value: 'https://bitbucket.org/site/oauth2'
- name: BITBUCKET_API_HOST
value: 'https://api.bitbucket.org/2.0'
- name: BITBUCKET_REDIRECT_URI
value: 'https://your-apidog-domain.com/api/v1/projects/git-connections/bitbucket-callback'
- name: GIT_CONNECTION_BITBUCKET_REJECT_UNAUTHORIZED
value: 'true'
- name: GIT_CONNECTION_BITBUCKET_BACKUP_CONCURRENCY_LIMIT
value: '2'
Webhook Requirements#
The server registers a repo:push webhook on each connected repository automatically.
No manual webhook configuration is needed.
The webhook URL points to https://<your-apidog-api-domain>/api/v1/git-sync/webhook/BITBUCKET/<connection-id>.
Make sure this URL is reachable from the public Bitbucket Cloud network.