---
title: "Creates or updates the repository settings for the plug-in."
method: POST
path: "/projects/{projectKey}/repos/{repositorySlug}/settings"
tags: ["Repository settings"]
---

# Creates or updates the repository settings for the plug-in.

`POST /projects/{projectKey}/repos/{repositorySlug}/settings`

## Path parameters

- `projectKey` string, required
- `repositorySlug` string, required

## Request body

- RestRepoConfig
  - `branchOptions` 'WHITE_LIST' | 'BLACK_LIST' — Configure which branches should be analyzed or which should be ignored (default is to analyze all branches).
  - `branchOptionsBranches` string — You can use patterns as known from Bitbucket's branch permissions (syntax reference). Use whitespace as delimiter. Example: release-* develop
  - `bugPredictionAlertText` string — (Deprecated) Commits with messages that contain matches for this regex will be considered as bug-fixing commits. Examples: "fix(es|ed)?" or "fixes [A-Z]+-\d+"
  - `bugPredictionEnabled` boolean — (Deprecated) This marks files that have been recognized as hotspots in pull requests with a special comment that the reviewer should take extra care when reviewing this file. The plug-ins ranks files by the number of times they have been changed with a bug-fixing commit (i.e. a commit which fixes a bug) in the past and considers the top 10% as hotspots.
  - `bugPredictionRegex` string — (Deprecated) This text will be shown in the pull request comment for the reviewer when a file is considered as a hotspot.
  - `builtinCheckers` RestBuiltinAnalyzerConfig[] — (Deprecated, use showCodeAnalysisInPullRequest instead) List of built-in static analyzers to use for pull requests of this repository.
    - `configFrom` 'BUILTIN' | 'FROM_REPO' | 'FROM_URL' — Use either built-in configuration, one from a Git repository or one from an URL or path in the file system.
    - `configRepoPath` string — The relative path to the config file in this Git repository (e.g., config/tools/pmd-all.xml).
    - `configUrl` string — Provide an URL (e.g., https://github.com/pmd/pmd.xml) where the config can be fetched from or an absolute path (e.g., /home/bitbucket/pmd.xml) that is accessible in the filesystem you run Bitbucket Server on.
    - `enabled` boolean — Only enabled checkers will be executed when your pull requests are analyzed.
    - `maxMergeErrors` integer — This is the maximum number of reported violations with severity ERROR or FATAL allowed to merge a pull request. Leave empty to always allow merging.
    - `name` 'PMD' | 'Scalastyle' | 'CodeNarc' | 'JSLint' | 'JSHint' — This is the name of the built-in static analyzer.
    - `violationExamplesEnabled` boolean — Currently only supported by PMD; when enabled, shows examples for the found violations
  - `pullRequestTemplatesEnabled` boolean — (Deprecated) Pull request templates allow you to define a template markdown text for pull request descriptions that help contributors to add the right details when they create a pull request. Just add a file PULL_REQUEST_TEMPLATE.md (or if you do not want to clutter the root directory of your project .bitbucket/PULL_REQUEST_TEMPLATE.md) to the default branch of your repository and enable this setting to get started.
  - `showCodeAnalysisInPullRequest` boolean — Show Code Analyzes in PullRequest. Reads the build logs to extract the analyzers results.
  - `showSeverityIcon` boolean — Show severity icon in pull request messages for detected code issues (takes more space compared to plain text severity).

## Response `200`

Creates or updates the repository settings for the plug-in.

- RestRepoConfig
  - `branchOptions` 'WHITE_LIST' | 'BLACK_LIST' — Configure which branches should be analyzed or which should be ignored (default is to analyze all branches).
  - `branchOptionsBranches` string — You can use patterns as known from Bitbucket's branch permissions (syntax reference). Use whitespace as delimiter. Example: release-* develop
  - `bugPredictionAlertText` string — (Deprecated) Commits with messages that contain matches for this regex will be considered as bug-fixing commits. Examples: "fix(es|ed)?" or "fixes [A-Z]+-\d+"
  - `bugPredictionEnabled` boolean — (Deprecated) This marks files that have been recognized as hotspots in pull requests with a special comment that the reviewer should take extra care when reviewing this file. The plug-ins ranks files by the number of times they have been changed with a bug-fixing commit (i.e. a commit which fixes a bug) in the past and considers the top 10% as hotspots.
  - `bugPredictionRegex` string — (Deprecated) This text will be shown in the pull request comment for the reviewer when a file is considered as a hotspot.
  - `builtinCheckers` RestBuiltinAnalyzerConfig[] — (Deprecated, use showCodeAnalysisInPullRequest instead) List of built-in static analyzers to use for pull requests of this repository.
    - `configFrom` 'BUILTIN' | 'FROM_REPO' | 'FROM_URL' — Use either built-in configuration, one from a Git repository or one from an URL or path in the file system.
    - `configRepoPath` string — The relative path to the config file in this Git repository (e.g., config/tools/pmd-all.xml).
    - `configUrl` string — Provide an URL (e.g., https://github.com/pmd/pmd.xml) where the config can be fetched from or an absolute path (e.g., /home/bitbucket/pmd.xml) that is accessible in the filesystem you run Bitbucket Server on.
    - `enabled` boolean — Only enabled checkers will be executed when your pull requests are analyzed.
    - `maxMergeErrors` integer — This is the maximum number of reported violations with severity ERROR or FATAL allowed to merge a pull request. Leave empty to always allow merging.
    - `name` 'PMD' | 'Scalastyle' | 'CodeNarc' | 'JSLint' | 'JSHint' — This is the name of the built-in static analyzer.
    - `violationExamplesEnabled` boolean — Currently only supported by PMD; when enabled, shows examples for the found violations
  - `pullRequestTemplatesEnabled` boolean — (Deprecated) Pull request templates allow you to define a template markdown text for pull request descriptions that help contributors to add the right details when they create a pull request. Just add a file PULL_REQUEST_TEMPLATE.md (or if you do not want to clutter the root directory of your project .bitbucket/PULL_REQUEST_TEMPLATE.md) to the default branch of your repository and enable this setting to get started.
  - `showCodeAnalysisInPullRequest` boolean — Show Code Analyzes in PullRequest. Reads the build logs to extract the analyzers results.
  - `showSeverityIcon` boolean — Show severity icon in pull request messages for detected code issues (takes more space compared to plain text severity).

## Other responses

- `400` — Invalid parameters or mandatory parameters not passed
- `401` — The currently authenticated user does not have REPO_ADMIN permissions
- `404` — The given repository does not exist or there are no settings for this repository

---

[API](https://skmtc.dev/mibexsoftware/apis/code-review-assistant-for-bitbucket-server-rest-api.md) · [All operations](https://skmtc.dev/mibexsoftware/apis/code-review-assistant-for-bitbucket-server-rest-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/mibexsoftware/code-review-assistant-for-bitbucket-server-rest-api/revisions/9c894cb7039f/schema)
