v2

latestOpenAPI 3.0.02026-08-013312111.4 MB
Repositories

Create a repository

Creates a new repository.

Note: In order to set the project for the newly created repository, pass in either the project key or the project UUID as part of the request body as shown in the examples below:

$ curl -X POST -H "Content-Type: application/json" -d '{
    "scm": "git",
    "project": {
        "key": "MARS"
    }
}' https://api.bitbucket.org/2.0/repositories/teamsinspace/hablanding

or

$ curl -X POST -H "Content-Type: application/json" -d '{
    "scm": "git",
    "project": {
        "key": "{ba516952-992a-4c2d-acbd-17d502922f96}"
    }
}' https://api.bitbucket.org/2.0/repositories/teamsinspace/hablanding

The project must be assigned for all repositories. If the project is not provided, the repository is automatically assigned to the oldest project in the workspace.

Note: In the examples above, the workspace ID teamsinspace, and/or the repository name hablanding can be replaced by UUIDs.

post/repositories/{workspace}/{repo_slug}

Request body

typestring required
uuidstring

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_namestring

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_privateboolean
scm'git'
namestring
descriptionstring
created_onstring date-time
updated_onstring date-time
sizeinteger
languagestring
has_issuesboolean

The issue tracker for this repository is enabled. Issue Tracker features are not supported for repositories in workspaces administered through admin.atlassian.com.

has_wikiboolean

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

Response

The newly created repository.

typestring required
uuidstring

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_namestring

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_privateboolean
scm'git'
namestring
descriptionstring
created_onstring date-time
updated_onstring date-time
sizeinteger
languagestring
has_issuesboolean

The issue tracker for this repository is enabled. Issue Tracker features are not supported for repositories in workspaces administered through admin.atlassian.com.

has_wikiboolean

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