# BitBucket Integration

Integrating with Bitbucket allows [reporting build status](https://developer.atlassian.com/server/bitbucket/how-tos/updating-build-status-for-commits/) for your commits and pull requests. Use the web dashboard Project Settings to add or edit Bitbucket Integration.

{% hint style="info" %}
**Please note:** Bitbucket app password should have at least "Repositories:write" permissions
{% endhint %}

![Example of Bitbucket Integration](/files/-MV_HNmAfVGXXPfZSGVj)

Sorry-cypress would update build status to failure / success.

![](/files/-MV_HwXjnPdCBxM0G_NU)

If you are using the in-memory director and do not have a dashboard you can add hooks to your project via a HTTP `POST` to the `/hooks` route of your director. Ensure your "projectId" matches that in your cypress.json or cypress.config.js that you wish to add hooks to. Note this will replace all the hooks for the given projectId.

```
//Example POST body to localhost:1234/hooks

{
  "projectId": "test",
  "hooks": [
    {
      "hookId": "1",
      "url": "http://localhost:3005",
      "hookType": "BITBUCKET_STATUS_HOOK",
      "bitbucketUsername": "username",
      "bitbucketToken": "token",
      "bitbucketBuildName": "build"
    }
  ]
}

```


---

# 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.sorry-cypress.dev/integrations/bitbucket-integration.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.
