# On-Premises BitBucket

### Prerequisites

* The server's IP address, where the agent will be running, must be whitelisted in Bitbucket Cloud/Server.

## **Follow these steps to seamlessly integrate with BitBucket:**

## **Step 1. Generate an API Token**

1. Navigate to **Settings > Manage accounts** in BitBucket.

   <figure><img src="/files/8LbvkiqXWOqjlBK9daqR" alt=""><figcaption></figcaption></figure>
2. Click on `HTTP access tokens`.<br>

   <figure><img src="/files/dNERqhtBB9BgAl4suhOG" alt=""><figcaption></figcaption></figure>
3. Click on `Create token`.<br>

   <figure><img src="/files/T1b0on39WlzMSZxw0a3S" alt=""><figcaption></figcaption></figure>
4. Provide a name for the token, such as `dd-api-token`.
5. Give read access to `projects` and `repositories`.
6. Set the token to `Do not expire`.

   * **Note: if the token expires, you'll have to perform the integration once again!!**

   <figure><img src="/files/M1cC1qSHbiU6MO6Mcioq" alt=""><figcaption></figcaption></figure>
7. Copy the generated token.

   <figure><img src="/files/q9GhskQTRXfzZApvZujt" alt=""><figcaption></figcaption></figure>

## **Step 2. Install On-Premises Agent**

* You can refer [On-Premises Agent Installation](/installations/on-premises-agent-installation-guide.md) Guide to successfully setup agent.

With these steps completed, the integration with on-premises BitBucket is successfully done!!


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.devdynamics.ai/integrations/on-premises-bit-bucket.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
