---
title: "Get the branching model for a repository"
method: GET
path: "/repositories/{workspace}/{repo_slug}/branching-model"
tags: ["Branching model"]
---

# Get the branching model for a repository

`GET /repositories/{workspace}/{repo_slug}/branching-model`

Return the branching model as applied to the repository. This view is
read-only. The branching model settings can be changed using the
[settings](#api-repositories-workspace-repo-slug-branching-model-settings-get) API.

The returned object:

1. Always has a `development` property. `development.branch` contains
   the actual repository branch object that is considered to be the
   `development` branch. `development.branch` will not be present
   if it does not exist.
2. Might have a `production` property. `production` will not
   be present when `production` is disabled.
   `production.branch` contains the actual branch object that is
   considered to be the `production` branch. `production.branch` will
   not be present if it does not exist.
3. Always has a `branch_types` array which contains all enabled branch
   types.

## Response `200`

The branching model object

- BranchingModel — A repository's branching model
  - `type` string, required
  - `branch_types` object[] — The active branch types.
    - `kind` 'feature' | 'bugfix' | 'release' | 'hotfix', required — The kind of branch.
    - `prefix` string, required — The prefix for this branch type. A branch with this prefix will be classified as per `kind`. The prefix must be a valid prefix for a branch and must always exist. It cannot be blank, empty or `null`.
  - `development` object
    - `branch` Branch — A branch object, representing a branch in a repository.
      - `type` string, required
      - `links` object
        - `self` object — A link to a resource related to this object.
          - `href` string, uri
          - `name` string
        - `commits` object — A link to a resource related to this object.
          - `href` string, uri
          - `name` string
        - `html` object — A link to a resource related to this object.
          - `href` string, uri
          - `name` string
      - `name` string — The name of the ref.
      - `target` Commit — A repository commit object.
        - `type` string, required
        - `hash` string
        - `date` string, date-time
        - `author` Author — The author of a change in a repository
          - `type` string, required
          - `raw` string — The raw author value from the repository. This may be the only value available if the author does not match a user in Bitbucket.
          - `user` Account — An account object.
            - `type` string, required
            - `links` AccountLinks — Links related to an Account.
              - …
            - `created_on` string, date-time
            - `display_name` string
            - `uuid` string
        - `committer` Committer — The committer of a change in a repository
          - `type` string, required
          - `raw` string — The raw committer value from the repository. This may be the only value available if the committer does not match a user in Bitbucket.
          - `user` Account — An account object.
            - `type` string, required
            - `links` AccountLinks — Links related to an Account.
              - …
            - `created_on` string, date-time
            - `display_name` string
            - `uuid` string
        - `message` string
        - `summary` object
          - `raw` string — The text as it was typed by a user.
          - `markup` 'markdown' | 'creole' | 'plaintext' — The type of markup language the raw content is to be interpreted in.
          - `html` string — The user's content rendered as HTML.
        - `parents` BaseCommit[]
          - `type` string, required
          - `hash` string
          - `date` string, date-time
          - `author` Author — The author of a change in a repository
            - `type` string, required
            - `raw` string — The raw author value from the repository. This may be the only value available if the author does not match a user in Bitbucket.
            - `user` Account — An account object.
              - …
          - `committer` Committer — The committer of a change in a repository
            - `type` string, required
            - `raw` string — The raw committer value from the repository. This may be the only value available if the committer does not match a user in Bitbucket.
            - `user` Account — An account object.
              - …
          - `message` string
          - `summary` object
            - `raw` string — The text as it was typed by a user.
            - `markup` 'markdown' | 'creole' | 'plaintext' — The type of markup language the raw content is to be interpreted in.
            - `html` string — The user's content rendered as HTML.
          - `parents` BaseCommit[]
        - `repository` Repository — A Bitbucket repository.
          - `type` string, required
          - `links` object
            - `self` object — A link to a resource related to this object.
              - …
            - `html` object — A link to a resource related to this object.
              - …
            - `avatar` object — A link to a resource related to this object.
              - …
            - `pullrequests` object — A link to a resource related to this object.
              - …
            - `commits` object — A link to a resource related to this object.
              - …
            - `forks` object — A link to a resource related to this object.
              - …
            - `watchers` object — A link to a resource related to this object.
              - …
            - `downloads` object — A link to a resource related to this object.
              - …
            - `clone` object[]
              - …
            - `hooks` object — A link to a resource related to this object.
              - …
          - `uuid` string — The repository's immutable id. This can be used as a substitute for the slug segment in URLs. Doing this guarantees your URLs will survive renaming of the repository by its owner, or even transfer of the repository to a different user.
          - `full_name` string — The concatenation of the repository owner's username and the slugified name, e.g. "evzijst/interruptingcow". This is the same string used in Bitbucket URLs.
          - `is_private` boolean
          - `parent` Repository — recursive
          - `scm` 'git'
          - `owner` Account — An account object.
            - `type` string, required
            - `links` AccountLinks — Links related to an Account.
              - …
            - `created_on` string, date-time
            - `display_name` string
            - `uuid` string
          - `name` string
          - `description` string
          - `created_on` string, date-time
          - `updated_on` string, date-time
          - `size` integer
          - `language` string
          - `has_issues` boolean — The issue tracker for this repository is enabled. Issue Tracker features are not supported for repositories in workspaces administered through admin.atlassian.com.
          - `has_wiki` boolean — The wiki for this repository is enabled. Wiki features are not supported for repositories in workspaces administered through admin.atlassian.com.
          - `fork_policy` 'allow_forks' | 'no_public_forks' | 'no_forks' — Controls the rules for forking this repository. * **allow_forks**: unrestricted forking * **no_public_forks**: restrict forking to private forks (forks cannot be made public later) * **no_forks**: deny all forking
          - `project` Project — A Bitbucket project. Projects are used by teams to organize repositories.
            - `type` string, required
            - `links` object
              - …
            - `uuid` string — The project's immutable id.
            - `key` string — The project's key.
            - `owner` Team — A team object.
              - …
            - `name` string — The name of the project.
            - `description` string
            - `is_private` boolean — Indicates whether the project is publicly accessible, or whether it is private to the team and consequently only visible to team members. Note that private projects cannot contain public repositories.
            - `created_on` string, date-time
            - `updated_on` string, date-time
            - `has_publicly_visible_repos` boolean — Indicates whether the project contains publicly visible repositories. Note that private projects cannot contain public repositories.
          - `mainbranch` Branch — recursive
        - `participants` Participant[]
          - `type` string, required
          - `user` Account — An account object.
            - `type` string, required
            - `links` AccountLinks — Links related to an Account.
              - …
            - `created_on` string, date-time
            - `display_name` string
            - `uuid` string
          - `role` 'PARTICIPANT' | 'REVIEWER'
          - `approved` boolean
          - `state` string
          - `participated_on` string, date-time — The ISO8601 timestamp of the participant's action. For approvers, this is the time of their approval. For commenters and pull request reviewers who are not approvers, this is the time they last commented, or null if they have not commented.
      - `merge_strategies` string[] — Available merge strategies for pull requests targeting this branch.
      - `default_merge_strategy` string — The default merge strategy for pull requests targeting this branch.
    - `name` string, required — Name of the target branch. Will be listed here even when the target branch does not exist. Will be `null` if targeting the main branch and the repository is empty.
    - `use_mainbranch` boolean, required — Indicates if the setting points at an explicit branch (`false`) or tracks the main branch (`true`).
  - `production` object
    - `branch` Branch — A branch object, representing a branch in a repository.
      - `type` string, required
      - `links` object
        - `self` object — A link to a resource related to this object.
          - `href` string, uri
          - `name` string
        - `commits` object — A link to a resource related to this object.
          - `href` string, uri
          - `name` string
        - `html` object — A link to a resource related to this object.
          - `href` string, uri
          - `name` string
      - `name` string — The name of the ref.
      - `target` Commit — A repository commit object.
        - `type` string, required
        - `hash` string
        - `date` string, date-time
        - `author` Author — The author of a change in a repository
          - `type` string, required
          - `raw` string — The raw author value from the repository. This may be the only value available if the author does not match a user in Bitbucket.
          - `user` Account — An account object.
            - `type` string, required
            - `links` AccountLinks — Links related to an Account.
              - …
            - `created_on` string, date-time
            - `display_name` string
            - `uuid` string
        - `committer` Committer — The committer of a change in a repository
          - `type` string, required
          - `raw` string — The raw committer value from the repository. This may be the only value available if the committer does not match a user in Bitbucket.
          - `user` Account — An account object.
            - `type` string, required
            - `links` AccountLinks — Links related to an Account.
              - …
            - `created_on` string, date-time
            - `display_name` string
            - `uuid` string
        - `message` string
        - `summary` object
          - `raw` string — The text as it was typed by a user.
          - `markup` 'markdown' | 'creole' | 'plaintext' — The type of markup language the raw content is to be interpreted in.
          - `html` string — The user's content rendered as HTML.
        - `parents` BaseCommit[]
          - `type` string, required
          - `hash` string
          - `date` string, date-time
          - `author` Author — The author of a change in a repository
            - `type` string, required
            - `raw` string — The raw author value from the repository. This may be the only value available if the author does not match a user in Bitbucket.
            - `user` Account — An account object.
              - …
          - `committer` Committer — The committer of a change in a repository
            - `type` string, required
            - `raw` string — The raw committer value from the repository. This may be the only value available if the committer does not match a user in Bitbucket.
            - `user` Account — An account object.
              - …
          - `message` string
          - `summary` object
            - `raw` string — The text as it was typed by a user.
            - `markup` 'markdown' | 'creole' | 'plaintext' — The type of markup language the raw content is to be interpreted in.
            - `html` string — The user's content rendered as HTML.
          - `parents` BaseCommit[]
        - `repository` Repository — A Bitbucket repository.
          - `type` string, required
          - `links` object
            - `self` object — A link to a resource related to this object.
              - …
            - `html` object — A link to a resource related to this object.
              - …
            - `avatar` object — A link to a resource related to this object.
              - …
            - `pullrequests` object — A link to a resource related to this object.
              - …
            - `commits` object — A link to a resource related to this object.
              - …
            - `forks` object — A link to a resource related to this object.
              - …
            - `watchers` object — A link to a resource related to this object.
              - …
            - `downloads` object — A link to a resource related to this object.
              - …
            - `clone` object[]
              - …
            - `hooks` object — A link to a resource related to this object.
              - …
          - `uuid` string — The repository's immutable id. This can be used as a substitute for the slug segment in URLs. Doing this guarantees your URLs will survive renaming of the repository by its owner, or even transfer of the repository to a different user.
          - `full_name` string — The concatenation of the repository owner's username and the slugified name, e.g. "evzijst/interruptingcow". This is the same string used in Bitbucket URLs.
          - `is_private` boolean
          - `parent` Repository — recursive
          - `scm` 'git'
          - `owner` Account — An account object.
            - `type` string, required
            - `links` AccountLinks — Links related to an Account.
              - …
            - `created_on` string, date-time
            - `display_name` string
            - `uuid` string
          - `name` string
          - `description` string
          - `created_on` string, date-time
          - `updated_on` string, date-time
          - `size` integer
          - `language` string
          - `has_issues` boolean — The issue tracker for this repository is enabled. Issue Tracker features are not supported for repositories in workspaces administered through admin.atlassian.com.
          - `has_wiki` boolean — The wiki for this repository is enabled. Wiki features are not supported for repositories in workspaces administered through admin.atlassian.com.
          - `fork_policy` 'allow_forks' | 'no_public_forks' | 'no_forks' — Controls the rules for forking this repository. * **allow_forks**: unrestricted forking * **no_public_forks**: restrict forking to private forks (forks cannot be made public later) * **no_forks**: deny all forking
          - `project` Project — A Bitbucket project. Projects are used by teams to organize repositories.
            - `type` string, required
            - `links` object
              - …
            - `uuid` string — The project's immutable id.
            - `key` string — The project's key.
            - `owner` Team — A team object.
              - …
            - `name` string — The name of the project.
            - `description` string
            - `is_private` boolean — Indicates whether the project is publicly accessible, or whether it is private to the team and consequently only visible to team members. Note that private projects cannot contain public repositories.
            - `created_on` string, date-time
            - `updated_on` string, date-time
            - `has_publicly_visible_repos` boolean — Indicates whether the project contains publicly visible repositories. Note that private projects cannot contain public repositories.
          - `mainbranch` Branch — recursive
        - `participants` Participant[]
          - `type` string, required
          - `user` Account — An account object.
            - `type` string, required
            - `links` AccountLinks — Links related to an Account.
              - …
            - `created_on` string, date-time
            - `display_name` string
            - `uuid` string
          - `role` 'PARTICIPANT' | 'REVIEWER'
          - `approved` boolean
          - `state` string
          - `participated_on` string, date-time — The ISO8601 timestamp of the participant's action. For approvers, this is the time of their approval. For commenters and pull request reviewers who are not approvers, this is the time they last commented, or null if they have not commented.
      - `merge_strategies` string[] — Available merge strategies for pull requests targeting this branch.
      - `default_merge_strategy` string — The default merge strategy for pull requests targeting this branch.
    - `name` string, required — Name of the target branch. Will be listed here even when the target branch does not exist. Will be `null` if targeting the main branch and the repository is empty.
    - `use_mainbranch` boolean, required — Indicates if the setting points at an explicit branch (`false`) or tracks the main branch (`true`).

## Other responses

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

---

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