# Bitbucket

## Prepare for SCM Integration Setup

* Within Threat Center, navigate to Admin-> Settings->Integrations->SCM Integrations.
* Take note of your Redirect URL as you'll need it in the next step.&#x20;

## Create Group Bitbucket OAuth Application

Login to GitLab with a user that has permission to create an application

* Login to your Atlassian or Bitbucket account with a user who has permission to create an application

* If necessary, switch to Bitbucket from the top left Atlassian menu.

* Select the **Settings** cog on the top navigation bar.

* Select **Workspace settings** under **Bitbucket Administration** from the **Settings** dropdown menu.\
  If you're giving access to a workspace, make sure you have administrative access.

* Select **OAuth consumers** under **Apps and Features** on the left navigation sidebar.

* Select **Add consumer**. The **Add OAuth consumer** page appears.

* Enter Name "Threatrix"

* Enter the `Redirect URIfrom the Threatrix dashboard`

* &#x20;Select permissions as shown below

*

```
<figure><img src="/files/zZvDywUGYITD1GcNeACW" alt=""><figcaption></figcaption></figure>
```

* Click "Save"

Copy your application ID and Secret as you'll need them for the next step.&#x20;

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

## Complete SCM Integration

In Threat Center, SCM Integration,  complete the following fields&#x20;

* Name: Use a unique name that employees will recognize, like your team, group or division. If necessary, add the SCM type if there are more than one in the same group.
* Provider Type: Select BITBUCKET from the&#x20;
* Base URL: This is the URL of your SCM server
* Token URL: The Token URL of your server
* Authorization URL: The authorization URL of your server
* Client ID / Application ID: This is the Application ID or Client ID provided to you when you created your application in your SCM
* Client Secret / Secret: This is the secret provided to you when you created your application in your SCM.

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


---

# 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.threatrix.io/integrations/scm-integrations/bitbucket.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.
