Skip to content

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 more useful.

project_key
required
string

The project in question. This is the actual key assigned to the project.

workspace
required
string

This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: {workspace UUID}.

The branching model configuration

Media type application/json
object
type
required
string
links
object
self
Link

A link to a resource related to this object.

object
href
string format: uri
name
string
branch_types
Array<object>
0 <= 4 items unique items
object
enabled

Whether the branch type is enabled or not. A disabled branch type may contain an invalid prefix.

boolean
kind
required

The kind of the branch type.

string
Allowed values: feature bugfix release hotfix
prefix

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.

string
development
object
is_valid

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.

boolean
name

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.

string
use_mainbranch

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.

boolean
production
object
is_valid

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.

boolean
name

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.

string
use_mainbranch

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.

boolean
enabled

Indicates if branch is enabled or not.

boolean
Examples
Example response
{
"development": {
"name": "null",
"use_mainbranch": true
},
"production": {
"name": "production",
"use_mainbranch": false,
"enabled": false
},
"branch_types": [
{
"kind": "release",
"enabled": true,
"prefix": "release/"
},
{
"kind": "hotfix",
"enabled": true,
"prefix": "hotfix/"
},
{
"kind": "feature",
"enabled": true,
"prefix": "feature/"
},
{
"kind": "bugfix",
"enabled": false,
"prefix": "bugfix/"
}
],
"type": "branching_model_settings",
"links": {
"self": {
"href": "https://api.bitbucket.org/.../branching-model/settings"
}
},
"default_branch_deletion": "false"
}

If the request was not authenticated

Media type application/json
Error

Base type for most resource objects. It defines the common type element that identifies an object’s type. It also identifies the element as Swagger’s discriminator.

object
type
required
string
error
object
message
required
string
detail
string
data

Optional structured data that is endpoint-specific.

object
key
additional properties
any
key
additional properties
any
Example generated
{
"type": "example",
"error": {
"message": "example",
"detail": "example",
"data": {}
}
}

If the authenticated user does not have admin access to the project

Media type application/json
Error

Base type for most resource objects. It defines the common type element that identifies an object’s type. It also identifies the element as Swagger’s discriminator.

object
type
required
string
error
object
message
required
string
detail
string
data

Optional structured data that is endpoint-specific.

object
key
additional properties
any
key
additional properties
any
Example generated
{
"type": "example",
"error": {
"message": "example",
"detail": "example",
"data": {}
}
}

If the project does not exist

Media type application/json
Error

Base type for most resource objects. It defines the common type element that identifies an object’s type. It also identifies the element as Swagger’s discriminator.

object
type
required
string
error
object
message
required
string
detail
string
data

Optional structured data that is endpoint-specific.

object
key
additional properties
any
key
additional properties
any
Example generated
{
"type": "example",
"error": {
"message": "example",
"detail": "example",
"data": {}
}
}