---
title: "Get the branching model config for a project"
method: GET
path: "/workspaces/{workspace}/projects/{project_key}/branching-model/settings"
tags: ["Branching model"]
---

# Get the branching model config for a project

`GET /workspaces/{workspace}/projects/{project_key}/branching-model/settings`

Return the branching model configuration for a project. The returned
object:

1. Always has a `development` property for the development branch.
2. Always a `production` property for the production branch. The
   production branch can be disabled.
3. The `branch_types` contains all the branch types.
4. `default_branch_deletion` indicates whether branches will be
    deleted by default on merge.


This is the raw configuration for the branching model. A client
wishing to see the branching model with its actual current branches may find the
[active model API](#api-workspaces-workspace-projects-project-key-branching-model-get)
more useful.

## Response `200`

The branching model configuration

- BranchingModelSettings — A repository's branching model settings
  - `type` string, required
  - `links` object
    - `self` object — A link to a resource related to this object.
      - `href` string, uri
      - `name` string
  - `branch_types` object[]
    - `enabled` boolean — Whether the branch type is enabled or not. A disabled branch type may contain an invalid `prefix`.
    - `kind` 'feature' | 'bugfix' | 'release' | 'hotfix', required — The kind of the branch type.
    - `prefix` string — The prefix for this branch type. A branch with this prefix will be classified as per `kind`. The `prefix` of an enabled branch type must be a valid branch prefix.Additionally, it cannot be blank, empty or `null`. The `prefix` for a disabled branch type can be empty or invalid.
  - `development` object
    - `is_valid` boolean — Indicates if the configured branch is valid, that is, if the configured branch actually exists currently. Is always `true` when `use_mainbranch` is `true` (even if the main branch does not exist). This field is read-only. This field is ignored when updating/creating settings.
    - `name` string — The configured branch. It must be `null` when `use_mainbranch` is `true`. Otherwise it must be a non-empty value. It is possible for the configured branch to not exist (e.g. it was deleted after the settings are set). In this case `is_valid` will be `false`. The branch must exist when updating/setting the `name` or an error will occur.
    - `use_mainbranch` boolean — Indicates if the setting points at an explicit branch (`false`) or tracks the main branch (`true`). When `true` the `name` must be `null` or not provided. When `false` the `name` must contain a non-empty branch name.
  - `production` object
    - `is_valid` boolean — Indicates if the configured branch is valid, that is, if the configured branch actually exists currently. Is always `true` when `use_mainbranch` is `true` (even if the main branch does not exist). This field is read-only. This field is ignored when updating/creating settings.
    - `name` string — The configured branch. It must be `null` when `use_mainbranch` is `true`. Otherwise it must be a non-empty value. It is possible for the configured branch to not exist (e.g. it was deleted after the settings are set). In this case `is_valid` will be `false`. The branch must exist when updating/setting the `name` or an error will occur.
    - `use_mainbranch` boolean — Indicates if the setting points at an explicit branch (`false`) or tracks the main branch (`true`). When `true` the `name` must be `null` or not provided. When `false` the `name` must contain a non-empty branch name.
    - `enabled` boolean — Indicates if branch is enabled or not.

## Other responses

- `401` — If the request was not authenticated
- `403` — If the authenticated user does not have admin access to the project
- `404` — If the project does not exist

---

[API](https://skmtc.dev/bitbucket/apis/bitbucket-api.md) · [All operations](https://skmtc.dev/bitbucket/apis/bitbucket-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/bitbucket/bitbucket-api/revisions/952ded611d03/schema)
